Problem with uudecode

Steve Holden sholden at holdenweb.com
Tue May 25 18:54:44 EDT 2004


Juho Saarikko wrote:
> I made a Python script which takes Usenet message bodies from a database,
> decodes uuencoded contents and inserts them as Large Object into a
> PostGreSQL database. However, it appears that the to last few bytes
> of uudecoded data are always mangled. Take a look of this hexdump output:
> 
> Originals (decoded with Pan, each line is from a different file):
> 000c2c0 e1bf 00ff 2541 a9e4 a724 d9ff
> 0011a10 ff54 00d9
> 00093e0 fb4f a80d ffd9 c200 ffef 00d9
> 
> Decoded by the script:
> 000c2c0 e1bf 00ff 2541 a9e4 a724 d0ff
> 0011a10 ff54 00d8
> 00093e0 fb4f a80d ffd9 c200 ffef 00d8
> 
> As you can see, one of the last two bytes gets altered in all cases.
> 
> The script also outputs the decoded file to disk for debugging purposes,
> and the database large object and filesystem file match so it can't be a
> PostGreSQL problem.
> 
> So, if anyone has any idea what is wrong, please tell me ? I can't found
> any reason why the bytes would get mangled...
> 
> The script follows:
> 
[...]
I note that you are dumping words rather than bytes. Is it possible that 
         the last byte isn't actually a part of the file, that 
endianness makes the last byte look like the penultimate byte, and that 
what you are seeing is simply noise?

If not then it should probably be looked into ...

regards
  Steve



More information about the Python-list mailing list