nirai-compiler / src

Core Nirai repo
Other
22 stars 5 forks source link

(macos) Error when trying to use json: no codec search functions registered: can't find encoding #26

Closed ghost closed 7 years ago

ghost commented 7 years ago

I'm not the best with wording things, but here goes:

When I try to use json in Nirai, specifically the decode module of json, I get this traceback.

Traceback (most recent call last):
  File "NiraiStart", line 58, in <module>
  File "toontown.toonbase.ClientStart", line 100, in <module>
  File "otp.settings.Settings", line 2, in <module>
  File "json", line 108, in <module>
  File "json.decoder", line 24, in <module>
  File "json.decoder", line 18, in _floatconstants
LookupError: no codec search functions registered: can't find encoding

Line 18 of json.decoder is this:

_BYTES = '7FF80000000000007FF0000000000000'.decode('hex')

And that makes me believe this is a Nirai issue because it's something as simple as .decode(). But let's not lay blame on eachother :p.

Is there anything I can do to fix this?

ghost commented 7 years ago

Wow will somebody please just end me right now.... the fix was as simple as "import encodings".. at least I figured it out by myself, shows im not full idiot i guess '-'

mfwass commented 7 years ago

See https://github.com/loblao/libpandadna/issues/58#issuecomment-310853229