[issue14320] set.add can return boolean indicate newly added item

2012-03-15 Thread Matt Joiner
New submission from Matt Joiner : set.add can return True to indicate a newly added item to the set, or False if the item was already present. The C function PySet_Add returns -1 on error, and 0 on success currently. This is extended to return 1 if the item is newly added, and 0 if it was

[issue14320] set.add can return boolean indicate newly added item

2012-03-15 Thread Matt Joiner
Changes by Matt Joiner : Added file: http://bugs.python.org/file24863/bench_set_add.py ___ Python tracker <http://bugs.python.org/issue14320> ___ ___ Python-bugs-list m

[issue13872] socket.detach doesn't mark socket._closed

2012-03-15 Thread Matt Joiner
Matt Joiner added the comment: Yes it should. A cursory glance shows that __repr__ returns incorrect if _closed is not marked, and an unnecessary mop-up call to socket.close is avoided. -- nosy: +giampaolo.rodola, haypo, stutzbach ___ Python

[issue13694] asynchronous connect in asyncore.dispatcher does not set addr

2012-03-15 Thread Matt Joiner
Matt Joiner added the comment: I should mention that this failure to set addr is unusual seeing as most socket instances are wrapping AF_INET* domain sockets, and aren't likely to connect without blocking. This is quite likely a reason nobody has observed it until now. It *is* desirab

