[issue46319] datetime.utcnow() should return a timezone aware datetime

2022-01-09 Thread Martin Panter
Martin Panter added the comment: Perhaps this is a duplicate of Issue 12756? -- nosy: +martin.panter superseder: -> datetime.datetime.utcnow should return a UTC timestamp ___ Python tracker <https://bugs.python.org/issu

[issue46517] Review exception handling in urllib

2022-01-25 Thread Martin Panter
Martin Panter added the comment: The linked code is for urllib.parse.urlencode, looking something like try: if len(query) and not isinstance(query[0], tuple): raise TypeError except TypeError: ty, va, tb = sys.exc_info() raise TypeError("not a valid non-string seq

[issue46738] Allow http.server to emit HTML 5

2022-02-15 Thread Martin Panter
Change by Martin Panter : -- superseder: -> Generate HTML 5 with SimpleHTTPRequestHandler.list_directory ___ Python tracker <https://bugs.python.org/issu

[issue46756] Incorrect authorization check in urllib.request

2022-02-16 Thread Martin Panter
Martin Panter added the comment: Maybe the same as Issue 42766? -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue46756> ___ ___ Pytho

[issue46913] UBSAN: test_ctypes, test_faulthandler and test_hashlib are failing

2022-03-07 Thread Martin Panter
Martin Panter added the comment: The ctypes overflow is probably the same as described in Issue 28169 and Issue 15119 -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue46

[issue10278] add time.wallclock() method

2011-11-25 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue10278> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12922] StringIO and seek()

2011-12-21 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue12922> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2012-01-11 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue4806> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11944] Function call with * and generator hide exception raised by generator.

2012-01-11 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue11944> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2012-01-11 Thread Martin Panter
Martin Panter added the comment: I haven’t tried to understand what the patches do, but Issue 5218 looks like a very similar problem with a patch including a test case. -- ___ Python tracker <http://bugs.python.org/issue4

[issue5218] Check for tp_iter in ceval:ext_do_call before overriding exception message

2012-01-11 Thread Martin Panter
Martin Panter added the comment: See also Issue 4806 -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue5218> ___ ___ Python-bugs-list mailin

[issue11397] os.path.realpath() may produce incorrect results

2011-08-19 Thread Martin Panter
Martin Panter added the comment: Another infinite loop that isn't caught in Python 3.2.1: With the symbolic link link => link/inside a readlink("link") call will keep looping. Anyhow, the proposed solution in issue11397_py32_2.patch does not account for paths with mu

[issue12791] Yield" leaks exception being handled as garbage

2011-08-19 Thread Martin Panter
New submission from Martin Panter : See attached "leaky_generator.py" demo. Python doesn't appear to delete the exception variable if an exception is thrown back into it (via "throw", "close" or by deleting it). The result is a reference cycle that needs gar

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

2019-09-29 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://bu

