[Reportbug-maint] Bug#866596: querybts: launch_mbox_reader() strips NL characters
danielsh at apache.org
Fri Jun 30 11:08:42 UTC 2017
1. Run Â«querybts 860123Â».
2. Exit the pager.
3. Type 'e' for 'Launch e-mail client to read full log.'
This will launch the configured mbox reader on a file that has no newlines in
it. (The file does not contain even a single 0D or 0A byte.)
This is because of the following bit of code:
1198B def launch_mbox_reader(cmd, url, http_proxy, timeout):
1199 """Runs the command specified by cmd passing the mbox file
1200 downloaded from url as a parameter. If cmd is None or fails, then
1201 fallback to mail program."""
1202 -> mbox = open_url(url, http_proxy, timeout)
1203 if mbox is None:
1205 (fd, fname) = TempFile()
1207 for line in mbox.splitlines():
1210 if cmd is not None:
1212 cmd = cmd % fname
1213 except TypeError:
1214 cmd = "%s %s" % (cmd, fname)
1215 error = os.system(cmd)
1216 if not error:
1218 # fallback
The .splitlines() calls returns a list of strings that do *not* contain
newlines (\n characters), and the following .write() does not add its own \n's.
More information about the Reportbug-maint