[issue40077] Convert static types to heap types: use PyType_FromSpec()

2020-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you @erlendaasland ! -- components: +Extension Modules -C API, Subinterpreters nosy: +pitrou resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement __

[issue40077] Convert static types to heap types: use PyType_FromSpec()

2020-11-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Oops, sorry, I hadn't noticed this was a catch-all issue. Reopening. -- resolution: fixed -> stage: resolved -> status: closed -> open ___ Python tracker <https://bugs.python.or

[issue42097] Python 3.7.9 logging/threading/fork hang

2020-10-21 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue42097> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41052] Opt out serialization/deserialization for heap type

2020-10-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: At some point, pickle protocols 0 and 1 should be deprecated and slated for removal. Protocol 2 is 17 years ago already, and protocol 3 has become the default in Python 3. That would probably be a better use of contributor time than trying to make heap

[issue41310] micro-optimization: increase our float parsing speed by Nx

2020-10-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: FTR, no formal description of the algorithm seems to have been published, but the source code is amply commented: https://github.com/lemire/fast_double_parser/blob/master/include/fast_double_parser.h -- nosy: +pitrou

[issue41310] micro-optimization: increase our float parsing speed by Nx

2020-10-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- priority: normal -> low ___ Python tracker <https://bugs.python.org/issue41310> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue42081] Consider fast_double_parser for faster str->double

2020-10-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> micro-optimization: increase our float parsing speed by Nx ___ Python tracker <https://bugs.python

[issue42081] Consider fast_double_parser for faster str->double

2020-10-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Oh, thank you. -- ___ Python tracker <https://bugs.python.org/issue42081> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42081] Consider fast_double_parser for faster str->double

2020-10-19 Thread Antoine Pitrou
New submission from Antoine Pitrou : This is more of a "could be nice" entry if there are any interested core developers. A new algorithm and library was recently published for faster parsing of double numbers. It claims rigorous accuracy and the performance is

[issue37209] Add what's new entries for pickle enhancements

2020-10-12 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37881] __text_signature__ parser doesn't handle globals in extension module

2020-10-08 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue37881> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41066] Update documentation for Pathlib

2020-08-13 Thread Antoine Pitrou
Change by Antoine Pitrou : -- versions: -Python 3.7 ___ Python tracker <https://bugs.python.org/issue41066> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41066] Update documentation for Pathlib

2020-08-13 Thread Antoine Pitrou
Change by Antoine Pitrou : -- pull_requests: +20991 pull_request: https://github.com/python/cpython/pull/21864 ___ Python tracker <https://bugs.python.org/issue41

[issue41066] Update documentation for Pathlib

2020-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 0eb9deb4a62e6d9daa82bc2f67d1075864ca8ece by Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) in branch 'master': bpo-41066: Update the comparison section for os vs pathlib (GH-21261) https://github.com/python/cpython/commit

[issue30155] Add ability to get tzinfo from a datetime instance in C API

2020-07-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'm going to rename this bug to focus only on issue #1. I think we can accept > a PR adding two new macros. I would suggest calling them: > - PyDateTime_DATE_GET_TZINFO > - PyDateTime_TIME_GET_TZINFO +1 for this. -- n

[issue39604] Document PyDateTimeAPI / PyDateTime_CAPI struct

2020-07-20 Thread Antoine Pitrou
Change by Antoine Pitrou : -- stage: -> needs patch type: -> behavior versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issue39604> ___ __

[issue41324] Add a minimal decimal capsule API

2020-07-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: I probably won't try it out explicitly (it's basically cumbersome for us to test with non-release Pythons, because of our dependencies to Numpy and Cython), but reviewing the API should be enough anyway

[issue41208] An exploitable segmentation fault in marshal module

2020-07-05 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +serhiy.storchaka, vstinner ___ Python tracker <https://bugs.python.org/issue41208> ___ ___ Python-bugs-list mailin

[issue40874] Update to libmpdec-2.5.0

2020-07-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the clarification. I agree this does not seem to be a very big deal, if slightly annoying for the packager who will have to deal with it. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40874] Update to libmpdec-2.5.0

2020-07-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hmm, I'm only taking notice of this comment thread now. (sorry, but due to spam filtering issues I only receive bpo e-mail notifications intermittently... and that's despite having tried two separate e-mail providers which otherwise give me no problems

[issue41195] Interface to OpenSSL's security level

