pickled schema file problem on windows
Brought to you by:
pabigot
Originally created by: Barry.Gallagher@…
My second issue was in using archived files for schemas using
namespaces. I would get an ImportError and it turns out that the
pickled file was written in mode "a+" and on windows that ends the lines
with "\r\n". When pickle would read the data the modules would have an
extra "\r" at the end of strings and lead to an error like this:
File
"c:\PydroTrunk\pydro\lib\site-packages\pyxb\namespace\archive.py", line
357, in createUnpickler
self.generationUID = unpickler.load()
ImportError: No module named utility
I changed line 608 of utils/utility to use append binary and things are
happy.
fp = file(file_name, 'ab+')
The recommended patch seems to be plausible and to cause no problems.
commit df6aa0c742df7d4b4b27c350690b1a650ed261d1
Date: Sat May 21 23:04:32 2011 -0500