[issue36777] unittest discover throws TypeError on empty packages
Change by Gus Goulart : -- keywords: +patch pull_requests: +13169 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36777> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36777] unittest discover throws TypeError on empty packages
Gus Goulart added the comment: Confirming that the issue seems to have been introduced on 3.7. Working on this at the PyCon US 2019 sprints. -- nosy: +gus.goulart ___ Python tracker <https://bugs.python.org/issue36777> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33930] Segfault with deep recursion into object().__dir__
Gus Goulart added the comment: After a couple of rounds, this is the benchmark result I got for the attached patch. It seems to be a simple, non-performance degrading fix. python -m perf compare_to origin.json patch.json -G --min-speed=2 Slower (1): - sqlalchemy_declarative: 213 ms +- 4 ms -> 219 ms +- 9 ms: 1.03x slower (+3%) Faster (9): - logging_format: 15.1 us +- 0.3 us -> 14.5 us +- 0.3 us: 1.05x faster (-5%) - hexiom: 15.0 ms +- 0.5 ms -> 14.5 ms +- 0.2 ms: 1.03x faster (-3%) - json_loads: 39.6 us +- 0.7 us -> 38.5 us +- 0.5 us: 1.03x faster (-3%) - json_dumps: 17.2 ms +- 0.4 ms -> 16.7 ms +- 0.2 ms: 1.03x faster (-3%) - fannkuch: 634 ms +- 4 ms -> 619 ms +- 6 ms: 1.02x faster (-2%) - django_template: 183 ms +- 3 ms -> 178 ms +- 5 ms: 1.02x faster (-2%) - float: 153 ms +- 2 ms -> 150 ms +- 1 ms: 1.02x faster (-2%) - raytrace: 761 ms +- 19 ms -> 745 ms +- 8 ms: 1.02x faster (-2%) - regex_effbot: 3.69 ms +- 0.06 ms -> 3.61 ms +- 0.05 ms: 1.02x faster (-2%) Benchmark hidden because not significant (47): 2to3, chaos, crypto_pyaes, deltablue, dulwich_log, go, html5lib, logging_silent, logging_simple, mako, meteor_contest, nbody, nqueens, pathlib, pickle, pickle_dict, pickle_list, pickle_pure_python, pidigits, python_startup, python_startup_no_site, regex_compile, regex_dna, regex_v8, richards, scimark_fft, scimark_lu, scimark_monte_carlo, scimark_sor, scimark_sparse_mat_mult, spectral_norm, sqlalchemy_imperative, sqlite_synth, sympy_expand, sympy_integrate, sympy_sum, sympy_str, telco, tornado_http, unpack_sequence, unpickle, unpickle_list, unpickle_pure_python, xml_etree_parse, xml_etree_iterparse, xml_etree_generate, xml_etree_process -- keywords: +patch Added file: https://bugs.python.org/file47952/bpo-33930.patch ___ Python tracker <https://bugs.python.org/issue33930> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched
Gus Goulart added the comment: @vstinner, on Debian 9 I can see the problem as well but wasn't able to debug with the level of details you did. Could you please share the process you followed? What I found was: ./python -X dev test_lock_sigsegv.py Parent r_q: , , Fatal Python error: Segmentation fault Current thread 0x7fab36124480 (most recent call first): File "/home/gus/Workspace/cpython/Lib/multiprocessing/synchronize.py", line 170 in __repr__ File "/home/gus/Workspace/cpython/test_lock_sigsegv.py", line 17 in child File "/home/gus/Workspace/cpython/Lib/multiprocessing/process.py", line 99 in run File "/home/gus/Workspace/cpython/Lib/multiprocessing/process.py", line 297 in _bootstrap File "/home/gus/Workspace/cpython/Lib/multiprocessing/spawn.py", line 130 in _main File "/home/gus/Workspace/cpython/Lib/multiprocessing/spawn.py", line 117 in spawn_main File "", line 1 in -11 Using GDB: (gdb) set follow-fork-mode child (gdb) run test_lock_sigsegv.py Starting program: /home/gus/Workspace/cpython/python test_lock_sigsegv.py [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Parent r_q: , , [New process 4941] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". process 4941 is executing new program: /home/gus/Workspace/cpython/python -11 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [Inferior 2 (process 4941) exited normally] (gdb) where No stack. (gdb) py-bt Unable to locate python frame (gdb) -- ___ Python tracker <https://bugs.python.org/issue33196> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33930] Segfault with deep recursion into object().__dir__
Gus Goulart added the comment: Sorry, I forgot to include the trashcan API. I'll double check and update the issue. -- ___ Python tracker <https://bugs.python.org/issue33930> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched
Gus Goulart added the comment: I've tested on Fedora 29 server and also failed to reproduce the error. -- Added file: https://bugs.python.org/file47931/testing_on_fedora.png ___ Python tracker <https://bugs.python.org/issue33196> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33930] Segfault with deep recursion into object().__dir__
Change by Gus Goulart : -- nosy: +taleinat ___ Python tracker <https://bugs.python.org/issue33930> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33930] Segfault with deep recursion into object().__dir__
Gus Goulart added the comment: ronaldoussoren, I have tested (Debian 9) substituting "_PyObject_GC_UNTRACK(m);" to "PyObject_GC_UnTrack(m);", and although the tests pass, I'm can still see the segfault error. diff --git a/Objects/methodobject.c b/Objects/methodobject.c index cfea8cf410..cb8e279c7d 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -84,7 +84,7 @@ PyCFunction_GetFlags(PyObject *op) static void meth_dealloc(PyCFunctionObject *m) { -_PyObject_GC_UNTRACK(m); +PyObject_GC_UnTrack(m); if (m->m_weakreflist != NULL) { PyObject_ClearWeakRefs((PyObject*) m); } -- nosy: +gus.goulart ___ Python tracker <https://bugs.python.org/issue33930> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched
Change by Gus Goulart : -- nosy: +taleinat ___ Python tracker <https://bugs.python.org/issue33196> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched
Gus Goulart added the comment: I couldn't reproduce the error on Debian 9 nor OSX, although I tried tweaking the test script a little bit to force the error. Arcadiy, did you tried reproducing the same issue in a different platform? Did someone report something similar in recent issues on gevent? -- nosy: +gus.goulart, vstinner ___ Python tracker <https://bugs.python.org/issue33196> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32485] Multiprocessing dict sharing between forked processes
Gus Goulart added the comment: This is probably a bug that was fixed sometime in Python 3x. Testing on 3.7.1, Python gracefully errors out: ``` ➜ cpython git:(bpo-32485) ✗ python issue_32485.py Same manager, same mux Starting test_sameProcessSameThread Traceback (most recent call last): File "issue_32485.py", line 130, in test_sameProcessSameThread(inst1, inst2, nRuns) File "issue_32485.py", line 48, in test_sameProcessSameThread run(inst1, nRuns) File "issue_32485.py", line 30, in run inst.run() File "issue_32485.py", line 19, in run if (self.d.has_key(self.key)): File "", line 2, in has_key File "/home/gus/.pyenv/versions/3.7.1/lib/python3.7/multiprocessing/managers.py", line 811, in _callmethod raise convert_to_error(kind, result) multiprocessing.managers.RemoteError: --- Traceback (most recent call last): File "/home/gus/.pyenv/versions/3.7.1/lib/python3.7/multiprocessing/managers.py", line 251, in serve_client function = getattr(obj, methodname) AttributeError: 'dict' object has no attribute 'has_key' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/gus/.pyenv/versions/3.7.1/lib/python3.7/multiprocessing/managers.py", line 271, in serve_client fallback_func = self.fallback_mapping[methodname] KeyError: 'has_key' --- ``` -- nosy: +gus.goulart, taleinat ___ Python tracker <https://bugs.python.org/issue32485> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33678] selector_events.BaseSelectorEventLoop.sock_connect should preserve socket type
Gus Goulart added the comment: This error seems to come from base_events.py, lines 142-145, and since it's an OS specific limitation, I can't see Sebastien's suggestion as a feasible solution. Maybe we could come up with something along the lines of the following patch. What do you think about it? diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 3726c556d4..15ee4d9d1b 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -142,6 +142,9 @@ def _ipaddr_info(host, port, family, type, proto): if '%' in host: # Linux's inet_pton doesn't accept an IPv6 zone index after host, # like '::1%lo0'. +if sys.platform.startswith('linux'): +return OSError("Linux's inet_pton doesn't accept an IPv6 " + "zone index after host") return None for af in afs: diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 6d544d1eda..1b944ff89e 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -109,6 +109,9 @@ class BaseEventTests(test_utils.TestCase): self.assertIsNone( base_events._ipaddr_info('::3', 1, INET, STREAM, TCP)) +@unittest.skipIf(sys.platform.startswith('linux'), +"Linux's inet_pton doesn't accept an IPv6 zone index after host") +def test_for(self): # IPv6 address with zone index. self.assertIsNone( base_events._ipaddr_info('::3%lo0', 1, INET6, STREAM, TCP)) -- keywords: +patch nosy: +gus.goulart, taleinat Added file: https://bugs.python.org/file47913/issue33678.patch ___ Python tracker <https://bugs.python.org/issue33678> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27741] datetime.datetime.strptime functionality description incorrect
Change by Gus Goulart : -- keywords: +patch pull_requests: +9335 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue27741> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27741] datetime.datetime.strptime functionality description incorrect
Gus Goulart added the comment: Thanks, Tal. I will open up a PR for it. -- ___ Python tracker <https://bugs.python.org/issue27741> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27741] datetime.datetime.strptime functionality description incorrect
Gus Goulart added the comment: As far as I can see, every time something changes on datetime.strptime(), it will invalidate that section of the documentation. On the other hand, I believe the comparison with datetime(*(time.strptime(date_string, format)[0:6])" is interesting and valuable to keep. Given that, instead of "This is equivalent to [...]", I would suggest something like: "This is similar to [...], but datetime.strptime() is better since it retains both microseconds and timezone data." -- ___ Python tracker <https://bugs.python.org/issue27741> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34187] Issues with lazy fd support in _WindowsConsoleIO fileno() and close()
Change by Gus Goulart : -- keywords: +patch pull_requests: +9275 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issue34187> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27741] datetime.datetime.strptime functionality description incorrect
Change by Gus Goulart : -- nosy: +taleinat ___ Python tracker <https://bugs.python.org/issue27741> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27741] datetime.datetime.strptime functionality description incorrect
Gus Goulart added the comment: It is true that time.srtptime() does not return microseconds, but as the documentation suggests, it will return the microseconds after you wrap it up with datetime(). I have attached a walkthrough of how I see that section of the docs. Please let me know if you have anything else in mind. Thanks! -- nosy: +gus Added file: https://bugs.python.org/file47863/datetime_docs.PNG ___ Python tracker <https://bugs.python.org/issue27741> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34203] documentation: recommend Python 3 over 2 in faq
Gus Goulart added the comment: Thanks for pointing that out. If you don't mind, I have created a PR to address your requests. -- nosy: +gus, taleinat ___ Python tracker <https://bugs.python.org/issue34203> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34203] documentation: recommend Python 3 over 2 in faq
Change by Gus Goulart : -- keywords: +patch pull_requests: +9180 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issue34203> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34187] Issues with lazy fd support in _WindowsConsoleIO fileno() and close()
Gus Goulart added the comment: Hi everyone, I would like to let you know that I'm starting working on this one. Thanks! -- nosy: +Gus ___ Python tracker <https://bugs.python.org/issue34187> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com