2020-07-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: No strong feelings on this, but the OpenSSL runtime is not always packaged by a Linux distribution. (macOS, Windows and Anaconda come to mind) If one wants to retain the setter facility, one could raise a RuntimeWarning if the user *lowers* the actual

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2020-06-29 Thread Antoine Pitrou
Change by Antoine Pitrou : -- versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue29

[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-25 Thread Antoine Pitrou
New submission from Antoine Pitrou : A number of codecs raise bare UnicodeError, rather than Unicode{Decode,Encode}Error. Example: File "/home/antoine/miniconda3/envs/pyarrow/lib/python3.7/encodings/utf_16.py", line 67, in _buffer_decode raise UnicodeError("UTF

[issue15655] PEP 384 Refactoring applied to json module

2020-06-22 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker <https://bugs.python.org/issue15655> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40895] weakref documentation contains cautions about dictionary mutation problems that have been solved in the implementation

2020-06-10 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python

[issue40895] weakref documentation contains cautions about dictionary mutation problems that have been solved in the implementation

2020-06-10 Thread Antoine Pitrou
Change by Antoine Pitrou : -- pull_requests: +19989 pull_request: https://github.com/python/cpython/pull/20793 ___ Python tracker <https://bugs.python.org/issue40

[issue40895] weakref documentation contains cautions about dictionary mutation problems that have been solved in the implementation

2020-06-10 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +pitrou nosy_count: 3.0 -> 4.0 pull_requests: +19988 pull_request: https://github.com/python/cpython/pull/20792 ___ Python tracker <https://bugs.python.org/issu

[issue22079] Ensure in PyType_Ready() that base class of static type is static

2020-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: The workaround that Cython had to added for this (temporarily enable Py_TPFLAGS_HEAPTYPE when calling PyType_Ready()) is fragile. It would be nice to rethink the approach here, or disable the check altogether. (or perhaps, expose another C API function

[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-05-01 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.or

[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-05-01 Thread Antoine Pitrou
Change by Antoine Pitrou : -- pull_requests: +19162 pull_request: https://github.com/python/cpython/pull/19844 ___ Python tracker <https://bugs.python.org/issue39

[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-05-01 Thread Antoine Pitrou
Change by Antoine Pitrou : -- pull_requests: +19161 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19843 ___ Python tracker <https://bugs.python.org/issu

[issue32494] Use gdbm_count if possible

2020-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 8727664557cd44dcd00612ccba816942e8f885ab by Dong-hee Na in branch 'master': bpo-32494: Use gdbm_count for dbm_length if possible (GH-19814) https://github.com/python/cpython/commit/8727664557cd44dcd00612ccba816942e8f885ab -- nosy

[issue32494] Use gdbm_count if possible

2020-05-01 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40399] IO streams locking can be broken after fork() with threads

2020-04-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: The TextIOWrapper uses an underlying BufferedWriter, which is thread-safe (and therefore has an internal lock). -- ___ Python tracker <https://bugs.python.org/issue40

[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-04-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: I looked at the change and it seemed ok to me. Perhaps Thomas can give it a look too. -- assignee: aeros -> vstinner ___ Python tracker <https://bugs.python.org/issu

[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: With the same traceback and error message? -- ___ Python tracker <https://bugs.python.org/issue39995> ___ ___ Python-bug

[issue6721] Locks in the standard library should be sanitized on fork

2020-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Related issue: https://bugs.python.org/issue40399 """ IO streams locking can be broken after fork() with threads """ -- ___ Python tracker <

[issue40399] IO streams locking can be broken after fork() with threads

2020-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, as the documentation states, `QueueListener.start` """starts up a background thread to monitor the queue for LogRecords to process""" :-) -- ___ Python tracker <h

[issue40399] IO streams locking can be broken after fork() with threads

2020-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: I can reproduce on Ubuntu 18.04 with git master. Here is a better example which clearly shows the issue: https://gist.github.com/pitrou/d9784d5ec679059cd02fce4b38ea2fa6 After a few runs, you'll see that the child Process hangs when trying to flush

[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: How about the following (untested): diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py index 8e9b69a8f0..c0c2eb3032 100644 --- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -66,23 +66,29

[issue40061] Possible refleak in _asynciomodule.c future_add_done_callback()

2020-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: You're right that a Py_DECREF is missing there. However, it seems unlikely that this is triggering the test failure, because `PyList_New(1)` will practically never fail in normal conditions (and even making it deliberately fail would be quite difficult

[issue40402] Race condition in multiprocessing/connection.py: broken handle

2020-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't know if a try..except block is the best solution, but feel free to submit a PR and we can iterate on that :-) -- stage: -> needs patch ___ Python tracker <https://bugs.python.org/issu

[issue37790] subprocess.Popen() is extremely slow (with close_fds=True which is the default) on Illumos

2020-04-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think we would accept a PR since it would probably be trivial, but someone has to submit it :-) -- ___ Python tracker <https://bugs.python.org/issue37

[issue40346] Add random.BaseRandom to ease implementation of subclasses

2020-04-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: If I believe what Victor wrote about: """ The implementation of random.Random, random.SystemRandom and random.Random subclasses are not affected by this change. """ then I don't understand how the API is changed. IIUC, users su

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: The current behaviour is by design. I would not mind adding an option to control it, though. If you are new to Python development and want to submit a patch or PR, I recommend reading the Developer's Guide: https://devguide.python.org

[issue40346] Redesign random.Random class inheritance

2020-04-20 Thread Antoine Pitrou
Change by Antoine Pitrou : -- keywords: +patch nosy: +pitrou nosy_count: 1.0 -> 2.0 pull_requests: +18957 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19539 ___ Python tracker <https://bugs.python.org/i

[issue40120] Undefined C behavior going beyond end of struct via a [1] arrays.

2020-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Another possibility yet would be: typedef struct { PyObject_VAR_HEAD Py_hash_t ob_shash; char ob_sval; } PyBytesObject; #define PyBytes_AS_STRING(op) (assert(PyBytes_Check(op)), \ &(((PyBytesObject *)(op))->

[issue40330] ShareableList size guard incorrect for str data

2020-04-20 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.7 ___ Python tracker <https://bugs.python.or

[issue40330] ShareableList size guard incorrect for str data

2020-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 887ff8e37e238fbce18c647e588283904f38ab24 by Antoine Pitrou in branch '3.8': [3.8] bpo-40330: Fix utf-8 size check in ShareableList (GH-19606) (GH-19625) https://github.com/python/cpython/commit/887ff8e37e238fbce18c647e588283904f38ab24

[issue40330] ShareableList size guard incorrect for str data

2020-04-20 Thread Antoine Pitrou
Change by Antoine Pitrou : -- pull_requests: +18953 pull_request: https://github.com/python/cpython/pull/19625 ___ Python tracker <https://bugs.python.org/issue40

[issue40255] Fixing Copy on Writes from reference counting

2020-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Wow. I see, thank you. -- ___ Python tracker <https://bugs.python.org/issue40255> ___ ___ Python-bugs-list mailing list Unsub

[issue40255] Fixing Copy on Writes from reference counting

2020-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: > We also have the real world app that is Instagram. I don't think Instagram is a single app. What is Python used for at Instagram? -- ___ Python tracker <https://bugs.python.org/issu

[issue40255] Fixing Copy on Writes from reference counting

2020-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Benchmarking already showed that the branching version is faster. But micro-benchmarks may tell you things which are not true in the real-world (for example an easily-predicted branch). -- ___ Python trac

[issue40148] Add PurePath.with_stem()

2020-04-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40148] Add PurePath.with_stem()

2020-04-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 8aea4b3605059e243f1827d9328d6fc8d698c0a7 by Tim Hoffmann in branch 'master': bpo-40148: Add PurePath.with_stem() (GH-19295) https://github.com/python/cpython/commit/8aea4b3605059e243f1827d9328d6fc8d698c0a7

[issue40330] ShareableList size guard incorrect for str data

2020-04-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- keywords: +patch pull_requests: +18940 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19606 ___ Python tracker <https://bugs.python.org/issu

[issue38891] ShareableList read and write access is O(N), should be O(1)

2020-04-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38891] ShareableList read and write access is O(N), should be O(1)

2020-04-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset c8f1715283ec51822fb37a702bf253cbac1af276 by Thomas Krennwallner in branch 'master': bpo-38891: avoid quadratic item access performance of ShareableList (GH-18996) https://github.com/python/cpython/commit/c8f1715283ec51822fb37a702bf253cbac1af276

[issue40330] ShareableList size guard incorrect for str data

2020-04-19 Thread Antoine Pitrou
New submission from Antoine Pitrou : The size check is done before encoding to utf-8... -- ___ Python tracker <https://bugs.python.org/issue40330> ___ ___ Pytho

[issue40330] ShareableList size guard incorrect for str data

2020-04-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- assignee: pitrou components: Library (Lib) nosy: pitrou priority: normal severity: normal stage: needs patch status: open title: ShareableList size guard incorrect for str data type: behavior versions: Python 3.7, Python 3.8, Python 3.9

[issue39207] concurrent.futures.ProcessPoolExecutor does not properly reap jobs and spawns too many workers

2020-04-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39285] PurePath.match indicates case-sensitive nature and presents a case-insensitive example

2020-04-19 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38891] ShareableList read and write access is O(N), should be O(1)

2020-04-18 Thread Antoine Pitrou
Change by Antoine Pitrou : -- versions: +Python 3.9 -Python 3.8 ___ Python tracker <https://bugs.python.org/issue38891> ___ ___ Python-bugs-list mailin

[issue35306] OSError [WinError 123] when testing if pathlib.Path('*') (asterisks) exists

2020-04-17 Thread Antoine Pitrou
Change by Antoine Pitrou : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue35306> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33898] pathlib issues with Windows device paths

2020-04-17 Thread Antoine Pitrou
Change by Antoine Pitrou : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue33898> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39894] `pathlib.Path.samefile()` calls `os.stat()` without using accessor

