Coder Social home page Coder Social logo

ff-record-keeper's People

Contributors

markcerqueira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

retorikku

ff-record-keeper's Issues

ensure utf-8 decode by default

Hi,
it's a helpful tool you've done, but when trying to make it works under linux ubuntu, I ran into this critical error as soon as it reached a step requiring to decode the JSON data :

/dff/battle/get_battle_init_data called
Traceback (most recent call last):
File "FFRKProxy.py", line 113, in
...
File "FFRKProxy.py", line 70, in handle_response
json_data = json.loads(flow.response.content)
File "/usr/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Problem is, it seems that by default on linux, it doesn't check or default to utf, the data type needs to be explicit.
I used the solution given here for Windows :
https://www.reddit.com/r/FFRecordKeeper/comments/34p36e/how_to_peek_items_drops_in_windows/cqwyroo

by adding a .decode('utf-8-sig') to all json.loads(flow.response.content), and it worked perfectly

Could you add this as default, or in a less static way, reuse in the json.loads the charset data from the http response-headers ?
It would fix both the issue on Windows and on some, if not all, linux distribs

Python 3

Any particular reason you are using Python 2.7 instead of Python 3? It sucks that I had to download an old version of Python for this :(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.