Problem with uudecode

Juho Saarikko sorry at but.no.spam
Tue May 25 15:58:15 EDT 2004


On Tue, 25 May 2004 22:04:24 +0300, Ville Vainio wrote:

>>>>>> "Juho" == Juho Saarikko <sorry at but.no.spam> writes:
> 
>     Juho> I made a Python script which takes Usenet message bodies
>     Juho> from a database, decodes uuencoded contents and inserts them
>     Juho> as Large Object into a PostGreSQL database. However, it
>     Juho> appears that the to last few bytes
> 
> I skimmed through your program, and noticed that you use binascii
> module uuencode/decode. Have you given the "uu" module a try, to see
> if it works better?

I did examine the uu module, but it would seem that I'd had to parse the
message first anyway to get the file name and the non-binary parts of the
message as keywords. Besides, as I understand it, the uu module uses the
binascii module, so if there's something wrong with the binascii module,
the uu module can't possibly work well.

Oh well, I would had to write the parsing engine anyway (or learn to
use the e-mail classes), to properly handle mime and yenc messages. And I
suppose I'd better start using imagemagic to verify the mimetype of
decoded files, instead of just believing the filename. And join together
files that have been spread over multiple messages. Work, work, work...

> Also, get rid of "regex" module, it even gives a DeprecationWarning
> suggesting switching to "re".

I would, if I knew how to make regular expressions; I found the uu-parsing
snippet from the net and built my script around it, but the
regular expression doesn't seem to work with the re module.



More information about the Python-list mailing list