2020-04-17 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement ___ Python tracker <https://bugs.python

[issue39894] `pathlib.Path.samefile()` calls `os.stat()` without using accessor

2020-04-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 5b1d9184bb0e34391637c06bc7651fb6de8a6240 by Barney Gale in branch 'master': bpo-39894: Route calls from pathlib.Path.samefile() to os.stat() via the path accessor (GH-18836) https://github.com/python/cpython/commit

[issue39897] `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses

2020-04-17 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement ___ Python tracker <https://bugs.python

[issue39897] `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses

2020-04-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset c746c4f353510a17683a49ed7f90ffaae664ff7b by Barney Gale in branch 'master': bpo-39897: Remove needless `Path(self.parent)` call, which makes `is_mount()` misbehave in `Path` subclasses. (GH-18839) https://github.com/python/cpython/commit

[issue40282] random.getrandbits(0) should succeed

2020-04-17 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40282] random.getrandbits(0) should succeed

2020-04-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 75a3378810bab03949ad9f653f78d933bdf3879c by Antoine Pitrou in branch 'master': bpo-40282: Allow random.getrandbits(0) (GH-19539) https://github.com/python/cpython/commit/75a3378810bab03949ad9f653f78d933bdf3879c

[issue39901] `pathlib.Path.owner()` and `group()` use `pwd` and `grp` modules directly