[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

[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.o

[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

[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(

[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 tr

[issue45170] tarfile missing cross-directory checking

2021-09-19 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

[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

[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: -&

[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

[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:

[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

[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. FWI

[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

[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-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 cou

[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

[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 polyn

[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-30 Thread Martin Panter
Martin Panter added the comment: Thanks Victor -- ___ Python tracker <https://bugs.python.org/issue39353> ___ ___ Python-bugs-list mailing list Unsubscribe:

[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 __

[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 ___

[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

[issue26527] CGI library - Using unicode in header fields

2020-03-21 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

[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 appa

[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 "cance

[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:

[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

[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: -> A

[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

[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

[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:

[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:

[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 or

[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

[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

[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

[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. I

[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.

[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

[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:

[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

[issue3982] support .format for bytes

2012-04-14 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue3982> ___ ___ Python-bugs-list mailing list Unsubscribe:

[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

[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.

[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> ___ _

[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

[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

[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. The

[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> ___ ___

[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

[issue27485] urllib.splitport -- is it official or not?

2017-06-13 Thread Martin Panter
Martin Panter added the comment: I don't think it is worth changing the implementations to be in terms of urlsplit or urlparse. This is proposed for splithost in <https://github.com/python/cpython/pull/1849>, but I suspect it would change the behaviour in some corner cases. See

[issue30669] json.tool does not accept an --indent flag

2017-06-14 Thread Martin Panter
Martin Panter added the comment: Issue 29636 looks related -- nosy: +martin.panter ___ Python tracker <http://bugs.python.org/issue30669> ___ ___ Python-bug

[issue25026] (FreeBSD/OSX) Fix fcntl module to accept 'unsigned long' type commands for ioctl(2).

2017-06-14 Thread Martin Panter
Martin Panter added the comment: Maybe Issue 16124 is related; it mentions 64-bit values, but it sounds like an obscure use case. -- ___ Python tracker <http://bugs.python.org/issue25

[issue18140] urlparse, urlsplit confused when password includes fragment (#), query (?)

2017-06-16 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +[security] urllib connects to a wrong host ___ Python tracker <http://bugs.python.org/issue18140> ___ ___ Python-bug

[issue30625] Documentation is unclear how "y*" and "y#" format units vary

2017-06-16 Thread Martin Panter
Martin Panter added the comment: Issue 24009 proposes deprecating y# (among other units). IMO the documentation and error message aren’t specific enough regarding the reference to “bytes-like”. -- nosy: +martin.panter ___ Python tracker <h

[issue30576] http.server should support HTTP compression (gzip)

2017-06-17 Thread Martin Panter
Martin Panter added the comment: I think neither Pierre’s nor Glenn’s implementations should be added to SimpleHTTPRequestHandler. In fact I think most forms of content negotiation are only appropriate for a higher-level server. It seems too far removed from the intention of the class

[issue24465] Make shutil.make_archive have deterministic sorting

2017-06-18 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +tarfile add uses random order title: Make tarfile have deterministic sorting -> Make shutil.make_archive have deterministic sorting ___ Python tracker <http://bugs.python.org/issu

[issue30716] Failing tests with installed 3.6.2rc1 on Win 10-64

2017-06-20 Thread Martin Panter
Martin Panter added the comment: Sounds similar to Issue 27425. Did rc1 get built with mangled newlines or something? -- components: +Tests, Windows nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker <h

[issue30576] http.server should support HTTP compression (gzip)

2017-06-24 Thread Martin Panter
Martin Panter added the comment: For existing “.gz” files, I wasn’t suggesting to compress them a second time, just for the server report that they are already compressed, like how it reports the Content-Type value based on the file name. Including Content-Encoding would help browsers display

[issue30754] textwrap.dedent mishandles empty lines

2017-06-26 Thread Martin Panter
Martin Panter added the comment: Some people like to avoid indented blank lines, treating them the same as trailing whitespace. I suspect this behaviour may be intentional. -- nosy: +martin.panter ___ Python tracker <http://bugs.python.

[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-06-30 Thread Martin Panter
Martin Panter added the comment: Don’t let my minus sign suggestion stop this, especially since a couple other people said they don’t like it. The current pull request proposal is beneficial without it. Isn’t there a “Unicode writer” API that could be used? Maybe that’s another alternative

[issue30319] ConnectionResetError: [Errno 54] Connection reset by peer in socket.close on FreeBSD, Py 3.6

2017-06-30 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +test_threading_handled() of test_socketserver hangs randomly on AMD64 FreeBSD 10.x Shared 3.6, test_threading_not_handled() of test_socketserver hangs randomly on AMD64 FreeBSD 10.x Shared 3.6 ___ Python

[issue30319] ConnectionResetError: [Errno 54] Connection reset by peer in socket.close on FreeBSD, Py 3.6

2017-06-30 Thread Martin Panter
Martin Panter added the comment: I think fixing all affected calls to socket.close in the world (option 3) would be too much. I just added two new reports (Issue 30652 and Issue 30391) as dependencies. These are about testing socketserver.TCPServer. As an example, to fix the socket.close call

[issue30391] test_threading_handled() of test_socketserver hangs randomly on AMD64 FreeBSD 10.x Shared 3.6

2017-06-30 Thread Martin Panter
Martin Panter added the comment: These tests are supposed to: 1. Create a TCP server 2. Open a TCP connection 3. Run a custom connection handler (depending on the particular test) in a new thread 4. When the handler returns, the new thread should call “shutdown_request” 5. Shutdown_request

[issue29926] IDLE: in shell, time.sleep ignores _thread.interrupt_main()

2017-06-30 Thread Martin Panter
Martin Panter added the comment: I doubt the Gnu Readline library nor Python’s readline module are relevant. The input function only uses Readline if sys.stdin is the original stdin terminal; I suspect Idle monkey-patches sys.stdin. The readline method reads directly from the file object; it

[issue30713] Reject newline character (U+000A) in URLs in urllib.parse

2017-07-02 Thread Martin Panter
Martin Panter added the comment: It might help if you explained why you want to make these changes. Otherwise I have to guess. Is a compromise between strictly rejecting all non-URL characters (not just control characters), versus leaving it up to user applications to validate their URLs? I

[issue19613] test_nntplib: sporadic failures, test_article_head_body()

2017-07-02 Thread Martin Panter
Martin Panter added the comment: It looks like I was fairly confident about my patch, but it was all theoretical and I was never able to analyze the failure myself. Sorry but I am unlikely to spend much time on this or open a pull request any time soon

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-05 Thread Martin Panter
Martin Panter added the comment: Thanks for handling this Victor. To answer some of your earlier questions, this is my understanding of the Free BSD behaviour (although I don't have Free BSD to experiment with): When writing to TCP sockets, I believe the data is buffered by the local O

[issue27068] Add a detach() method to subprocess.Popen

2017-07-08 Thread Martin Panter
Martin Panter added the comment: Personally, I haven’t needed this feature. But I still think it may be a decent solution for the “webbrowser” module, potentially your “asyncio” problem, and other cases that could now trigger an unwanted ResourceWarning

[issue30393] test_readline hangs

2017-07-09 Thread Martin Panter
Martin Panter added the comment: Thanks for the information. That narrows the problem down, but I still don’t exactly know why it hangs. A good workaround may be to put a timeout in the “select” call for a second or so, and if it times out, raise an exception which will fail the test but let

[issue29606] urllib FTP protocol stream injection

2017-07-21 Thread Martin Panter
Martin Panter added the comment: Serhiy, that is what Dong-hee already proposed in <https://github.com/python/cpython/pull/1214>, but someone needs to decide if we want to support RFC 2640, in which I understand LF on its own is legal, and CR is escaped by adding

[issue31025] io.BytesIO: no way to get the length of the underlying buffer without copying data

2017-07-25 Thread Martin Panter
Martin Panter added the comment: Can’t you use b.seek(0, SEEK_END)? -- nosy: +martin.panter versions: -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <http://bugs.python.org/issue31

[issue30576] http.server should support HTTP compression (gzip)

2017-07-25 Thread Martin Panter
Martin Panter added the comment: I think chunked encoding is only meant to be used for HTTP 1.1. For HTTP 1.0, you have to either send Content-Length, or shut down the connection after sending the body. See also Issue 21224 about improving HTTP 1.1 support. Maybe you should add a “Vary

[issue31076] http.server should correctly handle HTTP 1.1 responses without a content-length

2017-07-29 Thread Martin Panter
Martin Panter added the comment: The trouble is you would also have to parse the Transfer-Encoding field, and have special logic for responses where Content-Length is not needed or irrelevant (certain combinations of method and status code). And even then you risk breaking rare or custom

[issue31122] SSLContext.wrap_socket() throws OSError with errno == 0

2017-08-04 Thread Martin Panter
Martin Panter added the comment: It might help if you explained what “atrocities” are happening on your network. Is there a proxy or man-in-the-middle (or the remote peer) that shuts down TCP connections? If so, perhaps this is similar to Issue 10808. From my memory, in that case an OS “recv

[issue31136] raw strings cannot end with a backslash character r'\'

2017-08-07 Thread Martin Panter
Martin Panter added the comment: What would your proposal do where an embedded backslash is currently valid? >>> print(r'Backslash apostrophe: \'.') Backslash apostrophe: \'. >>> r'\' # Comment or string?' "\

[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-08-09 Thread Martin Panter
Martin Panter added the comment: Checking for short writes is worthwhile, but in Issue 29070 it looks like Cornelius identified the main problem was short _reads_. See the parts of his patch to do with “_os_read_exactly” and related functions. -- nosy: +Cornelius Diekmann

[issue1732367] Document the constants in the socket module

2017-08-11 Thread Martin Panter
Martin Panter added the comment: Issue 13256 contains a patch documenting socket options, but was closed because the author lost interest. Issue 27409 is a proposal to list the symbols available without documenting what each one is for. -- dependencies: +Document and test new socket

[issue1732367] Document the constants in the socket module

2017-08-12 Thread Martin Panter
Martin Panter added the comment: The general rule for documenting availability seems to be to only list the special cases. Many of the socket options are specified by Posix, and seem to be available on Linux, Windows, BSD and other OSes. If you say “Availability: Linux, Windows”, it could

[issue31192] "return await coro()" SyntaxError despite being "valid syntax" in PEP 492

2017-08-12 Thread Martin Panter
Martin Panter added the comment: In 3.5, “await” is an ordinary identifier outside of “async def” functions. You have to use the “async def” syntax to enable it as a special keyword. >>> async def foo(): # “Async def” enables “await” as a keyword ... return await coro() # Val

[issue31262] Documentation Error

2017-08-22 Thread Martin Panter
Martin Panter added the comment: Assuming this is about the Classes section in the tutorial, you seem to be going down the same track as <https://github.com/python/cpython/pull/2696> -- nosy: +martin.panter ___ Python tracker

[issue31320] test_ssl logs a traceback

2017-09-03 Thread Martin Panter
Martin Panter added the comment: Not sure if you just want to hide the presence of the exception and traceback. But regarding the exception itself (OSError with errno 0), this is not ideal. From memory, you tend to get this when the connection is shut down insecurely at the TCP level. A

[issue31360] argparse mutually_exclusive_group under add_argument_group fails if part of parent_processor

2017-09-06 Thread Martin Panter
Martin Panter added the comment: Seems the same as two other open bugs: Issue 25882 and Issue 16807. -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> argparse help error: arguments created by add_mutually_exclusive

[issue31365] Multiplication issue with 16.1

2017-09-06 Thread Martin Panter
Martin Panter added the comment: The floating-point numbers are only accurate to about 16 digits. You probably just found a value that cannot be exactly represented. https://docs.python.org/3.3/faq/design.html#why-are-floating-point-calculations-so-inaccurate -- nosy: +martin.panter

[issue29396] Re-opening /dev/tty breaks readline

2017-09-06 Thread Martin Panter
Martin Panter added the comment: I think the difference between Python 2 and 3 here is that Python 2’s file objects, including sys.stdin, wrap C library FILE objects, which is supported by the Readline library. However Python 3 has its own kind of file objects, independent of standard C and

[issue31366] Missing terminator option when using readline with socketserver.StreamRequestHandler

2017-09-08 Thread Martin Panter
Martin Panter added the comment: The socket.makefile(newline=...) parameter only affects text mode, but StreamRequestHandler’s “rfile” attribute works in byte mode. You could call makefile or TextIOWrapper yourself, but neither of these options support reading null-terminated “lines” or

  1   2   3   4   5   6   7   8   9   10   >