[issue33008] urllib.request.parse_http_list incorrectly strips backslashes

2018-03-05 Thread W. Trevor King
New submission from W. Trevor King <wk...@tremily.us>: Python currently strips backslashes from inside quoted strings: $ echo 'a="b\"c",d=e' | python3 -c 'from sys import stdin; from urllib.request import parse_http_list; print(parse_http_list(stdin.read()))' ['a=&quo

[issue33003] urllib: Document parse_http_list

2018-03-05 Thread W. Trevor King
New submission from W. Trevor King <wk...@tremily.us>: Python has had a parse_http_list helper since urllib2 landed in 6d7e47b8ea (EXPERIMENTAL, 2000-01-20). With Python3 it was moved into urllib.request, and the implementation hasn't changed since (at least as of 4c19b9573, 2018

[issue26080] "abandonned" -> "abandoned" in PEP 510's https://hg.python.org/peps/rev/b463c740990c

2016-01-11 Thread W. Trevor King
New submission from W. Trevor King: In the recently-landed [1], There was also the Unladen Swallow project, but it was abandonned in 2011. Should have used “abandoned” instead of “abandonned”. [1]: https://hg.python.org/peps/rev/b463c740990c changeset: 6155:b463c740990c user

[issue25852] smtplib's SMTP.connect() should store the server name in ._host for .starttls()

2015-12-12 Thread W. Trevor King
New submission from W. Trevor King: With the current tip, starttls uses ._host when calling wrap_socket [1], but ._host is only setup in SMTP.__init__ [2]. Before #22921 [3] starttls would ignore ._host when SNI wasn't available locally. But as far as I can tell, starttls has never used

[issue22684] message.as_bytes() produces recursion depth exceeded

2014-11-07 Thread W. Trevor King
W. Trevor King added the comment: Here's an example from the notmuch list. You can trigger the exception in Python 3.4 with: import email.policy import mailbox mbox = mailbox.mbox('msg.mbox', factory=None, create=False) message = mbox[0] message.as_bytes(policy

[issue22684] message.as_bytes() produces recursion depth exceeded

2014-11-07 Thread W. Trevor King
W. Trevor King added the comment: The troublesome header formatting is: import email.policy email.policy.SMTP.fold_binary('Cc', 'notmuch\n\tpublic-public-notmuch-gxuj+Tv9EO5zyzON3hdc1g-wOFGN7rlS/M9smdsby/k...@plane.gmane.org,\n\tpublic-notmuch-gxuj+tv9eo5zyzon3hd...@plane.gmane.org,\n

[issue22684] message.as_bytes() produces recursion depth exceeded

2014-11-07 Thread W. Trevor King
W. Trevor King added the comment: In email._header_value_parser._Folded.append_if_fits, if I shift: if token.has_fws: ws = token.pop_leading_fws() if ws is not None: self.stickyspace += str(ws) stickyspace_len

[issue19226] distutils/command/upload.py show response gives: TypeError: sequence item 1: expected str instance, bytes found

2013-10-11 Thread W. Trevor King
New submission from W. Trevor King: Avoid: Traceback (most recent call last): File setup.py, line 61, in module 'html2text (=3.0.1)', File /.../python3.2/distutils/core.py, line 148, in setup dist.run_commands() File /.../python3.2/distutils/dist.py, line

[issue19226] distutils/command/upload.py show response gives: TypeError: sequence item 1: expected str instance, bytes found

2013-10-11 Thread W. Trevor King
W. Trevor King added the comment: On Fri, Oct 11, 2013 at 05:21:15PM +, Ned Deily wrote: This problem has been reported previously as Issue17354, a duplicate of Issue12853 which is still open at the moment. Ah, I searched for a fwe possible subject lines, but didn't hit those :p. I

[issue12853] global name 'r' is not defined in upload.py

2013-10-11 Thread W. Trevor King
W. Trevor King added the comment: I just posted a patch fixing this in the current master branch [1]. Ned Deily pointed out that my Issue19226 duplicated an earlier Issue17354, which also has a patch fixing this problem. Merging either one of these patches should close this issue. I like

[issue9253] argparse: optional subparsers

2013-01-18 Thread W. Trevor King
W. Trevor King added the comment: Since [1] it seems like subparsers *are* optional by default. At least I get “error: too few arguments” for version 70740 of Lib/argparse.py, but no error for version 70741. It looks like this may be an unintentional side effect, since I see no mention

[issue9640] Improved doctest REPORT_*DIFFs with ELLIPSIS and/or NORMALIZE_WHITESPACE

2010-08-19 Thread W. Trevor King
New submission from W. Trevor King wk...@drexel.edu: I had been struggling to find the failure-causing mismatch in a doctest with lots of output. REPORT_UDIFF gave lots of false mismatches because I was also using NORMALIZE_WHITESPACE. Looking through the doctest.py source, I saw a comment

[issue9640] Improved doctest REPORT_*DIFFs with ELLIPSIS and/or NORMALIZE_WHITESPACE

2010-08-19 Thread W. Trevor King
W. Trevor King wk...@drexel.edu added the comment: Here's my patch, or pull from my Mercurial repository http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/python/rev/6638df20c1a4 -- keywords: +patch Added file: http://bugs.python.org/file18575/doctest_diff.patch

[issue5752] xml.dom.minidom does not escape CR, LF and TAB characters within attribute values

2010-08-03 Thread W. Trevor King
W. Trevor King wk...@drexel.edu added the comment: And while we're at it, we should also .replace('', 'amp;').replace('', quot;).replace('', 'lt;') which would have to go at the beginning to avoid double-escaping the ''. We could use xml.sax.saxutils.escape to do all the escaping rather

[issue5752] xml.dom.minidom does not escape CR, LF and TAB characters within attribute values

2010-08-02 Thread W. Trevor King
W. Trevor King wk...@drexel.edu added the comment: As a workaround until the patch gets included, you can import this monkey patch module. -- nosy: +labrat Added file: http://bugs.python.org/file18325/minidom.py ___ Python tracker rep

[issue6612] 'import site' fails when called from an unlinked directory

2010-07-29 Thread W. Trevor King
W. Trevor King wk...@drexel.edu added the comment: I just fixed it myself ;). As I said before, not really a big deal, but it was an easy fix. I've attached a patch, or you can merge my hg branch f python-trunk at http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/python

[issue6612] 'import site' fails when called from an unlinked directory

2009-07-31 Thread W. Trevor King
New submission from W. Trevor King wk...@drexel.edu: I don't imagine this comes up very often, but: $ mkdir /tmp/a; cd /tmp/a; rmdir /tmp/a; python -c 'import site'; rmdir: removing directory, /tmp/a 'import site' failed; use -v for traceback Traceback (most recent call last): File string