2020-04-17 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: -pitrou resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement ___ Python tracker <https://bugs.python

[issue39901] `pathlib.Path.owner()` and `group()` use `pwd` and `grp` modules directly

2020-04-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 22386bb4ef740ee92d34c87b8cb90d681423a853 by Barney Gale in branch 'master': bpo-39901: Move `pathlib.Path.owner()` and `group()` implementations into the path accessor. (GH-18844) https://github.com/python/cpython/commit

[issue40281] Add pathlib.PurePath.as_uri()

2020-04-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hmm, it looks like I lost my head from 10 years ago :-S Sorry for the noise, everyone. -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue40302] Add _Py_bswap32() function to pyport.h

2020-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Isn't pyport.h a public header? IMHO you should put in a private header and make it an inline function there. Here is for example what we do in Arrow: https://github.com/apache/arrow/blob/master/cpp/src/arrow/util/bit_util.h#L48 -- nosy: +pitrou

[issue40255] Fixing Copy on Writes from reference counting

2020-04-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Steve is right. -- ___ Python tracker <https://bugs.python.org/issue40255> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40255] Fixing Copy on Writes from reference counting

2020-04-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'll note that this "extremely common" model can break as soon as you have hidden worker threads somewhere (this can happen in a third-party library). For example, the libhdfs library is not

[issue40282] random.getrandbits(0) should succeed

2020-04-15 Thread Antoine Pitrou
Change by Antoine Pitrou : -- keywords: +patch pull_requests: +18887 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19539 ___ Python tracker <https://bugs.python.org/issu

[issue40286] Add getrandbytes() method to random.Random

2020-04-15 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue40286> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40282] random.getrandbits(0) should succeed

2020-04-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: I agree I don't *need* it per se. However, I suspect that for non-exports it would be easier than `getrandbits(nbytes * 8).to_bytes(nbytes, 'endian')`. As for `secrets.token_bytes()`, it's not really adequate for regular pseudo-random data generation when

[issue40282] random.getrandbits(0) should succeed

