Source code:Lib/uu.py
This module encodes and decodes files in uuencode format, allowing arbitrarybinary data to be transferred over ASCII-only connections. Wherever a fileargument is expected, the methods accept a file-like object. For backwardscompatibility, a string containing a pathname is also accepted, and thecorresponding file will be opened for reading and writing; the pathname'-'is understood to mean the standard input or output. However, this interface isdeprecated; it’s better for the caller to open the file itself, and be surethat, when required, the mode is'rb' or'wb' on Windows.
This code was contributed by Lance Ellinghouse, and modified by Jack Jansen.
Theuu module defines the following functions:
Uuencode filein_file into fileout_file. The uuencoded file will havethe header specifyingname andmode as the defaults for the results ofdecoding the file. The default defaults are taken fromin_file, or'-'and0o666 respectively.
This call decodes uuencoded filein_file placing the result on fileout_file. Ifout_file is a pathname,mode is used to set the permissionbits if the file must be created. Defaults forout_file andmode are takenfrom the uuencode header. However, if the file specified in the header alreadyexists, auu.Error is raised.
decode() may print a warning to standard error if the input was producedby an incorrect uuencoder and Python could recover from that error. Settingquiet to a true value silences this warning.
Subclass ofException, this can be raised byuu.decode() undervarious situations, such as described above, but also including a badlyformatted header, or truncated input file.
See also
19.9.quopri — Encode and decode MIME quoted-printable data
20. Structured Markup Processing Tools
Enter search terms or a module, class or function name.