Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IronPython "LookupError: unknown encoding: hex"

When I try to "import simplejson" (or something that depends on it) in IronPython 2.0, I get "LookupError: unknown encoding: hex". How do I make this work?

like image 644
sblom Avatar asked Feb 26 '09 01:02

sblom


2 Answers

The workaround for this is to import the hex codec manually before attempting to import the broken dependency:

from encodings import hex_codec

The issue is being tracked by IronPython, but so far, they claim it's a bug in the standard Python library.

like image 184
sblom Avatar answered Nov 17 '22 09:11

sblom


Thanks, sblom. I think IronPython crew are right in saying its a bug in the standard library (or at least Freeze tool as of 2.7). Problem occurs with "frozen" programs iffrom encodings import hex_codec is not explicitly written in the script.

Sorry to 'necro-post', but this issue I feel was relevant, at least in regard to the Freeze tool.

like image 2
Sam Saint-Pettersen Avatar answered Nov 17 '22 10:11

Sam Saint-Pettersen