2020-04-14 Thread Antoine Pitrou
Change by Antoine Pitrou : -- components: +Library (Lib) ___ Python tracker <https://bugs.python.org/issue40282> ___ ___ Python-bugs-list mailing list Unsub

[issue40282] random.getrandbits(0) should succeed

2020-04-14 Thread Antoine Pitrou
Change by Antoine Pitrou : -- stage: -> needs patch ___ Python tracker <https://bugs.python.org/issue40282> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue40282] random.getrandbits(0) should succeed

2020-04-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: About a hypothetical getrandbytes(), probably 90% of my uses of getrandbits() have been to generate random bytestrings. -- ___ Python tracker <https://bugs.python.org/issue40

[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2020-04-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think there's a misunderstanding: "wait_at_exit" will make the *executor* forget about the threads, but Python itself still knows about them, and it waits for them to end at interpreter shutdown. These threads were daemon threads in 3.8, so

[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2020-04-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't think there's much ThreadPoolExecutor can do. If you drop the references to the threads, they still exist and they still be waited upon at interpreter exit. The solution is for you to avoid having hanging threads. In the particular case of TCP

[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2020-04-14 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +aeros ___ Python tracker <https://bugs.python.org/issue36780> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40282] random.getrandbits(0) should succeed

2020-04-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think you know the answer to your question ;-) -- ___ Python tracker <https://bugs.python.org/issue40282> ___ ___ Python-bug

[issue40282] random.getrandbits(0) should succeed

2020-04-14 Thread Antoine Pitrou
New submission from Antoine Pitrou : When creating variable-sized random binary strings with random.getrandbits(), you currently have to special case when the number of bytes is 0, because otherwise getrandbits() raises: ValueError: number of bits must be greater than zero It seems like

[issue40255] Fixing Copy on Writes from reference counting

2020-04-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: As a separate discussion, I would be interested to know whether the original use case (Eddie's) could be satisfied differently. It probably doesn't belong to this issue, though. (Eddie, if you want to discuss this, feel free to e-mail me privately. I think

[issue40255] Fixing Copy on Writes from reference counting

2020-04-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I run the pyperformance test suite with PGO + LTO + full cpu isolation in the > speed.python.org machine and these were the results: Be mindful that synthetic benchmarks are probably a gentle case for branch prediction. Real-world perfo

[issue40281] Add pathlib.PurePath.as_uri()

2020-04-14 Thread Antoine Pitrou
New submission from Antoine Pitrou : "file" scheme URIs are normalized: https://tools.ietf.org/html/rfc8089 Therefore it would be possible to provide a PurePath method that returns a "file" scheme URI corresponding to the given path. -- components: Library (Lib) m

[issue40281] Add pathlib.PurePath.as_uri()

2020-04-14 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +barneygale ___ Python tracker <https://bugs.python.org/issue40281> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39682] pathlib.Path objects can be used as context managers

2020-04-01 Thread Antoine Pitrou
Change by Antoine Pitrou : -- versions: +Python 3.9 -Python 3.8 ___ Python tracker <https://bugs.python.org/issue39682> ___ ___ Python-bugs-list mailin

[issue39682] pathlib.Path objects can be used as context managers

2020-04-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 2e6d8b0ccdb6e0d9e98a9a7f9c9edfdf1311 by Barney Gale in branch 'master': bpo-39682: make `pathlib.Path` immutable by removing (undocumented) support for "closing" a path by using it as a context manager (GH-18846) https://github.

[issue39682] pathlib.Path objects can be used as context managers

2020-04-01 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python

[issue39812] Avoid daemon threads in concurrent.futures

2020-03-27 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39812] Avoid daemon threads in concurrent.futures

2020-03-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset b61b818d916942aad1f8f3e33181801c4a1ed14b by Kyle Stanley in branch 'master': bpo-39812: Remove daemon threads in concurrent.futures (GH-19149) https://github.com/python/cpython/commit/b61b818d916942aad1f8f3e33181801c4a1ed14b

[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-08 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +pitrou ___ Python tracker <https://bugs.python.org/issue39850> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-08 Thread Antoine Pitrou
Change by Antoine Pitrou : -- stage: -> needs patch type: crash -> behavior versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker <https://bugs.python.org/i

[issue39682] pathlib.Path objects can be used as context managers

2020-03-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Note you could simply remove the "closed" flag and the context manager live. That way, you don't have to deprecate anything. -- ___ Python tracker <https://bugs.python.o

  1   2   3   4   5   6   7   8   9   10   >