[issue45585] Gzipping subprocess output produces invalid .gz file

2021-10-23 Thread Martin Panter
Martin Panter added the comment: The subprocess module only uses the file object to get a file handle by calling the "fileno" method. See Issue 19992 about documenting this. For Python to compress the output of the child process, you would need a pipe. Gzip file objects provide t

[issue45523] Python3 ThreadingHTTPServer fails to send chunked encoded response

2021-10-19 Thread Martin Panter
Martin Panter added the comment: Looks like you forgot to encode the length of ten in hexadecimal. I don't think the HTTP server module has any special handling for chunked responses, so this up to the user and isn't a bug in Python. -- nosy: +martin.panter resolution: -> not a

[issue45349] configparser.ConfigParser: 2 newlines at end of file (EOF)

2021-10-02 Thread Martin Panter
Martin Panter added the comment: Looks like the same as Issue 32917. I presume there are two newlines at the end of the file because there are two newlines following every config section. IMO this is a minor cosmetic annoyance, just like writing a key with an empty value gets you a trailing

[issue45170] tarfile missing cross-directory checking

2021-09-20 Thread Martin Panter
Martin Panter added the comment: Issue 21109 has been open for a while and is the same as this, if I am not mistaken. -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> tarfile: Traversal attack v

[issue44146] Format string fill not handling brace char

2021-06-09 Thread Martin Panter
Martin Panter added the comment: Another workaround: >>> '{:{brace}>10d}'.format(5, brace='{') '{5' -- nosy: +martin.panter ___ Python tracker <https://bugs.python

[issue44228] [urllib] Error with handling of urllib.parse.quote. Terminates halfway

2021-05-25 Thread Martin Panter
Martin Panter added the comment: I presume this is because you are running a Unix shell, and it's nothing to do with Python. Look up how quoting and variable substitution with dollar signs $ works. $ set -o nounset $ python3 -c "import urllib.parse; print (urllib.parse.quote('ab$cd#hi

[issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9

2021-05-01 Thread Martin Panter
Martin Panter added the comment: I suspect this comes from Issue 27657. Consider how similar URLs like tel:123 or javascript:123 should be parsed. -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue44

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-04-03 Thread Martin Panter
Martin Panter added the comment: Anselm's pull request PR 15175 looked hopeful to me. I've been using those changes in our builds at work for a while. -- ___ Python tracker <https://bugs.python.org/issue37

[issue34915] LWPCookieJar.save() creates *.lwp file in 644 mode

2021-03-13 Thread Martin Panter
Martin Panter added the comment: I don't have a strong opinion, but it does seem a sensible change that matches the high-level nature of the "cookiejar" module, with low risk of users relying on the current file permissions. On the other hand, the "curl" command seems

[issue43292] xml.ElementTree iterparse filehandle left open

2021-03-10 Thread Martin Panter
Change by Martin Panter : -- type: security -> resource usage ___ Python tracker <https://bugs.python.org/issue43292> ___ ___ Python-bugs-list mailing list Un

[issue43292] xml.ElementTree iterparse filehandle left open

2021-03-10 Thread Martin Panter
Martin Panter added the comment: Perhaps this can be handled with Issue 25707, which is open for adding an API to close the file, similar to how "os.scandir" iterator implements a context manager and "close" method. -- nosy: +martin.panter superseder: -&g

[issue43375] memory leak in threading ?

2021-03-09 Thread Martin Panter
Martin Panter added the comment: Sounds the same as Issue 37788, which is still open. -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue43

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-01-27 Thread Martin Panter
Change by Martin Panter : -- keywords: +3.7regression ___ Python tracker <https://bugs.python.org/issue37788> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43050] threading timer memory leak

2021-01-27 Thread Martin Panter
Martin Panter added the comment: Perhaps this is caused by Issue 37788. Python 3.7.4 introduced a leak for any thread that doesn't get its "join" method called. Timer is a subclass of Thread, so to confirm, see if calling "timer.join()" after "cancel&quo

[issue42263] Removing thread reference in thread results in leaked reference

2020-11-04 Thread Martin Panter
Martin Panter added the comment: Maybe this is related to (or duplicate of) Issue 37788? Python 3.7 has a regression where threads that are never joined cause leaks; previous code was written assuming you didn't need to join threads. Do you still see the leak even if you don't clear

[issue42263] Removing thread reference in thread results in leaked reference

2020-11-04 Thread Martin Panter
Change by Martin Panter : -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue42263> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42094] isoformat() / fromisoformat() for datetime.timedelta

