MemoryError in unnecessary conversion ''.join(chr(c) for c in file_data)

9 views
Skip to first unread message

Denis Kochetkov

unread,
Dec 18, 2014, 8:28:33 AM12/18/14
to pef...@googlegroups.com
Hello!

Following error occurs often on our build server:
 ...
   File "d:\jenkins\workspace\PAX-2.5.0-agent-win\Sources\Build\pefile.py", line 2187, in write
     new_file_data = ''.join(chr(c) for c in file_data)
 MemoryError
 </Exception>

We use Python 2.7 on Windows 7 SP1. There are many free memory on the server.

The conversion '.join(chr(c) for c in file_data in NOT required when file_data is bytearray. 
bytearray has own string conversion. It works fine and no MemoryErrors occurs. 

I attached patch. It contains replacement of unnecessary conversion on working build-it bytearray conversion. 

Could you please apply attached patch file?

With best regards, 
Denis Kochetkov
pefile.py.patch
Reply all
Reply to author
Forward
0 new messages