XZise created this task. XZise added a subscriber: XZise. XZise added a project: pywikibot-core. Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION The API cache is not operable between Python versions. I do basically this:
```
import pickle with open('tests/apicache/735234d1f97ef2e764af8a361be182b3ead3e90b05e56910e9ead87453140d37', 'rb') as f:
... c = f.read() ...
pickle.loads(c)
```
And in Python 2 this works and returns something usable while in Python 3 you only get:
``` Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0xdf in position 1: ordinal not in range(128) ```
Now this is not much of a problem usually if people stick to their version but considering that pickle shouldn't be trusted with external data I'm wondering if we should cache requests differently. For example in a json files we could utilize that we expect json data itself so we could wrap that data in json itself.
TASK DETAIL https://phabricator.wikimedia.org/T100971
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: pywikipedia-bugs, Aklapper, XZise, jayvdb
jayvdb added a subscriber: jayvdb. jayvdb added a comment.
Using a JSON file format sounds logical.
TASK DETAIL https://phabricator.wikimedia.org/T100971
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: jayvdb, Aklapper, XZise, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org