2020-10-20 Thread Martin Panter
Martin Panter added the comment: There is related discussion in Issue 41254, about duration formats more generally. -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue42

[issue41983] Missing Documentation AF_PACKET

2020-10-17 Thread Martin Panter
Martin Panter added the comment: According to the documentation at <https://docs.python.org/3.8/library/socket.html#socket.AF_PACKET> and Issue 25041 it is only available on Linux. What documentation are you looking at? -- nosy: +martin.

[issue42062] Usage of HTTPResponse.url

2020-10-17 Thread Martin Panter
Martin Panter added the comment: There is a comment in the HTTPResponse class regarding these methods: # For compatibility with old-style urllib responses. They were there for the "urlopen" API in "urllib.request", not for the "http.client" module on its own

[issue41767] KeyError exception is more difficult to read due to quoting

2020-09-11 Thread Martin Panter
Martin Panter added the comment: Perhaps a duplicate of Issue 2651, closed because it was too hard to fix without breaking compatibility. -- nosy: +martin.panter superseder: -> Strings passed to KeyError do not round trip ___ Python trac

[issue41695] http.cookies.SimpleCookie.parse could not parse cookies when one cookie value is json

2020-09-02 Thread Martin Panter
Martin Panter added the comment: Perhaps this is a duplicate of Issue 27674, where I think parsing is aborted when a double-quote is seen? -- nosy: +martin.panter superseder: -> Quote mark breaks http.cookies, Cookie.py processing ___ Pyt

[issue41450] OSError is not documented in ssl library, but still can be thrown

2020-07-31 Thread Martin Panter
Martin Panter added the comment: Issue 31122 is also open about fixing this long-term, but I agree it would be good to document this quirk / bug. -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue41

[issue41345] Remote end closed connection without response

2020-07-27 Thread Martin Panter
Martin Panter added the comment: Previous report about Requests to the Python bug tracker: Issue 33620. I suspect this is an unavoidable race condition with trying a POST (or other non-idempotent) request on an idle HTTP connection. I think it has to be up to the higher-level application

[issue18861] Problems with recursive automatic exception chaining

2020-07-27 Thread Martin Panter
Change by Martin Panter : -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue18861> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Martin Panter
Martin Panter added the comment: I don't know how much support this will get since there is already a str(timedelta) operation defined with a different format. But I don't like that format much. The day[s] part is too verbose, the H:MM:SS part could too easily be interpreted as D:HH:MM

[issue40657] Resource leaks with threading.Thread

2020-05-23 Thread Martin Panter
Martin Panter added the comment: Perhaps this is the same as Issue 37788, introduced in 3.7. -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue40

[issue40299] os.dup seems broken with execvp (LINUX)

2020-04-16 Thread Martin Panter
Martin Panter added the comment: The file descriptor created by "os.dup" is not inherited by child processes by default since Python 3.4. https://docs.python.org/3/library/os.html#os.dup Does it work if you use "os.set_inheritable" or "os.dup2" (which a

[issue26527] CGI library - Using unicode in header fields

2020-03-22 Thread Martin Panter
Martin Panter added the comment: I’m not an expert on the topic, but it sounds like this might be a duplicate of Issue 23434, which has more discussion. -- nosy: +martin.panter resolution: -> duplicate status: open -> pending superseder: -> support encoded filename i

[issue39780] Add HTTP Response code 103

2020-02-27 Thread Martin Panter
Martin Panter added the comment: See also Issue 39509, proposing to add 103 and "425 Too Early" -- nosy: +martin.panter ___ Python tracker <https://bugs.python.o

[issue39717] Fix exception causes in tarfile module

2020-02-21 Thread Martin Panter
Martin Panter added the comment: Please don’t use “from None” in library code. It hides exceptions raised by the calling application that would help debugging. E.g. <https://bugs.python.org/issue30097#msg293185> -- nosy: +martin.panter ___

[issue35318] Check accuracy of str() doc string for its encoding argument

2020-02-07 Thread Martin Panter
Martin Panter added the comment: Closing in favour of Issue 39574 where a new wording is proposed -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> str.__doc__ is misleading __

