classification
Title: freeze tool cannot handle JSON module properly
Type: behavior Stage:
Components: Demos and Tools Versions: Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Elazar.Leibovich, sam.sp
Priority: normal Keywords:

Created on 2010-07-22 16:20 by sam.sp, last changed 2011-07-11 10:36 by Elazar.Leibovich.

Messages (3)
msg111188 - (view) Author: Sam Saint-Pettersen (sam.sp) Date: 2010-07-22 16:20
Freeze tool can generate Makefile and C code for Python programs using the JSON module. The code can be compiled fine, but when a program using the JSON module is run, this is returned:

Traceback (most recent call last): 
2	  File "myProgram.py", line 15, in <module> 
3	    import json 
4	  File "/usr/local/lib/python2.7/json/__init__.py", line 108, in <module> 
5	    from .decoder import JSONDecoder 
6	  File "/usr/local/lib/python2.7/json/decoder.py", line 24, in <module> 
7	    NaN, PosInf, NegInf = _floatconstants() 
8	  File "/usr/local/lib/python2.7/json/decoder.py", line 18, in _floatconstants 
9	    _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') 
10	LookupError: unknown encoding: hex 

Something to do with .decode('hex') apparently.
msg111231 - (view) Author: Sam Saint-Pettersen (sam.sp) Date: 2010-07-23 01:19
Problem occurs with "frozen" programs if:


from encodings import hex_codec 

...is not explicitly written in the script.
msg140105 - (view) Author: Elazar Leibovich (Elazar.Leibovich) Date: 2011-07-11 10:36
Similar problem occurs if you do not specify

   from encodings import ascii

You can get

   LookupError: unknown encoding: ascii
History
Date User Action Args
2011-07-11 10:36:30Elazar.Leibovichsetstatus: pending -> open
nosy: + Elazar.Leibovich
messages: + msg140105

2010-07-23 01:19:36sam.spsetstatus: open -> pending

messages: + msg111231
2010-07-22 16:20:55sam.spcreate