LookupError: unknown encoding: windows-1252

695 views
Skip to first unread message

Paul Pearcy

unread,
May 1, 2017, 1:52:19 AM5/1/17
to Kivy users support
Heya,
  I last built using buildozer version 0.33dev sometime in late January. 

I am building my app with the current 0.33dev (with latest kivy dev) and am running into an odd encoding error. Seems the Python install is not aware of windows-1252:
"/private/lib/python2.7/site-packages/webencodings/__init__.py", line 85, in lookup LookupError: unknown encoding: windows-1252

Does anybody know how to fix this? 

Alternatively, is there a good way to peg the my buildozer config to a specific kivy commit so that I can use the late January version? 

Thanks!
Paul

Paul Pearcy

unread,
May 1, 2017, 11:59:04 PM5/1/17
to Kivy users support
I've traced this down to what appears to be a missing encodings.cp1252 module. I can reproduce with the following main method:

import encodings.cp1252
if __name__ == '__main__':
encodings.cp1252.Codec

If anyone has any tips or knows how to debug further it would be much appreciated. 

Thanks

Paul Pearcy

unread,
May 2, 2017, 1:38:16 AM5/2/17
to Kivy users support
Well, I got something working... but it is completely insane :)

If anyone else is having trouble with mysterious missing codecs, this might help, but is very wrong. 

I am manually registering my own codecs search function that injects a copy of cp1252.py I copied into my project:

import codecs

def search_function(encoding):
if encoding in ['cp1252', 'windows-1252', '1252', 'magic']:
mod = __import__('hack.cp1252', fromlist=['*'], level=0)
entry = mod.getregentry()

return entry
else:
return None

if __name__ == '__main__':
codecs.register(search_function)

app = MyApp()
app.run()
Reply all
Reply to author
Forward
0 new messages