[issue39353] Deprecate the binhex module, binhex4 and hexbin4 standards

2020-01-30 Thread Martin Panter
Martin Panter added the comment: Thanks Victor -- ___ Python tracker <https://bugs.python.org/issue39353> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39353] Deprecate the binhex module, binhex4 and hexbin4 standards

2020-01-24 Thread Martin Panter
Martin Panter added the comment: Of course I would prefer “crc_hqx” to stay, because we use it at work. But I understand if you think it is not popular enough to justify maintaining it. But I was more asking if the deprecation notice should point the way forward. This function is no longer

[issue39353] Deprecate the binhex module, binhex4 and hexbin4 standards

2020-01-22 Thread Martin Panter
Martin Panter added the comment: Building and verifying the checksum in "RTA protocol" that uses this: <https://rms.nsw.gov.au/business-industry/partners-suppliers/documents/specifications/tsi-sp-003.pdf>. But I understand CRC-CCITT is one of the two popular 16-bit CRC po

[issue39353] Deprecate the binhex module, binhex4 and hexbin4 standards

2020-01-22 Thread Martin Panter
Martin Panter added the comment: Is there a recommended replacement for calculating CRC-CCITT? Do it yourself in Python code, or use a particular external module? -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue39

[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2019-12-18 Thread Martin Panter
Martin Panter added the comment: FTR I have been trialling a patched Python 3.7 based on Maru's changes (revision 6ac217c) + review suggestions, and it has reduced the size of the leak (hit 1 GB over a couple days, vs only 60 MB increase over three days). The remaining leak could

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-12-18 Thread Martin Panter
Change by Martin Panter : -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue37788> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2019-12-15 Thread Martin Panter
Martin Panter added the comment: Another workaround might be to set the new "block_on_close" flag (Issue 33540) to False on the server subclass or instance. Victor: Replying to <https://bugs.python.org/issue37193#msg345817> "What do I think of also using a weakref

[issue38710] unsynchronized write pointer in io.TextIOWrapper in 'r+' mode

2019-11-17 Thread Martin Panter
Martin Panter added the comment: Previously Issue 12215 and a couple of other duplicates were opened about this. Writing after reading with TextIOWrapper doesn't work as people expect. The report was closed apparently because Victor thought there wasn't enough interest in it. FWIW the seek

[issue38831] urllib.request header characters being changed to lowercase

2019-11-17 Thread Martin Panter
Martin Panter added the comment: I suggest to keep the discussion with Issue 12455 -- nosy: +martin.panter superseder: -> urllib2 forces title() on header names, breaking some requests ___ Python tracker <https://bugs.python.org/issu

[issue29979] cgi.parse_multipart is not consistent with FieldStorage

2019-11-17 Thread Martin Panter
Change by Martin Panter : -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue29979> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34226] cgi.parse_multipart() requires undocumented CONTENT-LENGTH in Python 3.7

2019-09-30 Thread Martin Panter
Martin Panter added the comment: Looks like the change causing this is revision cc3fa20. I would remove the reference to pdict['CONTENT-LENGTH']. -- keywords: +3.7regression nosy: +martin.panter ___ Python tracker <https://bugs.python.

[issue37477] NamedTemporaryFile can hang on windows

2019-07-01 Thread Martin Panter
Change by Martin Panter : -- resolution: -> duplicate superseder: -> tempfile module misinterprets access denied error on Windows ___ Python tracker <https://bugs.python.org/i

[issue37477] NamedTemporaryFile can hang on windows

2019-07-01 Thread Martin Panter
Martin Panter added the comment: Perhaps a duplicate of Issue 22107? -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue37477> ___ ___

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-06-27 Thread Martin Panter
Martin Panter added the comment: Same thing going on as in Issue 30154. The shell is probably spawning the “sleep” command as a child process (grandchild of Python), and waiting for it to exit. When Python times out, it will kill the shell process, leaving the grandchild as an orphan

