Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/imh-pyth.../lib/python2....
File: mimify.py
#! /usr/bin/env python
[0] Fix | Delete
[1] Fix | Delete
"""Mimification and unmimification of mail messages.
[2] Fix | Delete
[3] Fix | Delete
Decode quoted-printable parts of a mail message or encode using
[4] Fix | Delete
quoted-printable.
[5] Fix | Delete
[6] Fix | Delete
Usage:
[7] Fix | Delete
mimify(input, output)
[8] Fix | Delete
unmimify(input, output, decode_base64 = 0)
[9] Fix | Delete
to encode and decode respectively. Input and output may be the name
[10] Fix | Delete
of a file or an open file object. Only a readline() method is used
[11] Fix | Delete
on the input file, only a write() method is used on the output file.
[12] Fix | Delete
When using file names, the input and output file names may be the
[13] Fix | Delete
same.
[14] Fix | Delete
[15] Fix | Delete
Interactive usage:
[16] Fix | Delete
mimify.py -e [infile [outfile]]
[17] Fix | Delete
mimify.py -d [infile [outfile]]
[18] Fix | Delete
to encode and decode respectively. Infile defaults to standard
[19] Fix | Delete
input and outfile to standard output.
[20] Fix | Delete
"""
[21] Fix | Delete
[22] Fix | Delete
# Configure
[23] Fix | Delete
MAXLEN = 200 # if lines longer than this, encode as quoted-printable
[24] Fix | Delete
CHARSET = 'ISO-8859-1' # default charset for non-US-ASCII mail
[25] Fix | Delete
QUOTE = '> ' # string replies are quoted with
[26] Fix | Delete
# End configure
[27] Fix | Delete
[28] Fix | Delete
import re
[29] Fix | Delete
[30] Fix | Delete
import warnings
[31] Fix | Delete
warnings.warn("the mimify module is deprecated; use the email package instead",
[32] Fix | Delete
DeprecationWarning, 2)
[33] Fix | Delete
[34] Fix | Delete
__all__ = ["mimify","unmimify","mime_encode_header","mime_decode_header"]
[35] Fix | Delete
[36] Fix | Delete
qp = re.compile('^content-transfer-encoding:\\s*quoted-printable', re.I)
[37] Fix | Delete
base64_re = re.compile('^content-transfer-encoding:\\s*base64', re.I)
[38] Fix | Delete
mp = re.compile('^content-type:.*multipart/.*boundary="?([^;"\n]*)', re.I|re.S)
[39] Fix | Delete
chrset = re.compile('^(content-type:.*charset=")(us-ascii|iso-8859-[0-9]+)(".*)', re.I|re.S)
[40] Fix | Delete
he = re.compile('^-*\n')
[41] Fix | Delete
mime_code = re.compile('=([0-9a-f][0-9a-f])', re.I)
[42] Fix | Delete
mime_head = re.compile('=\\?iso-8859-1\\?q\\?([^? \t\n]+)\\?=', re.I)
[43] Fix | Delete
repl = re.compile('^subject:\\s+re: ', re.I)
[44] Fix | Delete
[45] Fix | Delete
class File:
[46] Fix | Delete
"""A simple fake file object that knows about limited read-ahead and
[47] Fix | Delete
boundaries. The only supported method is readline()."""
[48] Fix | Delete
[49] Fix | Delete
def __init__(self, file, boundary):
[50] Fix | Delete
self.file = file
[51] Fix | Delete
self.boundary = boundary
[52] Fix | Delete
self.peek = None
[53] Fix | Delete
[54] Fix | Delete
def readline(self):
[55] Fix | Delete
if self.peek is not None:
[56] Fix | Delete
return ''
[57] Fix | Delete
line = self.file.readline()
[58] Fix | Delete
if not line:
[59] Fix | Delete
return line
[60] Fix | Delete
if self.boundary:
[61] Fix | Delete
if line == self.boundary + '\n':
[62] Fix | Delete
self.peek = line
[63] Fix | Delete
return ''
[64] Fix | Delete
if line == self.boundary + '--\n':
[65] Fix | Delete
self.peek = line
[66] Fix | Delete
return ''
[67] Fix | Delete
return line
[68] Fix | Delete
[69] Fix | Delete
class HeaderFile:
[70] Fix | Delete
def __init__(self, file):
[71] Fix | Delete
self.file = file
[72] Fix | Delete
self.peek = None
[73] Fix | Delete
[74] Fix | Delete
def readline(self):
[75] Fix | Delete
if self.peek is not None:
[76] Fix | Delete
line = self.peek
[77] Fix | Delete
self.peek = None
[78] Fix | Delete
else:
[79] Fix | Delete
line = self.file.readline()
[80] Fix | Delete
if not line:
[81] Fix | Delete
return line
[82] Fix | Delete
if he.match(line):
[83] Fix | Delete
return line
[84] Fix | Delete
while 1:
[85] Fix | Delete
self.peek = self.file.readline()
[86] Fix | Delete
if len(self.peek) == 0 or \
[87] Fix | Delete
(self.peek[0] != ' ' and self.peek[0] != '\t'):
[88] Fix | Delete
return line
[89] Fix | Delete
line = line + self.peek
[90] Fix | Delete
self.peek = None
[91] Fix | Delete
[92] Fix | Delete
def mime_decode(line):
[93] Fix | Delete
"""Decode a single line of quoted-printable text to 8bit."""
[94] Fix | Delete
newline = ''
[95] Fix | Delete
pos = 0
[96] Fix | Delete
while 1:
[97] Fix | Delete
res = mime_code.search(line, pos)
[98] Fix | Delete
if res is None:
[99] Fix | Delete
break
[100] Fix | Delete
newline = newline + line[pos:res.start(0)] + \
[101] Fix | Delete
chr(int(res.group(1), 16))
[102] Fix | Delete
pos = res.end(0)
[103] Fix | Delete
return newline + line[pos:]
[104] Fix | Delete
[105] Fix | Delete
def mime_decode_header(line):
[106] Fix | Delete
"""Decode a header line to 8bit."""
[107] Fix | Delete
newline = ''
[108] Fix | Delete
pos = 0
[109] Fix | Delete
while 1:
[110] Fix | Delete
res = mime_head.search(line, pos)
[111] Fix | Delete
if res is None:
[112] Fix | Delete
break
[113] Fix | Delete
match = res.group(1)
[114] Fix | Delete
# convert underscores to spaces (before =XX conversion!)
[115] Fix | Delete
match = ' '.join(match.split('_'))
[116] Fix | Delete
newline = newline + line[pos:res.start(0)] + mime_decode(match)
[117] Fix | Delete
pos = res.end(0)
[118] Fix | Delete
return newline + line[pos:]
[119] Fix | Delete
[120] Fix | Delete
def unmimify_part(ifile, ofile, decode_base64 = 0):
[121] Fix | Delete
"""Convert a quoted-printable part of a MIME mail message to 8bit."""
[122] Fix | Delete
multipart = None
[123] Fix | Delete
quoted_printable = 0
[124] Fix | Delete
is_base64 = 0
[125] Fix | Delete
is_repl = 0
[126] Fix | Delete
if ifile.boundary and ifile.boundary[:2] == QUOTE:
[127] Fix | Delete
prefix = QUOTE
[128] Fix | Delete
else:
[129] Fix | Delete
prefix = ''
[130] Fix | Delete
[131] Fix | Delete
# read header
[132] Fix | Delete
hfile = HeaderFile(ifile)
[133] Fix | Delete
while 1:
[134] Fix | Delete
line = hfile.readline()
[135] Fix | Delete
if not line:
[136] Fix | Delete
return
[137] Fix | Delete
if prefix and line[:len(prefix)] == prefix:
[138] Fix | Delete
line = line[len(prefix):]
[139] Fix | Delete
pref = prefix
[140] Fix | Delete
else:
[141] Fix | Delete
pref = ''
[142] Fix | Delete
line = mime_decode_header(line)
[143] Fix | Delete
if qp.match(line):
[144] Fix | Delete
quoted_printable = 1
[145] Fix | Delete
continue # skip this header
[146] Fix | Delete
if decode_base64 and base64_re.match(line):
[147] Fix | Delete
is_base64 = 1
[148] Fix | Delete
continue
[149] Fix | Delete
ofile.write(pref + line)
[150] Fix | Delete
if not prefix and repl.match(line):
[151] Fix | Delete
# we're dealing with a reply message
[152] Fix | Delete
is_repl = 1
[153] Fix | Delete
mp_res = mp.match(line)
[154] Fix | Delete
if mp_res:
[155] Fix | Delete
multipart = '--' + mp_res.group(1)
[156] Fix | Delete
if he.match(line):
[157] Fix | Delete
break
[158] Fix | Delete
if is_repl and (quoted_printable or multipart):
[159] Fix | Delete
is_repl = 0
[160] Fix | Delete
[161] Fix | Delete
# read body
[162] Fix | Delete
while 1:
[163] Fix | Delete
line = ifile.readline()
[164] Fix | Delete
if not line:
[165] Fix | Delete
return
[166] Fix | Delete
line = re.sub(mime_head, '\\1', line)
[167] Fix | Delete
if prefix and line[:len(prefix)] == prefix:
[168] Fix | Delete
line = line[len(prefix):]
[169] Fix | Delete
pref = prefix
[170] Fix | Delete
else:
[171] Fix | Delete
pref = ''
[172] Fix | Delete
## if is_repl and len(line) >= 4 and line[:4] == QUOTE+'--' and line[-3:] != '--\n':
[173] Fix | Delete
## multipart = line[:-1]
[174] Fix | Delete
while multipart:
[175] Fix | Delete
if line == multipart + '--\n':
[176] Fix | Delete
ofile.write(pref + line)
[177] Fix | Delete
multipart = None
[178] Fix | Delete
line = None
[179] Fix | Delete
break
[180] Fix | Delete
if line == multipart + '\n':
[181] Fix | Delete
ofile.write(pref + line)
[182] Fix | Delete
nifile = File(ifile, multipart)
[183] Fix | Delete
unmimify_part(nifile, ofile, decode_base64)
[184] Fix | Delete
line = nifile.peek
[185] Fix | Delete
if not line:
[186] Fix | Delete
# premature end of file
[187] Fix | Delete
break
[188] Fix | Delete
continue
[189] Fix | Delete
# not a boundary between parts
[190] Fix | Delete
break
[191] Fix | Delete
if line and quoted_printable:
[192] Fix | Delete
while line[-2:] == '=\n':
[193] Fix | Delete
line = line[:-2]
[194] Fix | Delete
newline = ifile.readline()
[195] Fix | Delete
if newline[:len(QUOTE)] == QUOTE:
[196] Fix | Delete
newline = newline[len(QUOTE):]
[197] Fix | Delete
line = line + newline
[198] Fix | Delete
line = mime_decode(line)
[199] Fix | Delete
if line and is_base64 and not pref:
[200] Fix | Delete
import base64
[201] Fix | Delete
line = base64.decodestring(line)
[202] Fix | Delete
if line:
[203] Fix | Delete
ofile.write(pref + line)
[204] Fix | Delete
[205] Fix | Delete
def unmimify(infile, outfile, decode_base64 = 0):
[206] Fix | Delete
"""Convert quoted-printable parts of a MIME mail message to 8bit."""
[207] Fix | Delete
if type(infile) == type(''):
[208] Fix | Delete
ifile = open(infile)
[209] Fix | Delete
if type(outfile) == type('') and infile == outfile:
[210] Fix | Delete
import os
[211] Fix | Delete
d, f = os.path.split(infile)
[212] Fix | Delete
os.rename(infile, os.path.join(d, ',' + f))
[213] Fix | Delete
else:
[214] Fix | Delete
ifile = infile
[215] Fix | Delete
if type(outfile) == type(''):
[216] Fix | Delete
ofile = open(outfile, 'w')
[217] Fix | Delete
else:
[218] Fix | Delete
ofile = outfile
[219] Fix | Delete
nifile = File(ifile, None)
[220] Fix | Delete
unmimify_part(nifile, ofile, decode_base64)
[221] Fix | Delete
ofile.flush()
[222] Fix | Delete
[223] Fix | Delete
mime_char = re.compile('[=\177-\377]') # quote these chars in body
[224] Fix | Delete
mime_header_char = re.compile('[=?\177-\377]') # quote these in header
[225] Fix | Delete
[226] Fix | Delete
def mime_encode(line, header):
[227] Fix | Delete
"""Code a single line as quoted-printable.
[228] Fix | Delete
If header is set, quote some extra characters."""
[229] Fix | Delete
if header:
[230] Fix | Delete
reg = mime_header_char
[231] Fix | Delete
else:
[232] Fix | Delete
reg = mime_char
[233] Fix | Delete
newline = ''
[234] Fix | Delete
pos = 0
[235] Fix | Delete
if len(line) >= 5 and line[:5] == 'From ':
[236] Fix | Delete
# quote 'From ' at the start of a line for stupid mailers
[237] Fix | Delete
newline = ('=%02x' % ord('F')).upper()
[238] Fix | Delete
pos = 1
[239] Fix | Delete
while 1:
[240] Fix | Delete
res = reg.search(line, pos)
[241] Fix | Delete
if res is None:
[242] Fix | Delete
break
[243] Fix | Delete
newline = newline + line[pos:res.start(0)] + \
[244] Fix | Delete
('=%02x' % ord(res.group(0))).upper()
[245] Fix | Delete
pos = res.end(0)
[246] Fix | Delete
line = newline + line[pos:]
[247] Fix | Delete
[248] Fix | Delete
newline = ''
[249] Fix | Delete
while len(line) >= 75:
[250] Fix | Delete
i = 73
[251] Fix | Delete
while line[i] == '=' or line[i-1] == '=':
[252] Fix | Delete
i = i - 1
[253] Fix | Delete
i = i + 1
[254] Fix | Delete
newline = newline + line[:i] + '=\n'
[255] Fix | Delete
line = line[i:]
[256] Fix | Delete
return newline + line
[257] Fix | Delete
[258] Fix | Delete
mime_header = re.compile('([ \t(]|^)([-a-zA-Z0-9_+]*[\177-\377][-a-zA-Z0-9_+\177-\377]*)(?=[ \t)]|\n)')
[259] Fix | Delete
[260] Fix | Delete
def mime_encode_header(line):
[261] Fix | Delete
"""Code a single header line as quoted-printable."""
[262] Fix | Delete
newline = ''
[263] Fix | Delete
pos = 0
[264] Fix | Delete
while 1:
[265] Fix | Delete
res = mime_header.search(line, pos)
[266] Fix | Delete
if res is None:
[267] Fix | Delete
break
[268] Fix | Delete
newline = '%s%s%s=?%s?Q?%s?=' % \
[269] Fix | Delete
(newline, line[pos:res.start(0)], res.group(1),
[270] Fix | Delete
CHARSET, mime_encode(res.group(2), 1))
[271] Fix | Delete
pos = res.end(0)
[272] Fix | Delete
return newline + line[pos:]
[273] Fix | Delete
[274] Fix | Delete
mv = re.compile('^mime-version:', re.I)
[275] Fix | Delete
cte = re.compile('^content-transfer-encoding:', re.I)
[276] Fix | Delete
iso_char = re.compile('[\177-\377]')
[277] Fix | Delete
[278] Fix | Delete
def mimify_part(ifile, ofile, is_mime):
[279] Fix | Delete
"""Convert an 8bit part of a MIME mail message to quoted-printable."""
[280] Fix | Delete
has_cte = is_qp = is_base64 = 0
[281] Fix | Delete
multipart = None
[282] Fix | Delete
must_quote_body = must_quote_header = has_iso_chars = 0
[283] Fix | Delete
[284] Fix | Delete
header = []
[285] Fix | Delete
header_end = ''
[286] Fix | Delete
message = []
[287] Fix | Delete
message_end = ''
[288] Fix | Delete
# read header
[289] Fix | Delete
hfile = HeaderFile(ifile)
[290] Fix | Delete
while 1:
[291] Fix | Delete
line = hfile.readline()
[292] Fix | Delete
if not line:
[293] Fix | Delete
break
[294] Fix | Delete
if not must_quote_header and iso_char.search(line):
[295] Fix | Delete
must_quote_header = 1
[296] Fix | Delete
if mv.match(line):
[297] Fix | Delete
is_mime = 1
[298] Fix | Delete
if cte.match(line):
[299] Fix | Delete
has_cte = 1
[300] Fix | Delete
if qp.match(line):
[301] Fix | Delete
is_qp = 1
[302] Fix | Delete
elif base64_re.match(line):
[303] Fix | Delete
is_base64 = 1
[304] Fix | Delete
mp_res = mp.match(line)
[305] Fix | Delete
if mp_res:
[306] Fix | Delete
multipart = '--' + mp_res.group(1)
[307] Fix | Delete
if he.match(line):
[308] Fix | Delete
header_end = line
[309] Fix | Delete
break
[310] Fix | Delete
header.append(line)
[311] Fix | Delete
[312] Fix | Delete
# read body
[313] Fix | Delete
while 1:
[314] Fix | Delete
line = ifile.readline()
[315] Fix | Delete
if not line:
[316] Fix | Delete
break
[317] Fix | Delete
if multipart:
[318] Fix | Delete
if line == multipart + '--\n':
[319] Fix | Delete
message_end = line
[320] Fix | Delete
break
[321] Fix | Delete
if line == multipart + '\n':
[322] Fix | Delete
message_end = line
[323] Fix | Delete
break
[324] Fix | Delete
if is_base64:
[325] Fix | Delete
message.append(line)
[326] Fix | Delete
continue
[327] Fix | Delete
if is_qp:
[328] Fix | Delete
while line[-2:] == '=\n':
[329] Fix | Delete
line = line[:-2]
[330] Fix | Delete
newline = ifile.readline()
[331] Fix | Delete
if newline[:len(QUOTE)] == QUOTE:
[332] Fix | Delete
newline = newline[len(QUOTE):]
[333] Fix | Delete
line = line + newline
[334] Fix | Delete
line = mime_decode(line)
[335] Fix | Delete
message.append(line)
[336] Fix | Delete
if not has_iso_chars:
[337] Fix | Delete
if iso_char.search(line):
[338] Fix | Delete
has_iso_chars = must_quote_body = 1
[339] Fix | Delete
if not must_quote_body:
[340] Fix | Delete
if len(line) > MAXLEN:
[341] Fix | Delete
must_quote_body = 1
[342] Fix | Delete
[343] Fix | Delete
# convert and output header and body
[344] Fix | Delete
for line in header:
[345] Fix | Delete
if must_quote_header:
[346] Fix | Delete
line = mime_encode_header(line)
[347] Fix | Delete
chrset_res = chrset.match(line)
[348] Fix | Delete
if chrset_res:
[349] Fix | Delete
if has_iso_chars:
[350] Fix | Delete
# change us-ascii into iso-8859-1
[351] Fix | Delete
if chrset_res.group(2).lower() == 'us-ascii':
[352] Fix | Delete
line = '%s%s%s' % (chrset_res.group(1),
[353] Fix | Delete
CHARSET,
[354] Fix | Delete
chrset_res.group(3))
[355] Fix | Delete
else:
[356] Fix | Delete
# change iso-8859-* into us-ascii
[357] Fix | Delete
line = '%sus-ascii%s' % chrset_res.group(1, 3)
[358] Fix | Delete
if has_cte and cte.match(line):
[359] Fix | Delete
line = 'Content-Transfer-Encoding: '
[360] Fix | Delete
if is_base64:
[361] Fix | Delete
line = line + 'base64\n'
[362] Fix | Delete
elif must_quote_body:
[363] Fix | Delete
line = line + 'quoted-printable\n'
[364] Fix | Delete
else:
[365] Fix | Delete
line = line + '7bit\n'
[366] Fix | Delete
ofile.write(line)
[367] Fix | Delete
if (must_quote_header or must_quote_body) and not is_mime:
[368] Fix | Delete
ofile.write('Mime-Version: 1.0\n')
[369] Fix | Delete
ofile.write('Content-Type: text/plain; ')
[370] Fix | Delete
if has_iso_chars:
[371] Fix | Delete
ofile.write('charset="%s"\n' % CHARSET)
[372] Fix | Delete
else:
[373] Fix | Delete
ofile.write('charset="us-ascii"\n')
[374] Fix | Delete
if must_quote_body and not has_cte:
[375] Fix | Delete
ofile.write('Content-Transfer-Encoding: quoted-printable\n')
[376] Fix | Delete
ofile.write(header_end)
[377] Fix | Delete
[378] Fix | Delete
for line in message:
[379] Fix | Delete
if must_quote_body:
[380] Fix | Delete
line = mime_encode(line, 0)
[381] Fix | Delete
ofile.write(line)
[382] Fix | Delete
ofile.write(message_end)
[383] Fix | Delete
[384] Fix | Delete
line = message_end
[385] Fix | Delete
while multipart:
[386] Fix | Delete
if line == multipart + '--\n':
[387] Fix | Delete
# read bit after the end of the last part
[388] Fix | Delete
while 1:
[389] Fix | Delete
line = ifile.readline()
[390] Fix | Delete
if not line:
[391] Fix | Delete
return
[392] Fix | Delete
if must_quote_body:
[393] Fix | Delete
line = mime_encode(line, 0)
[394] Fix | Delete
ofile.write(line)
[395] Fix | Delete
if line == multipart + '\n':
[396] Fix | Delete
nifile = File(ifile, multipart)
[397] Fix | Delete
mimify_part(nifile, ofile, 1)
[398] Fix | Delete
line = nifile.peek
[399] Fix | Delete
if not line:
[400] Fix | Delete
# premature end of file
[401] Fix | Delete
break
[402] Fix | Delete
ofile.write(line)
[403] Fix | Delete
continue
[404] Fix | Delete
# unexpectedly no multipart separator--copy rest of file
[405] Fix | Delete
while 1:
[406] Fix | Delete
line = ifile.readline()
[407] Fix | Delete
if not line:
[408] Fix | Delete
return
[409] Fix | Delete
if must_quote_body:
[410] Fix | Delete
line = mime_encode(line, 0)
[411] Fix | Delete
ofile.write(line)
[412] Fix | Delete
[413] Fix | Delete
def mimify(infile, outfile):
[414] Fix | Delete
"""Convert 8bit parts of a MIME mail message to quoted-printable."""
[415] Fix | Delete
if type(infile) == type(''):
[416] Fix | Delete
ifile = open(infile)
[417] Fix | Delete
if type(outfile) == type('') and infile == outfile:
[418] Fix | Delete
import os
[419] Fix | Delete
d, f = os.path.split(infile)
[420] Fix | Delete
os.rename(infile, os.path.join(d, ',' + f))
[421] Fix | Delete
else:
[422] Fix | Delete
ifile = infile
[423] Fix | Delete
if type(outfile) == type(''):
[424] Fix | Delete
ofile = open(outfile, 'w')
[425] Fix | Delete
else:
[426] Fix | Delete
ofile = outfile
[427] Fix | Delete
nifile = File(ifile, None)
[428] Fix | Delete
mimify_part(nifile, ofile, 0)
[429] Fix | Delete
ofile.flush()
[430] Fix | Delete
[431] Fix | Delete
import sys
[432] Fix | Delete
if __name__ == '__main__' or (len(sys.argv) > 0 and sys.argv[0] == 'mimify'):
[433] Fix | Delete
import getopt
[434] Fix | Delete
usage = 'Usage: mimify [-l len] -[ed] [infile [outfile]]'
[435] Fix | Delete
[436] Fix | Delete
decode_base64 = 0
[437] Fix | Delete
opts, args = getopt.getopt(sys.argv[1:], 'l:edb')
[438] Fix | Delete
if len(args) not in (0, 1, 2):
[439] Fix | Delete
print usage
[440] Fix | Delete
sys.exit(1)
[441] Fix | Delete
if (('-e', '') in opts) == (('-d', '') in opts) or \
[442] Fix | Delete
((('-b', '') in opts) and (('-d', '') not in opts)):
[443] Fix | Delete
print usage
[444] Fix | Delete
sys.exit(1)
[445] Fix | Delete
for o, a in opts:
[446] Fix | Delete
if o == '-e':
[447] Fix | Delete
encode = mimify
[448] Fix | Delete
elif o == '-d':
[449] Fix | Delete
encode = unmimify
[450] Fix | Delete
elif o == '-l':
[451] Fix | Delete
try:
[452] Fix | Delete
MAXLEN = int(a)
[453] Fix | Delete
except (ValueError, OverflowError):
[454] Fix | Delete
print usage
[455] Fix | Delete
sys.exit(1)
[456] Fix | Delete
elif o == '-b':
[457] Fix | Delete
decode_base64 = 1
[458] Fix | Delete
if len(args) == 0:
[459] Fix | Delete
encode_args = (sys.stdin, sys.stdout)
[460] Fix | Delete
elif len(args) == 1:
[461] Fix | Delete
encode_args = (args[0], sys.stdout)
[462] Fix | Delete
else:
[463] Fix | Delete
encode_args = (args[0], args[1])
[464] Fix | Delete
if decode_base64:
[465] Fix | Delete
encode_args = encode_args + (decode_base64,)
[466] Fix | Delete
encode(*encode_args)
[467] Fix | Delete
[468] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function