[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2012-03-15 Thread Matt Joiner
Matt Joiner added the comment: Steven, patch attached. I lost steam in the unittests with all the meta, suffice it that the names match the file descriptors of the stream sources. i.e. FileType('rb') would give a file with name=0, and so forth. My chosen method also allows other

[issue14320] set.add can return boolean indicate newly added item

2012-03-16 Thread Matt Joiner
Matt Joiner added the comment: Is there still some value to at least exposing this in the C API, per the precedents I mentioned? The patch also contains some adjustment to the set_add_entry/set_add_key abstraction dance, and some future proofing of PySet_Add return values that have merit

[issue14333] queue unittest errors

2012-03-16 Thread Matt Joiner
New submission from Matt Joiner : $ python3.3 -m unittest test.test_queue Generates errors in the unit test code of the form AttributeError: 'BaseQueueTest' object has no attribute 'type2test' -- components: Tests messages: 156006 nosy: anacrolix, benjamin.

[issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb

2012-03-16 Thread Matt Joiner
Matt Joiner added the comment: This changeset has broken something. All I get is a confusing backtrace ending with: File "/home/matt/src/python-torrent/torrent/bencode.py", line 15, in encode yield from encode(k) AttributeError: 'list_iterator' object has no attri

[issue14333] queue unittest errors

2012-03-17 Thread Matt Joiner
Matt Joiner added the comment: Yes, FWIW much of the standard library tests are callable this way without issue. I have patches that fix the discoverability of a few test modules. I'll submit these in another issue. -- ___ Python tracker

[issue12684] profile does not dump stats on exception like cProfile does

2012-03-17 Thread Matt Joiner
Matt Joiner added the comment: I will submit a patch for this soon. -- ___ Python tracker <http://bugs.python.org/issue12684> ___ ___ Python-bugs-list mailin

[issue13448] PEP 3155 implementation

2012-03-18 Thread Matt Joiner
Matt Joiner added the comment: Doc/library/dis.rst wasn't updated for the extra pop introduced to MAKE_CLOSURE opcode. -- nosy: +anacrolix ___ Python tracker <http://bugs.python.org/is

[issue14373] C implementation of functools.lru_cache

2012-03-20 Thread Matt Joiner
New submission from Matt Joiner : functools.lru_cache is optimized to the point that it may benefit from a C implementation. -- components: Interpreter Core, Library (Lib) messages: 156405 nosy: anacrolix, rhettinger priority: normal severity: normal status: open title: C

[issue14373] C implementation of functools.lru_cache

2012-03-20 Thread Matt Joiner
Changes by Matt Joiner : Added file: http://bugs.python.org/file24958/functools.lru_cache-in-c ___ Python tracker <http://bugs.python.org/issue14373> ___ ___ Python-bug

[issue12684] profile does not dump stats on exception like cProfile does

2012-03-20 Thread Matt Joiner
Changes by Matt Joiner : Added file: http://bugs.python.org/file24961/profiler-unhandled-exceptions.patch ___ Python tracker <http://bugs.python.org/issue12684> ___ ___

[issue13694] asynchronous connect in asyncore.dispatcher does not set addr

2012-03-20 Thread Matt Joiner
Matt Joiner added the comment: This patch is a shoo-in, can someone review and commit this? -- ___ Python tracker <http://bugs.python.org/issue13694> ___ ___

[issue12684] profile does not dump stats on exception like cProfile does

2012-03-20 Thread Matt Joiner
Matt Joiner added the comment: I attached a minimal patch that additionally tidies the exception handling for {cP,p}rofile.runctx. -- ___ Python tracker <http://bugs.python.org/issue12

[issue14373] C implementation of functools.lru_cache

2012-03-21 Thread Matt Joiner
Matt Joiner added the comment: Updated patch to fix a crash if maxsize isn't given, and add a unit test for that. Possible issues: * I've tried to emulate object() by calling PyBaseObject_Type. Not sure if there's a more lightweight object for this that just provides the n

[issue9528] Add pure Python implementation of time module to CPython

2012-03-22 Thread Matt Joiner
Changes by Matt Joiner : -- nosy: +anacrolix ___ Python tracker <http://bugs.python.org/issue9528> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4331] Can't use _functools.partial() created function as method

2012-03-24 Thread Matt Joiner
Changes by Matt Joiner : -- nosy: +anacrolix ___ Python tracker <http://bugs.python.org/issue4331> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4331] Can't use _functools.partial() created function as method

2012-03-24 Thread Matt Joiner
Matt Joiner added the comment: I've attached a patch that implements the descriptor protocol for functools.partial with minimum changes. -- Added file: http://bugs.python.org/file25016/functools.partial-descrget.patch ___ Python tracker

[issue14406] Race condition in concurrent.futures

2012-03-25 Thread Matt Joiner
New submission from Matt Joiner : There's a race condition in concurrent.futures in _AllCompletedWaiter, which affects wait(return_when=ALL_COMPLETED). The attached test will go into an infinite wait. -- components: Library (Lib) files: concurrent.futures._AllCompletedWaiter

[issue14406] Race condition in concurrent.futures

2012-03-25 Thread Matt Joiner
Matt Joiner added the comment: Patch attached. -- keywords: +patch Added file: http://bugs.python.org/file25020/concurrent.futures._AllCompletedWaiter-race-condition.patch ___ Python tracker <http://bugs.python.org/issue14

[issue14406] Race condition in concurrent.futures

2012-03-25 Thread Matt Joiner
Changes by Matt Joiner : -- nosy: +bquinlan, loewis, pitrou, rosslagerwall ___ Python tracker <http://bugs.python.org/issue14406> ___ ___ Python-bugs-list mailin

[issue14407] concurrent.futures tests don't adher to test_cases protocol

2012-03-25 Thread Matt Joiner
New submission from Matt Joiner : matt@matt-1005P:~/src/cpython$ ./python -m unittest test.test_concurrent_futures Ran 79 tests in 62.554s FAILED (errors=18) Failures are due to test discovery picking up unintentionally exposed tests. By adhering to the test_cases protocol introduced in 3.2

[issue14407] concurrent.futures tests don't adher to test_cases protocol

2012-03-25 Thread Matt Joiner
Changes by Matt Joiner : -- type: -> enhancement ___ Python tracker <http://bugs.python.org/issue14407> ___ ___ Python-bugs-list mailing list Unsubscri

[issue14373] C implementation of functools.lru_cache

2012-03-25 Thread Matt Joiner
Changes by Matt Joiner : -- nosy: +nedbat ___ Python tracker <http://bugs.python.org/issue14373> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14408] Support the test_cases protocol in the stdlib tests

2012-03-25 Thread Matt Joiner
New submission from Matt Joiner : Python 3.2 added the test_cases protocol. Many of the stdlib tests won't run using the `$ python3 -m unittest test.test_blah` method due to select unit test class names, and some regrtest arcanity. Defining test_cases makes these tests work as expecte

[issue14373] C implementation of functools.lru_cache

2012-03-26 Thread Matt Joiner
Matt Joiner added the comment: I've fixed the commenting, and cache_info use. I've left the element management in pure C as it reduces memory use (56 bytes for 4 element list, vs. 16 for lru_cache_elem), and avoids ref counting overhead (3 refs per link, plus GC). The difference mi

[issue14373] C implementation of functools.lru_cache

2012-03-26 Thread Matt Joiner
Changes by Matt Joiner : Removed file: http://bugs.python.org/file24958/functools.lru_cache-in-c ___ Python tracker <http://bugs.python.org/issue14373> ___ ___ Python-bug

[issue14408] Support the load_tests protocol in the stdlib tests

2012-03-27 Thread Matt Joiner
Matt Joiner added the comment: I think if you can correctly construct the same test case list using discovery then that's far superior. But I haven't tried this, and don't know if you can correctly predicate the support classes using only c

[issue14408] Support ./python -m unittest in the stdlib tests

2012-03-28 Thread Matt Joiner
Matt Joiner added the comment: Michael: The thread setup and cleanup is not required, AFAICT. You are also correct in that these particular test modules do not run correctly without modification (although test_queue does now that the bug I reported there was fixed). Sorry by predicated, I

[issue14408] Support ./python -m unittest in the stdlib tests

2012-03-29 Thread Matt Joiner
Matt Joiner added the comment: I'm working on a patch using TestCase a la test_queue. Perhaps we should create an issue for a base class test case decorator or something to that effect? -- ___ Python tracker <http://bugs.python.org/is

[issue14408] Support ./python -m unittest in the stdlib tests

2012-03-29 Thread Matt Joiner
Matt Joiner added the comment: It could in fact be necessary, if the inheritance cannot be juggled to give the right MRO. Fortunately this is not the case, I should have a patch using TestCase inheritance for discovery tomorrow. -- ___ Python

[issue14447] marshal.load() reads entire remaining file instead of just next value

2012-03-29 Thread Matt Chaput
New submission from Matt Chaput : In Python 3.2, if you write several values to a file with multiple calls to marshal.dump(), and then try to read them back, the first marshal.load() returns the first value, but reads to the end of the file, so subsequent calls to marshal.load() raise an

[issue14406] Race condition in concurrent.futures

2012-03-29 Thread Matt Joiner
Matt Joiner added the comment: I'll add this shortly. -- ___ Python tracker <http://bugs.python.org/issue14406> ___ ___ Python-bugs-list mailing list Unsubsc

[issue14406] Race condition in concurrent.futures

2012-03-31 Thread Matt Joiner
Matt Joiner added the comment: Patch with a test included. Being a nondeterministic bug, please adjust the thread count, or timing as necessary, the parameters in the patch are as low as I can get them and still reasonably reproduce the bug (linux 3.2, i386). There's a few complicatio

[issue14408] Support ./python -m unittest in the stdlib tests

2012-04-01 Thread Matt Joiner
Matt Joiner added the comment: The patch attached, rejigs the TestCase inheritance in test.test_socket so that tests run correctly using unittest discovery. Recent changes have made test_queue, and test_threading run without similar fixes, so I don't think fixes for those are nece

[issue14408] Support ./python -m unittest in the stdlib tests

2012-04-01 Thread Matt Joiner
Matt Joiner added the comment: Attached is a patch for test_concurrent_futures, similar to the patch for test_socket. -- Added file: http://bugs.python.org/file25088/test_concurrent_futures-unittest-discoverability.patch ___ Python tracker <h

[issue14373] C implementation of functools.lru_cache

2012-04-02 Thread Matt Joiner
Matt Joiner added the comment: > * it incorporate the recent lru_cache algorithmic updates (moving the root > around the circular queue to re-use old links). The existing C patch already does this. > * it shows which parts should be implemented in C using a regular type and >

[issue14373] C implementation of functools.lru_cache

2012-04-02 Thread Matt Joiner
Changes by Matt Joiner : Removed file: http://bugs.python.org/file25026/functools.lru_cache-in-c.patch ___ Python tracker <http://bugs.python.org/issue14373> ___ ___ Pytho

[issue14373] C implementation of functools.lru_cache

2012-04-02 Thread Matt Joiner
Changes by Matt Joiner : Removed file: http://bugs.python.org/file24984/functools.lru_cache-in-c.patch ___ Python tracker <http://bugs.python.org/issue14373> ___ ___ Pytho

[issue9634] Add timeout parameter to Queue.join()

2012-04-04 Thread Matt Joiner
Changes by Matt Joiner : -- nosy: +anacrolix ___ Python tracker <http://bugs.python.org/issue9634> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1360] Queue.get() can't be interrupted with Ctrl-C unless timed out

2012-04-04 Thread Matt Joiner
Matt Joiner added the comment: Isn't this fixed in Python>=3.2? -- nosy: +anacrolix ___ Python tracker <http://bugs.python.org/issue1360> ___ ___ Py

[issue30703] regrtest hangs on the master branch

2017-06-20 Thread Matt Billenstein
Matt Billenstein added the comment: I've been debugging this and I can repro on El Capitan on a different machine as well -- it's an infrequent hang, I've been running in a loop: mattb@mattb-mbp:~/src/misc/cpython master$ for i in $(seq 1000); do echo "Run: $i -- $(date)&q

[issue30703] regrtest hangs on the master branch

2017-06-20 Thread Matt Billenstein
Matt Billenstein added the comment: It consistently takes between ~61 and ~73 seconds with this setup. -- ___ Python tracker <http://bugs.python.org/issue30

[issue30703] test_multiprocessing_forkserver hangs on the master branch

2017-06-24 Thread Matt Billenstein
Matt Billenstein added the comment: Cool -- do you need me to do something more to help debug this? -- ___ Python tracker <http://bugs.python.org/issue30

[issue30703] test_multiprocessing_forkserver hangs on the master branch

2017-06-24 Thread Matt Billenstein
Matt Billenstein added the comment: I don't see anything odd -- it runs for awhile and then times out once it's deadlocked: 0:03:18 load avg: 3.20 [224] test_multiprocessing_forkserver test_many_processes (test.test_multiprocessing_forkserver.WithProcessesTestProce

[issue30703] test_multiprocessing_forkserver hangs on the master branch

2017-06-25 Thread Matt Billenstein
Matt Billenstein added the comment: Yes, I'll email you the details. -- ___ Python tracker <http://bugs.python.org/issue30703> ___ ___ Python-bugs-list m

[issue30703] Non-reentrant signal handler (test_multiprocessing_forkserver hangs)

2017-06-30 Thread Matt Billenstein
Matt Billenstein added the comment: Verified this by letting the test_many_processes loop overnight (master@42bc8beadd49)-- 34k passes later and no hangs. Nice work! -- ___ Python tracker <http://bugs.python.org/issue30

[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-08-18 Thread Matt Rasband
Matt Rasband added the comment: I attempted this myself, it seemed to have too many costs associated for the stdlib and is something easy enough to wrap myself when I need this functionality with explicit semantics on how to "stop" the queue (using an `object()` sentinel). My impl

[issue1230540] sys.excepthook doesn't work in threads

2017-09-15 Thread Matt Groth
Matt Groth added the comment: Thank you Antoine Pitrou, I was able to disable this behavior by commenting out some lines of code in 'traceback' and replacing them with the appropriate call to 'sys.excepthook'. Note you also have to comment out a few lines in "Mo

[issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__

2018-11-20 Thread Matt Wilber
Matt Wilber added the comment: Inada-san, I think it's fair to ask for a broader vision about how ABCs are used. In that respect I'm wondering about some inconsistencies in the existing functools module about whether wrappers should maintain the wrapped function's __isa

[issue12822] NewGIL should use CLOCK_MONOTONIC if possible.

2019-01-31 Thread Matt Joiner
Change by Matt Joiner : -- nosy: -anacrolix ___ Python tracker <https://bugs.python.org/issue12822> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-08 Thread Matt Bogosian
New submission from Matt Bogosian: It looks like there's a problem examining ``.tar`` files with no entries: ``` $ # == $ # Extract test cases (attached to this bug report) $ tar xpvf tarfail.tar.bz2 x tarfail/ x tarfail/tarfa

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-08 Thread Matt Bogosian
Matt Bogosian added the comment: FWIW, the (offending) fix for #24259 was introduced (e.g., in 2.7) via 2.7.10. I've verified that 2.7.9 works as expected: ``` $ python -V Python 2.7.9 $ python tarfail.py opening /…/tarfail/test.tar.bz2 opening /…/tarfail/tes

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Matt Bogosian added the comment: I'm not sure if it helps at this point, but I've tried several "flavors" of apparently legit tar files with zero entries. All fail. ``tarfile`` module: ``` $ ( set -x ; cd /tmp || exit 1 ; python -V ; rm -fv test.tar ; python -c 

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Matt Bogosian added the comment: This patch (also attached) seems to address this particular use case: ``` --- a/Lib/tarfile.py2016-12-17 12:41:21.0 -0800 +++ b/Lib/tarfile.py2017-03-10 12:23:34.0 -0800 @@ -2347,7 +2347,7 @@ # Advance the file pointer

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Changes by Matt Bogosian : Removed file: http://bugs.python.org/file46717/tarfile.patch ___ Python tracker <http://bugs.python.org/issue29760> ___ ___ Python-bugs-list m

[issue29760] tarfile chokes on reading .tar file with no entries (but does fine if the same file is bzip2'ed)

2017-03-10 Thread Matt Bogosian
Matt Bogosian added the comment: After some consideration, I think this is probably more correct: ``` --- /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py 2016-12-17 12:41:21.0 -0800 +++ tarfile.py 2017-03-10 14:57:15.0 -0800 @@ -2347,9 +2347,10

[issue30346] Odd behavior when unpacking `itertools.groupby`

2017-05-11 Thread Matt Gilson
New submission from Matt Gilson: There is some odd behavior when unpacking the groups from an itertools.groupby result. For example: from itertools import groupby from operator import itemgetter inputs = ((x > 5, x) for x in range(10)) (_, a), (_, b) = groupby(inputs,

[issue36522] http/client.py does not print duplicate header values in debug

2019-04-03 Thread Matt Houglum
New submission from Matt Houglum : This is a follow-up to https://bugs.python.org/issue33365. The fix for that issue (see https://github.com/python/cpython/pull/6611) added a statement to also print header values, but it does not account for the case where multiple values exist for the same

[issue36738] Add 'array_hook' for json module

2019-04-27 Thread matt farrugia
New submission from matt farrugia : The json module allows a user to provide an `object_hook` function, which, if provided, is called to transform the dict that is created as a result of parsing a JSON Object. It'd be nice if there was something analogous for JSON Arrays: an `array

[issue36738] Add 'array_hook' for json module

2019-04-27 Thread matt farrugia
Change by matt farrugia : -- keywords: +patch pull_requests: +12906 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36738> ___ ___ Py

[issue36866] Certificate verification errors in urllib.request become URLError

2019-05-09 Thread Matt Martz
New submission from Matt Martz : The behavior of how SSL certificate validation is handled was changed in https://bugs.python.org/issue31399 This introduced a new exception, ssl.SSLCertVerificationError, which is raised for any certificate validation error, instead of the previous exception

[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2018-01-13 Thread Matt Ripley
New submission from Matt Ripley : When I try to use any of the installers downloaded from the website I get the errors 2203 and 0x80070643: [2468:1D2C][2018-01-13T20:15:51]e000: Error 0x80070643: Failed to install MSI package. [2468:1D2C][2018-01-13T20:15:51]e000: Error 0x80070643: Failed to

[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2018-01-26 Thread Matt Ripley
Matt Ripley added the comment: Hi Terry, Thanks for getting back to me on this. I tried all of the suggestions on the link that you sent to me and the python installer still will not install for me. I get the same errors. I can install the conda python distributions. I only have these

[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2018-02-11 Thread Matt Ripley
Matt Ripley added the comment: Hi Steve, Finally sorted this out. I tried all the workarounds that I could find on the web for similar issues. In the end I needed to re-image windows 10. This was the only thinkg that sorted it out. So looked like the windows had ccorrupted preventing the msi

[issue32958] socket module calls with long host names can fail with idna codec error

2018-03-06 Thread Matt Eaton
Matt Eaton added the comment: Using Ubuntu 16.04 with the 3.6.0 tag I was also able to reproduce the same error reported: import socket h = "0123456789012345678901234567890123456789012345678901234567890123.example.com" socket.gethostbyname(h) Traceback (most recent call las

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Matt Harvey
Matt Harvey added the comment: Hi, No, using the affinity's not useful to us as, in the general case, the batch system (PBS Pro in our case) isn't using cgroups or cpusets (it does control ave cpu use by monitoring rusage of the process group). Several other batch system I'

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Matt Harvey
Matt Harvey added the comment: @njs your sketch in msg313406 looks good. Probably better to go with OMP_NUM_THREADS than NCPUS. M -- ___ Python tracker <https://bugs.python.org/issue32

[issue33045] SSL Dcumentation Error

2018-03-10 Thread Matt Eaton
New submission from Matt Eaton : I was reading through the SSL documentation and noticed a typo on Diffe-Hellman and wanted to clean it up. PR is coming soon. -- assignee: docs@python components: Documentation messages: 313559 nosy: agnosticdev, docs@python priority: normal severity

[issue33045] SSL Dcumentation Error

2018-03-10 Thread Matt Eaton
Change by Matt Eaton : -- keywords: +patch pull_requests: +5826 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33045> ___ ___ Python-

[issue33045] SSL Dcumentation Error

2018-03-10 Thread Matt Eaton
Matt Eaton added the comment: Thank you very much, Berker!! -- ___ Python tracker <https://bugs.python.org/issue33045> ___ ___ Python-bugs-list mailing list Unsub

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-11 Thread Matt Eaton
Change by Matt Eaton : -- keywords: +patch pull_requests: +5837 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33034> ___ ___ Python-

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-11 Thread Matt Eaton
Change by Matt Eaton : -- pull_requests: +5838 ___ Python tracker <https://bugs.python.org/issue33034> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-11 Thread Matt Eaton
Matt Eaton added the comment: I agree. I think an explicit exception message would be appropriate when the cast fails to cast from string to int in int(post, 10). Putting in a PR to fix this now. https://github.com/python/cpython/pull/6078 -- nosy: +agnosticdev

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-15 Thread Matt Eaton
Matt Eaton added the comment: "Wouldn't we be better off to catch this error at parse time, instead of just improve the error message when .port is called?" I think there could be a case to be made about catching and dealing with this error in urlparse() / urlsplit() instead o

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-16 Thread Matt Eaton
Matt Eaton added the comment: Jonathan, thank you very much for your thoughts I appreciate the pros and cons of each option. In regards to your option C, if we provided a flag to optionally raise the error in urlsplit and urlparse were you thinking the default flag to be set to True? For

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-17 Thread Matt Eaton
Matt Eaton added the comment: One more question I would raise based upon a point made earlier by Eric is if option C would be too large of a change for 3.8? Any thoughts on this? -- ___ Python tracker <https://bugs.python.org/issue33

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-17 Thread Matt Eaton
Matt Eaton added the comment: This is a very good point, Eric. For backwards compatibility we would have to set the default parameter to false, so we be in the same state we are today by default. Knowing this my vote would be to go with the improvements to the ValueError message when using

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-17 Thread Matt Eaton
Matt Eaton added the comment: Yes, my goal for the patch was to provide a more explicit error message for this situation and to provide a low surface area change to the overall source, knowing that there are future development goals and backward compatibility to keep in mind. That way the

[issue33093] Fatal error on SSL transport

2018-03-18 Thread Matt Eaton
Matt Eaton added the comment: Eric, what is needed to try and reproduce this issue accurately? Would it be installing websockets and setting up your client to ping to the server forever (12 hours in this case)? If you are able to provide a client I would be willing to setup a test case on

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-20 Thread Matt Eaton
Matt Eaton added the comment: Berker and Eric, thank you very much. I really like the idea of introducing a new API with more strict parsing rules for this situation. I would be willing to put some ideas down on a first pass at this

[issue33167] RFC Documentation Updates to urllib.parse.rst

2018-03-28 Thread Matt Eaton
New submission from Matt Eaton : A recent patch that I worked on resulted in an agreement that there could be a use case for a new URL API to be added to urllib.parse. See: https://bugs.python.org/issue33034 In my research to develop this new API I have been looking at the documentation for

[issue33167] RFC Documentation Updates to urllib.parse.rst

2018-03-28 Thread Matt Eaton
Change by Matt Eaton : -- keywords: +patch pull_requests: +6014 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33167> ___ ___ Python-

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-30 Thread Matt Eaton
Matt Eaton added the comment: Oliver, A possible option that would work for both the client side caching and the server would be to pass back a Cache-Control header with a max-age attached when the 301 is returned. I am thinking something like this: if os.path.isdir(path): parts

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-30 Thread Matt Eaton
Matt Eaton added the comment: It looks like the 301 redirect is in place to emulate the behavior that Apache provides when it runs into a trailing slash. This is observed when this condition is met: parts = urllib.parse.urlsplit(self.path) if not parts.path.endswith('/'): Apache

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-30 Thread Matt Eaton
Matt Eaton added the comment: I agree with you in regards to the statement, "Apache's redirect can be turned off, whereas this can't." That is why my first thought would be to try and control this response to the client a bit better by providing a variable max-age. sel

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-30 Thread Matt Eaton
Matt Eaton added the comment: I was able to get some time together today and created a rough draft for the idea that you had Berker on introducing a new API with more strict parsing rules. This will allow the ValueError to be raised when the URL is parsed rather than when the computed

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-31 Thread Matt Eaton
Matt Eaton added the comment: Adding some core team members to the nosy list to get their take on this as well. -- nosy: +berker.peksag, eric.smith ___ Python tracker <https://bugs.python.org/issue33

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-04-03 Thread Matt Eaton
Matt Eaton added the comment: Wanted to check in on this to see if there was any feedback by any community or core members? -- ___ Python tracker <https://bugs.python.org/issue33

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-04-03 Thread Matt Eaton
Matt Eaton added the comment: Wanted to check in on this to see if there was any feedback on this topic? -- ___ Python tracker <https://bugs.python.org/issue33

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-09-29 Thread Matt Pr
New submission from Matt Pr : Doing a cross domain iframe test. `domain1.html` has iframe pointing at `domain2.html` which has iframe pointing at `domain3.html`. `domain{1,2,3}.com` are all configured to point at `127.0.0.1` in my `/etc/hosts` file. Loaded up `http://domain1.com:8000

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-09-29 Thread Matt Pr
Matt Pr added the comment: It has been pointed out to me that this issue may be related to chrome making multiple requests in parallel. A test with wget seems to support this. wget -E -H -k -K -p http://domain1.com:8000/domain1.html ...does not hang, whereas requests from chrome do hang

[issue31805] support._is_gui_available() hangs on x86-64 Sierra 3.6/3.x buildbot

2017-10-17 Thread Matt Billenstein
Matt Billenstein added the comment: Did some debugging by sticking a couple prints in support.is_gui_available() and it appears everything is fine up until the call to app_services.SetFrontProcess() -- this is returning error code -606 which is defined in: /System/Library/Frameworks

[issue31805] support._is_gui_available() hangs on x86-64 Sierra 3.6/3.x buildbot

2017-10-17 Thread Matt Billenstein
Matt Billenstein added the comment: Note, that's running ./python.exe Lib/tests/test_tk.py from a Terminal when logged into the gui... -- ___ Python tracker <https://bugs.python.org/is

[issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS

2017-11-09 Thread Matt Billenstein
Matt Billenstein added the comment: Reflected on the High Sierra buildbot now: http://buildbot.python.org/all/#/builders/14/builds/162 -- nosy: +mattbillenstein ___ Python tracker <https://bugs.python.org/issue31

[issue32185] SSLContext.wrap_socket sends SNI Extension when server_hostname is IP

2017-11-30 Thread Matt Davis
New submission from Matt Davis : The current implementation of SSLContext.wrap_socket blindly sends whatever is passed in server_hostname in the SNI extension, assuming it's a DNS hostname. RFC6066 describes the SNI TLS extension, and specifically states that 'Literal IPv4 and IPv6

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-01-09 Thread Matt Billenstein
Matt Billenstein added the comment: I don't see a conflict in the uids: mattb@mattb-mbp2:~ $ id -u buildbot 506 mattb@mattb-mbp2:~ $ id -u _timed 266 mattb@mattb-mbp2:~ $ grep _timed /etc/passwd _timed:*:266:266:Time Sync Daemon:/var/db/timed:/usr/bin/false mattb@mattb-mbp2:~ $ grep 506

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-01-09 Thread Matt Billenstein
Matt Billenstein added the comment: Note, I can repro running it by hand from the cli. And I cannot repro on 3.x, only 3.6 on the same machine. -- ___ Python tracker <https://bugs.python.org/issue32

<    1   2   3   4   5   6   >