-
Notifications
You must be signed in to change notification settings - Fork 76
Home
lucjon edited this page Sep 14, 2010
·
28 revisions
Welcome to the Py-StackExchange wiki!
- Fix/investigate this bug
- Implement search and post revisions
- Convert keyword arguments to correct strings (i.e.,
('hello', 'world')becomes'hello;world',10becomes'10'). -
Look at adding support for gzip-compressed responsesdone.
Before checking here, I’d suggest updating to the latest version of the library, either through a git pull or downloading a ZIP or tarball and extracting it over the existing files – bugs are being fixed all the time.
-
Why do I get an empty list on
user.answersoruser.questionsorbadge.recipientsetc.?
To reduce the number of API calls the library makes, collections which would require another request to populate require explicit ‘fetching’ of the data, with, for exampleuser.answers.fetch(). This will return the list with the new items, and also update the property on the original object. -
Why does
answer.bodyorquestion.bodyraise anAttributeError?
Question and answer bodies must be explicitly fetched (through the specification of a parameter) to save bandwidth. (This is a restriction ‘imposed’ by the API.) To do this, you can either use thebody='true'keyword argument to your request:
so = stackexchange.Site(stackexchange.StackOverflow)
q = so.question(4, body='true')user.answers), call so.be_inclusive() before making any requests.
-
Why do I get a
ValueError: No JSON object could be decodedmessage?
This is probably the result of some proxy/router mangling with request headers. It could be that your router/proxy adds headers requesting gzip data, but doesn’t decompress it, and that you are running a slightly old version of the code which does not deal with gzip compression. In this case, just update to the latest version of the library.
Otherwise, please send me a stack trace and any other details you have through StackApps – just submit an answer. -
What’s the Py-StackExchange equivalent of the URL
users/41981/questions?
Just usesite.{questions|answers|etc}(user_id=41981). -
Why do I get a ‘not a gzip file’ or similar error?
Something could be disposing of, or decompressing, the gzip headers or data respectively. In this case, before making your first request, usesite.use_gzip = False.
If this doesn’t solve the problem, send me a bug report through StackApps (see previous question). -
fetch_next()returns an empty tuple where it shouldn’t. Sometimes it works if the code is moved somewhere else.
I’m not exactly sure what’s going on here, but try rearranging your code if your problem matches this description.
Otherwise, send me a bug report through StackApps.