[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2019-06-16 Thread Martin Panter
Martin Panter added the comment: Looking at the code, this would be caused by Issue 31233. I expect 3.7+ is affected. 3.6 has similar code, but the leaking looks to be disabled by default. 2.7 doesn't collect a "_threads" list at all. Looks like Victor was aware of the leak when

[issue31233] socketserver.ThreadingMixIn leaks running threads after server_close()

2019-06-16 Thread Martin Panter
Martin Panter added the comment: FYI the change here to remember all the thread objects ever created looks to be the cause of the memory leak reported in Issue 37193 -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue31

[issue37290] Mistranslation (Japanese)

2019-06-15 Thread Martin Panter
Change by Martin Panter : -- nosy: +cocoatomo title: Mistranslation -> Mistranslation (Japanese) ___ Python tracker <https://bugs.python.org/issue37290> ___ _

[issue37176] super() docs don't say what super() does

2019-06-08 Thread Martin Panter
Martin Panter added the comment: Some of the problems brought up here (which sibling or subclass, and which parameter’s MRO) also came up a few years ago in Issue 23674. -- nosy: +martin.panter ___ Python tracker <https://bugs.python.

[issue37040] checking for membership in itertools.count enters infinite loop with no way to exit

2019-05-25 Thread Martin Panter
Martin Panter added the comment: Problems with long-running iterators are already discussed in: Issue 31815: rejected proposal to check for interrupts Issue 33939: proposal to flag iterators as being infinite -- nosy: +martin.panter ___ Python

[issue36863] argparse doesn't like options in the middle of arguments

2019-05-10 Thread Martin Panter
Martin Panter added the comment: The “cmd” module doesn’t use “argparse” as far as I can see. You might have to provide more information or code for someone to make sense of or reproduce your bug. Also, see Issue 14191 which added new “parse_[known]_intermixed_args” APIs in 3.7, and have

[issue36760] subprocess.run fails with capture_output=True and stderr=STDOUT

2019-04-30 Thread Martin Panter
Martin Panter added the comment: Python 3.7 added the "capture_output" parameter, for Issue 32102. Before that change, you could use "subprocess.PIPE": https://docs.python.org/3.6/library/subprocess.html#subprocess.run “To [capture output], pass PIPE for the ‘stdout’ and/o

[issue36726] Empty select() on windows gives error.

2019-04-25 Thread Martin Panter
Martin Panter added the comment: I think this is a duplicate of Issue 29256. Issue 25680 also discusses platform differences with no file descriptors. -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Windows sel

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-04-25 Thread Martin Panter
Martin Panter added the comment: Test_http_cookies line 19 has the following test case: {'data': 'keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"', 'dict': {'keebler' : 'E=mc2; L="Loves"; fudge=\012;'}, 'repr': '', 'output': 'Set-Cookie: keebler=&quo

[issue33017] Special set-cookie setting will bypass Cookielib

2019-04-25 Thread Martin Panter
Martin Panter added the comment: I think LCatro is saying that Python should accept the cookies and discard only the offending attributes. This makes sense to me and tends to agree with the specifications, but the three cases seem all seem unimportant to me. PoC 1, Max-age: >>> fro

[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set

2019-04-25 Thread Martin Panter
Martin Panter added the comment: Karthikeyan, it looks like your test will pass even when the bug is not fixed. A test calling code that writes error message does not necessarily mean the test itself will fail, I don’t think. I suggest you look at raising an exception when the UserWarning

[issue1564508] RFC 2965 BaseCookie does not support "$Port"

2019-04-24 Thread Martin Panter
Martin Panter added the comment: The original report comes from <https://code.djangoproject.com/ticket/2806>. Anders was trying to parse a HTTP request Cookie field, something like: BaseCookie('sessionid=a2be2e7debe71af8d88d350c4d14d768;$Path=/;$Domain=192.168.0.2;$Port="8000"

[issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly

2019-04-24 Thread Martin Panter
Change by Martin Panter : -- resolution: -> rejected status: open -> pending ___ Python tracker <https://bugs.python.org/issue23930> ___ ___ Python-bugs-

[issue23298] Add ArgumentParser.add_mutually_dependence_group

2019-04-24 Thread Martin Panter
Change by Martin Panter : -- superseder: -> Add "necessarily inclusive" groups to argparse ___ Python tracker <https://bugs.python.org/issue23298> ___

[issue22742] IDLE shows traceback when printing non-BMP character

2019-04-24 Thread Martin Panter
Martin Panter added the comment: I haven’t looked at the code, but I suspect Idle implements a custom “sys.displayhook”: >>> help(sys.displayhook) Help on function displayhook in module idlelib.rpc: displayhook(value) Override standard display hook to use non-locale

[issue36711] duplicate method definition in Lib/email/feedparser.py

2019-04-24 Thread Martin Panter
Martin Panter added the comment: This is caused by Serhiy’s first change to 2.7 in Issue 21448. Compare Mercurial rev. 1b1f92e39462 (3.4 branch) with ba90bd01c5f1 (2.7). In 2.7, he applied the Python 3 version of the code, which used “str.splitlines” rather than a regular expression

[issue36701] module 'urllib' has no attribute 'request'

2019-04-23 Thread Martin Panter
Martin Panter added the comment: The “urllib” package also contains “urllib.parse”, which is a lot more lightweight than “urllib.request”. In a quick experiment, importing “urllib.request” is more than 2 times slower than importing “urllib.parse” on its own. And importing “urllib” by itself

[issue33632] undefined behaviour: signed integer overflow in threadmodule.c

2019-04-14 Thread Martin Panter
Martin Panter added the comment: Victor, if you run the test suite, one of the test cases should trigger the overflow. I used to compile with Undefined Behaviour Sanitizer to print messages when these errors occur; see <https://bugs.python.org/issue1621#msg271118> for my setup at the t

[issue17267] datetime.time support for '+' and '-'

2019-04-13 Thread Martin Panter
Martin Panter added the comment: A real use case that I have had was with a protocol to activate a device with a daily schedule. The protocol takes start and end hours and minutes of the day. To test the device by activating it over the next few minutes, my ideal way would have taken

[issue36600] re-enable test in nntplib

2019-04-12 Thread Martin Panter
Martin Panter added the comment: Does the test still depend on real-world posts? If so, see Issue 19613. I don’t think the problem has been fixed. -- nosy: +martin.panter superseder: -> test_nntplib: sporadic failures, test_article_head_b

[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-04-10 Thread Martin Panter
Martin Panter added the comment: Gregory, I haven’t tried recent Python code, but I expect the problem with percent decoding is still there. If you did try my example, what results did you see? Be aware that these techniques only work if the OS co-operates and connects to localhost when you

[issue36293] Nonblocking read sys.stdin raises error

2019-03-30 Thread Martin Panter
Change by Martin Panter : -- resolution: -> duplicate ___ Python tracker <https://bugs.python.org/issue36293> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue36293] Nonblocking read sys.stdin raises error

2019-03-30 Thread Martin Panter
Martin Panter added the comment: I wasn’t sure about closing it, in case Cyker came back with more details. E.g. what was the use case? Were they mislead by the documentation? Do they just think the error should be different, or do they think there should be no error in this case? But I

[issue35403] support application/wasm in mimetypes and http.server

2019-03-30 Thread Martin Panter
Change by Martin Panter : -- superseder: -> http.server module sets incorrect mimetype for WebAssembly files ___ Python tracker <https://bugs.python.org/issu

[issue35403] support application/wasm in mimetypes and http.server

2019-03-30 Thread Martin Panter
Martin Panter added the comment: According to Issue 34758, this was already added to 3.8’s “mimetypes”. -- nosy: +martin.panter resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue36483] Missing line in documentation example

2019-03-30 Thread Martin Panter
Martin Panter added the comment: Did you read the bracketed paragraph directly below, or try running the code with your “break” statement? I expect it would stop at the first prime number (two). But the output continues with more prime numbers. -- nosy: +martin.panter resolution

[issue36464] Python 2.7 build install fails intermittently with -j on MacOS

2019-03-30 Thread Martin Panter
Martin Panter added the comment: On Linux, Gnu’s “install” command is happy if the target directory already exists; it just changes the mode (-m) etc. So the race isn’t a big deal. This is like the race I described (theoretical at the time) at <https://bugs.python.org/issue25696#msg255

[issue33319] `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe

2019-03-22 Thread Martin Panter
Martin Panter added the comment: This is a regression in the 3.7+ documentation. It previously said “To [capture output], pass PIPE for the ‘stdout’ and/or ‘stderr’ arguments”. This was removed by Bo Bayles in Issue 32102. -- keywords: +3.7regression nosy: +bbayles, gregory.p.smith

[issue36304] When using bz2 and lzma in mode 'wt', the BOM is not written

2019-03-15 Thread Martin Panter
Martin Panter added the comment: I suspect this is caused by TextIOWrapper guessing if it is writing the start of a file versus in the middle, and being confused by “seekable” returning False. GzipFile implements some “seek” calls in write mode, but LZMAFile and BZ2File do not. Using

[issue36294] `io.BufferedIOBase` returns `None`

2019-03-15 Thread Martin Panter
Martin Panter added the comment: The general problem of non-blocking reads with BufferedIOBase is covered by Issue 13322. The documentation and implementations do not agree. I suggest to not rely on any particular behaviour reading BufferedIOBase objects in non-blocking mode. The problem

[issue36293] Nonblocking read sys.stdin raises error

2019-03-15 Thread Martin Panter
Martin Panter added the comment: This is the same story as in Issue 35762. Both “sys.stdin” and “subprocess.Popen.stderr” (when universal_newlines=True is enabled) use the TextIOWrapper class, which I don’t think was implemented with non-blocking mode in mind. Issue 24560 is similar

[issue25476] close() behavior on non-blocking BufferedIO objects with sockets

2019-03-15 Thread Martin Panter
Change by Martin Panter : -- stage: -> resolved status: pending -> closed ___ Python tracker <https://bugs.python.org/issue25476> ___ ___ Python-bugs-list

[issue36246] csv.writer lineterminator affects csv escaping

2019-03-08 Thread Martin Panter
Martin Panter added the comment: This is the result that I see: >>> output = StringIO() >>> csv.writer(output, lineterminator='\n').writerow(["Whoa!\rNewlines!"]) 16 >>> output.getvalue() 'Whoa!\rNewlines!\n' For comparison, this is the result with CRLF t

[issue36226] multipart/related header causes false positive StartBoundaryNotFoundDefect and MultipartInvariantViolationDefect

2019-03-07 Thread Martin Panter
Martin Panter added the comment: Probably the same as Issue 29353. I remember than enabling "headersonly" can create inconsistencies in the message object. But I don't remember the details. According to Issue 29991 (another duplicate), my patch for Issue 24363 might help. But I d

[issue36172] csv module internal consistency

2019-03-03 Thread Martin Panter
Martin Panter added the comment: The documentation <https://docs.python.org/dev/library/csv.html#module-contents> says you should “open the files with newline=''.” IMO this is an unfortunate quirk of the CSV module. Everything else that I know of in the Python built-in library either

[issue36161] Use thread-safe functions instead of unsafe ones (crypt, ttyname)

2019-03-01 Thread Martin Panter
Martin Panter added the comment: In Issue 28503, “crypt_r” was added to Python 3.7 and 3.8+, and it looks like it is still there. Regarding error handling for “crypt”, it is not documented, but the Python function returns None on error. You would have to consider backwards compatibility

[issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT

2019-02-24 Thread Martin Panter
Martin Panter added the comment: The 1 MiB limit was added for Issue 1296004; apparently some platforms were overallocating multiple buffers and running out of memory. I suspect the loop in "_safe_read" was inherited from Python 2, which has different kinds of file objects. Th

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-22 Thread Martin Panter
Martin Panter added the comment: I agree the documentation is insufficient. It should have said if “data” is iterated, it must yield bytes-like objects. I agree it is unwise to yet more special cases for the uploaded data types. When Lye passed the dictionary of three keys and values, I

[issue31162] urllib.request.urlopen CERTIFICATE_VERIFY_FAILED error

2019-02-22 Thread Martin Panter
Change by Martin Panter : -- resolution: -> not a bug status: open -> pending title: urllib.request.urlopen error -> urllib.request.urlopen CERTIFICATE_VERIFY_FAILED error ___ Python tracker <https://bugs.python.or

[issue22865] Document how to make pty.spawn not copy data

2019-02-21 Thread Martin Panter
Martin Panter added the comment: I'm not sure it is wise for the Python documentation to suggest inserting null bytes in general. This seems more like an application-specific hack. There is nothing in Python that handles these null bytes specially, and I expect they will be seen

[issue34785] pty.spawn -- auto-termination after child process is dead (a zombie)

2019-02-21 Thread Martin Panter
Martin Panter added the comment: Suggest closing this assuming it is a duplicate, unless Jarry can give more information. -- resolution: -> duplicate status: open -> pending superseder: -> pty.spawn hangs on FreeBSD 9.3, 10.x ___ Pytho

[issue5038] urrlib2/httplib doesn't reset file position between requests

2019-02-15 Thread Martin Panter
Martin Panter added the comment: For 3.7+ (where iterable objects are supported), I suggest: 1. Document the problem as a limitation of handlers like AbstractBasicAuthHandler, and consider raising an exception instead of trying to upload a file or iterable a second time. 2. Clarify

[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-02-08 Thread Martin Panter
Change by Martin Panter : -- dependencies: +Remove urllib.parse._splittype from mimetypes.guess_type ___ Python tracker <https://bugs.python.org/issue22

[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2019-02-08 Thread Martin Panter
Martin Panter added the comment: I haven’t confirmed, but it looks like the original change here broke bidirectional reading and writing with a single TextIOWrapper object; see Issue 35928. -- ___ Python tracker <https://bugs.python.

[issue35928] socket makefile read-write discards received data

2019-02-08 Thread Martin Panter
Martin Panter added the comment: Looking over the changelog, my guess (untested) is this is caused by commit d6a283b3 for Issue 25862. That change looks like it drops the internal TextIOWrapper decoding buffer for each successful write. I don't have the right version of Python to test

[issue35906] Header Injection in urllib

2019-02-06 Thread Martin Panter
Martin Panter added the comment: Maybe related to Victor's "Issue 1" described in Issue 32085. That is also a security bug about CRLF in the URL's path, but was opened before Issue 30500 was opened and the code changed, so I'm not sure if it is the same as this or not. Also ther

[issue35869] io.BufferReader.read() returns None

2019-02-01 Thread Martin Panter
Martin Panter added the comment: This is covered by Issue 13322. There are a few other BufferedReader methods that contradict the documentation for non-blocking mode. A while ago I posted a patch to change the implementation to match the documentation, but nobody reviewed it or gave

[issue35870] readline() specification is unclear

2019-01-31 Thread Martin Panter
Martin Panter added the comment: I agree that the documentation should be clearer about the first two points. Considering that the "input" function and by default the "str.splitlines" method both behave differently, I often had to re-learn this when I had les

[issue35848] readinto is not a method on io.TextIOBase

2019-01-30 Thread Martin Panter
Martin Panter added the comment: I think it would be more practical to fix the documentation (option 1). Do you have a use case for “TextIOBase.readinto” raising ValueError (something more concrete than someone having expectations)? -- nosy: +martin.panter

[issue31456] SimpleCookie fails to parse any cookie if an entry has whitespace in the name

2019-01-26 Thread Martin Panter
Martin Panter added the comment: The main cause of this behaviour is that whitespace (matching the ASCII RE “\s”) is treated as separation between cookie “morsels”. It looks like this has always been the behaviour, but I’m not sure it was intended. >>> print(BaseCookie('first=mors

[issue2212] Cookie.BaseCookie has ambiguous unicode handling

2019-01-26 Thread Martin Panter
Change by Martin Panter : -- stage: test needed -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue2212> ___ ___ Pyth

[issue2212] Cookie.BaseCookie has ambiguous unicode handling

2019-01-26 Thread Martin Panter
Martin Panter added the comment: Same as Issue 11315, where Éric suggested documenting the behaviour. -- nosy: +martin.panter resolution: -> duplicate superseder: -> unicode support in Cookie module ___ Python tracker <https://bugs.p

[issue11315] unicode support in Cookie module

2019-01-26 Thread Martin Panter
Martin Panter added the comment: Sorry, but changing to bytes after ten years of using str in this module in Python 3 is not going to happen. Let’s just document the state of Python 2 (see Éric: https://bugs.python.org/issue11315#msg129448). -- assignee: -> docs@python compone

[issue19670] SimpleCookie Generates Non-RFC6265-Compliant Cookies

2019-01-26 Thread Martin Panter
Martin Panter added the comment: I think the solution here is to document what “SimpleCookie.value_encode” really does: RFC 2109 quoted-string escaping. If you want to a generate RFC-6265-compliant Set-Cookie string, do not include non-compliant characters in the cookie value, and consider

[issue35833] Backspace not working

2019-01-26 Thread Martin Panter
Martin Panter added the comment: Ment to point to previous bug report: Issue 23220 -- ___ Python tracker <https://bugs.python.org/issue35833> ___ ___ Python-bug

  1   2   3   4   5   6   7   8   9   10   >