Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The problem is in gauth.py (part of the gdata client library) at about line 587 in version 2.0.15.</p> <p>The value for the "max-results" parameter being passed to urllib.quote is 10000, an integer, not a string, so it doesn't have an iterator.</p> <p>My quick hacky fix is:</p> <pre><code> for key in sorted_keys: safe_str_param = urllib.quote(str(params[key]), safe='~') pairs.append('%s=%s' % (urllib.quote(key, safe='~'), safe_str_param)) </code></pre> <p>You can track down the problem yourself by using pdb, like this:</p> <pre><code>python -m pdb pagination_demo.py &gt; ga-api-http-samples-read-only/src/data_export/v2/python/pagination/pagination_demo.py(35)&lt;module&gt;() -&gt; """ """ # Note that (Pdb) indicates a prompt from the debugger (Pdb) c Executing query: https://www.google.com/analytics/feeds/data?max-results=10000&amp;...&amp;start-date=2011-01-01&amp;ids=ga%3A999999&amp;metrics=ga%3Apageviews&amp;end-date=2011-12-30 # then you get more or less your trace above, plus this: TypeError: argument 2 to map() must support iteration Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program &gt; lib/python2.6/urllib.py(1224)quote() -&gt; res = map(safe_map.__getitem__, s) # Ok, let's see what the type of 's' is with pretty print (Pdb) pp type(s) &lt;type 'int'&gt; (Pdb) q </code></pre> <p>If everything works (like when you add my hack above to gauth.py), you'll see this instead of the stack trace:</p> <pre><code>Total results found: 124 Total pages needed, with one page per API request: 1 The program finished and will be restarted &gt; ga-api-http-samples-read-only/src/data_export/v2/python/pagination/pagination_demo.py(35)&lt;module&gt;() -&gt; """ (Pdb) q </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload