[issue32604] [subinterpreters] PEP 554 implementation: add interpreters module

2020-06-16 Thread Eric Snow
Eric Snow added the comment: @Pablo, yeah, I'll try to take a look this week. Are these new failures? Keep in mind that these tests can sometimes expose existing bugs in our runtime (as we fix runtime issues elsewhere) rather than regressions, though that isn't necessarily the case here

[issue32604] [subinterpreters] PEP 554 implementation: add interpreters module

2020-06-16 Thread Eric Snow
Eric Snow added the comment: New changeset 818f5b597ae93411cc44e404544247d436026a00 by Eric Snow in branch 'master': bpo-32604: Clean up test.support.interpreters. (gh-20926) https://github.com/python/cpython/commit/818f5b597ae93411cc44e404544247d436026a00

[issue32604] [subinterpreters] PEP 554 implementation: add interpreters module

2020-06-16 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +20105 pull_request: https://github.com/python/cpython/pull/20926 ___ Python tracker <https://bugs.python.org/issue32

[issue39075] types.SimpleNamespace should preserve attribute ordering (?)

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

[issue40572] Support basic asynchronous cross-interpreter operations.

2020-05-08 Thread Eric Snow
Change by Eric Snow : -- keywords: +patch pull_requests: +19323 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/20012 ___ Python tracker <https://bugs.python.org/issu

[issue40572] Support basic asynchronous cross-interpreter operations.

2020-05-08 Thread Eric Snow
New submission from Eric Snow : (This is a continuation of the work from bpo-33608. That issue ended up with a lot of baggage and clutter (due to problems that have since been resolved), so we closed it. This issue is where we're picking it up fresh.) When two interpreters are cooperating

[issue32604] Expose the subinterpreters C-API in Python for testing use.

2020-05-07 Thread Eric Snow
Eric Snow added the comment: New changeset a1d9e0accd33af1d8e90fc48b34c13d7b07dcf57 by Eric Snow in branch 'master': bpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-19768) https://github.com/python/cpython/commit/a1d9e0accd33af1d8e90fc48b34c13d7b07dcf57

[issue40533] Subinterpreters: don't share Python objects between interpreters

2020-05-06 Thread Eric Snow
Eric Snow added the comment: Yep, before per-interpreter GIL is official we must get to the point where *no* PyObject objects are shared. Making PyObject.ob_refcnt atomic until then (only as part of the experiment) should be fine. -- ___ Python

[issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round'

2020-05-06 Thread Eric Snow
Eric Snow added the comment: FYI, with the following additions in Lib/test/test_datetime.py... before = set(sys.modules) try: pure_tests = import_fresh_module(TESTS, fresh=['datetime', '_strptime'], blocked=['_datetime']) _pure = set

[issue40514] Add --experimental-isolated-subinterpreters build option

2020-05-05 Thread Eric Snow
Eric Snow added the comment: It would probably make sense to remove the build option in the 3.9 release. We can leave it in master, but remove it in the 3.9 branch once it has been created. -- ___ Python tracker <https://bugs.python.

[issue40010] Inefficient signal handling in multithreaded applications

2020-05-05 Thread Eric Snow
Eric Snow added the comment: Good catch on this, Victor. Thanks for doing it. -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue40

[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread Eric Snow
Eric Snow added the comment: If this issue covers the GIL (which it seems to) then I'd expect _PyRuntimeState.gilstate to be handled here too. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread Eric Snow
Eric Snow added the comment: >From a user perspective, does it make sense to have a different >recursion_limit per interpreter? I don't see a problem with it. However, >does it make sense to also keep a global value that we default to when a >per-interpreter value is not s

[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread Eric Snow
Eric Snow added the comment: FWIW, I think it would make sense to keep "signals_pending" under _PyRuntimeState rather than moving it to PyInterpreterState. Signals are only handled by the main interpreter (in its main thread). Even though "signals_pending" is useful to

[issue38880] Subinterpreters: List interpreters associated with a channel end

2020-05-01 Thread Eric Snow
Eric Snow added the comment: Thanks again, Lewis! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40390] Implement _xxsubinterpreters.channel_send_wait().

2020-05-01 Thread Eric Snow
Eric Snow added the comment: Thanks for working on this, Ben! FWIW, I've put up a separate PR to demonstrate how I was thinking we would solve this: https://github.com/python/cpython/pull/19829. -- ___ Python tracker <https://bugs.python.

[issue40350] modulefinder chokes on numpy - dereferencing None in spec.loader

2020-05-01 Thread Eric Snow
Eric Snow added the comment: Ah, namespace packages. :) Yeah, the code is not taking the "spec.loader is None" case into account. I expect the fix would be to add handling of that case a few lines up in the code, right after handling BuiltinImporter and FrozenImporter. O

[issue40350] modulefinder chokes on numpy - dereferencing None in spec.loader

2020-05-01 Thread Eric Snow
Change by Eric Snow : -- stage: -> test needed versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue40350> ___ ___ Python-bugs-list mai

[issue40417] PyImport_ReloadModule emits deprecation warning

2020-05-01 Thread Eric Snow
Eric Snow added the comment: Did you have a need for this to be fixed in 3.8 or earlier? This seems reasonably and simple enough to backport. I suppose someone could be relying on an implicit import of the "imp" module, but that seems highly unlikely and susp

[issue40417] PyImport_ReloadModule emits deprecation warning

2020-05-01 Thread Eric Snow
Eric Snow added the comment: Yeah, that looks like an oversight. I've approved your PR. Thanks! -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue40

[issue40453] Add PyConfig._isolated_interpreter: isolated subinterpreters

2020-05-01 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue40453> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32604] Expose the subinterpreters C-API in Python for testing use.

2020-04-30 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +19149 pull_request: https://github.com/python/cpython/pull/19829 ___ Python tracker <https://bugs.python.org/issue32

[issue32604] Expose the subinterpreters C-API in Python for testing use.

2020-04-28 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +19090 pull_request: https://github.com/python/cpython/pull/19770 ___ Python tracker <https://bugs.python.org/issue32

[issue40390] Implement _xxsubinterpreters.channel_send_wait().

2020-04-28 Thread Eric Snow
Eric Snow added the comment: Thanks, Ben. I'll take a look. -- components: +Library (Lib) -C API title: Implement a C API for channel_send_wait for subinterpreters. -> Implement _xxsubinterpreters.channel_send_wait(). ___ Python tracker <

[issue32604] Expose the subinterpreters C-API in Python for testing use.

2020-04-28 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +19088 pull_request: https://github.com/python/cpython/pull/19768 ___ Python tracker <https://bugs.python.org/issue32

[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-04-22 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue40360> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37266] Daemon threads must be forbidden in subinterpreters

2020-04-08 Thread Eric Snow
Eric Snow added the comment: I've opened bpo-40234 to address backward incompatibility from this change (e.g. affecting mod-wsgi). -- ___ Python tracker <https://bugs.python.org/issue37

[issue40234] Disallow daemon threads in subinterpreters optionally.

2020-04-08 Thread Eric Snow
New submission from Eric Snow : In bpo-37266 we strictly disallowed creation of daemon threads in subinterpreters. However, this is backward-incompatible for existing users of the subinterpreter C-API (such as mod-wsgi). Rather than reverting that change I suggest that we make it opt

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2020-04-08 Thread Eric Snow
Eric Snow added the comment: > I close this issue with a complex history. > > If someone wants to continue to work on this topic, please open an issue with > a very clear description of what should be done and how it is supposed to be > used. Yeah, there is more to do. I'

[issue40077] Convert static types to PyType_FromSpec()

2020-04-08 Thread Eric Snow
Eric Snow added the comment: > Wouldn't having less static types slow down startup time? FWIW, I've been considering an approach where the main interpreter keeps using static types but subinterpreters use heap types. If it isn't too much effort (or too hacky) then it might be a suffici

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2020-03-27 Thread Eric Snow
Eric Snow added the comment: FYI, in bpo-39984 Victor moved pending calls to PyInterpreterState, which was part of my reverted change. However, there are a few other pieces of that change that need to be applied before this issue is resolved. I'm not sure when I'll get

[issue39984] Move pending calls from _PyRuntime to PyInterpreterState

2020-03-27 Thread Eric Snow
Eric Snow added the comment: Awesome! Thanks for doing this, Victor. I'll take a look when I can and adjust the changes for bpo-33608. If you'll recall, I made a similar change as part of the solution for that issue, which we later reverted due to problems we discovered with daemon

[issue39829] __len__ called twice in the list() constructor

2020-03-09 Thread Eric Snow
Eric Snow added the comment: I'm not opposed. :) I just don't want to impose on your time. -- assignee: -> pablogsal resolution: not a bug -> stage: resolved -> status: closed -> open ___ Python tracker <https://bugs.python

[issue39829] __len__ called twice in the list() constructor

2020-03-09 Thread Eric Snow
Eric Snow added the comment: FWIW, I encouraged Kim to file this. Thanks Kim! While it isn't part of any specification, it is an unexpected change in behavior that led to some test failures. So I figured it would be worth bringing up. :) I did find it surprising that we were not caching

[issue37497] Add inspect.Signature.from_text().

2020-03-06 Thread Eric Snow
Eric Snow added the comment: Honestly, I don't recall exactly the concrete use case for which I opened this. :) I *think* it was related to applying a more restrictive signature onto an existing function (e.g. with a decorator). -- ___ Python

[issue17422] language reference should specify restrictions on class namespace

2020-03-06 Thread Eric Snow
Eric Snow added the comment: Thanks for fixing that, Caleb! FWIW, I've opened a separate issue (#39879) for adding a note in the language reference about dict ordering. Sorry for the confusion. -- resolution: -> fixed stage: patch review -> resolved status: open -&g

[issue39879] Update language reference to specify that dict is insertion-ordered.

2020-03-06 Thread Eric Snow
New submission from Eric Snow : As of 3.7 [1], dict is guaranteed to preserve insertion order: the insertion-order preservation nature of dict objects has been declared to be an official part of the Python language spec. However, at least one key part of the language reference [2

[issue33234] Improve list() pre-sizing for inputs with known lengths

2020-03-02 Thread Eric Snow
Eric Snow added the comment: Possible backward incompatibility caused by this issue: issue39829 -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue33

[issue17422] language reference should specify restrictions on class namespace

2020-02-27 Thread Eric Snow
Eric Snow added the comment: Thanks for working on this. Sorry I didn't get a chance to see your PR sooner. There was one small thing that needs to be changed back, as I implied in my comment on the PR [1]. Please undo the change in the text from "ordered mapping"

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-02-07 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue1635741> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2020-02-04 Thread Eric Snow
Eric Snow added the comment: > This is pretty much one of the two approaches I have been considering. The other approach is to leave the current static singletons alone and only use them for the main interpreter. Each subinterpreter would get its own copy, created when that interpre

[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2020-02-04 Thread Eric Snow
Eric Snow added the comment: On Sun, Feb 2, 2020 at 3:32 PM Raymond Hettinger wrote: > Random idea (not carefully thought-out): Would it be simpler to have these > objects just > ignore their refcount by having dealloc() be a null operation or having it > set the ref

[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2020-02-04 Thread Eric Snow
Eric Snow added the comment: On Sun, Feb 2, 2020 at 2:53 PM Raymond Hettinger wrote: > Is the sub-interpreter PEP approved? PEP 554 is not approved yet (and certainly is not guaranteed, though I'm hopeful). However, that PEP is exclusively about exposing subinterpreters in the std

[issue37224] test__xxsubinterpreters fails randomly

2020-02-04 Thread Eric Snow
Eric Snow added the comment: Thanks, Kyle. That helps at least a little. :) -- ___ Python tracker <https://bugs.python.org/issue37224> ___ ___ Python-bug

[issue39516] ++ does not throw a SyntaxError

2020-02-04 Thread Eric Snow
Eric Snow added the comment: FWIW, this is the sort of thing that is usually best suited to be reported by linters, not the Python runtime. -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue39

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread Eric Snow
Eric Snow added the comment: FTR: As Martin noted in #19514, there isn't any performance difference for statics, whether local or global. For static locals the compiler (at least on linux) generates symbols named as ".<#>" and they are treated as global. One key d

[issue15600] expose the finder details used by the FileFinder path hook

2020-01-29 Thread Eric Snow
Eric Snow added the comment: I have many other things higher on my todo list. :) I'll re-open this issue if I get back to the project that motivated this (i.e. "source translation via import hooks for filename suffix"). -- resolution: -> out of date stage: patch revie

[issue38076] Make struct module PEP-384 compatible

2020-01-24 Thread Eric Snow
Eric Snow added the comment: > there's still probably some underlying issue in multiprocessing. Whoa, I've never heard that before! -- ___ Python tracker <https://bugs.python.org/issu

[issue39395] The os module should unset() environment variable at exit

2020-01-24 Thread Eric Snow
Eric Snow added the comment: FTR, #39376 is related (avoid the process-global env vars in the first place). -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue39

[issue39443] Inhomogeneous behaviour for descriptors in between the class-instance and metaclass-class pairs

2020-01-24 Thread Eric Snow
Eric Snow added the comment: @Raymond, What do you think about adding a helpful note or two in the docs? -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue39

[issue39443] Inhomogeneous behaviour for descriptors in between the class-instance and metaclass-class pairs

2020-01-24 Thread Eric Snow
Eric Snow added the comment: First of all, thanks for asking about this. Everything is working as expected. Let's look at why. First, be sure the behavior of descriptors is clear: the descriptor protocol is only triggered by "dotted access" on an object ("obj.attr&qu

[issue39376] Avoid modifying the process global environment (not thread safe)

2020-01-17 Thread Eric Snow
Eric Snow added the comment: +1 This has impact on subinterpreters once they stop sharing the GIL. (It's already on my list of global resources that need better protection.) -- nosy: +eric.snow ___ Python tracker <https://bugs.python.

[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2020-01-17 Thread Eric Snow
Eric Snow added the comment: Thanks, Victor! -- ___ Python tracker <https://bugs.python.org/issue36710> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37224] test__xxsubinterpreters fails randomly

2020-01-17 Thread Eric Snow
Eric Snow added the comment: On Wed, Jan 15, 2020 at 12:20 AM Kyle Stanley wrote: > As can be seen from the results above, the interpreter is not even running in > the first place before > it's destroyed, so of course destroy() won't raise an RuntimeError. I think >

[issue39075] types.SimpleNamespace should preserve attribute ordering (?)

2019-12-27 Thread Eric Snow
Eric Snow added the comment: > IMHO, dropping the sort should be a default behavior. If some user need > this feature, maybe we could supply a param to open the sort function or not? Consider opening a separate issue (or start a thread on python-ideas) about adding a more sophist

[issue39076] Use types.SimpleNamespace for argparse.Namespace

2019-12-27 Thread Eric Snow
Eric Snow added the comment: Anyway, this probably isn't a discussion worth extending much further. I don't think it's important enough. :) So if you have reservations about this then feel free to close the issue. -- ___ Python tracker <ht

[issue39076] Use types.SimpleNamespace for argparse.Namespace

2019-12-27 Thread Eric Snow
Eric Snow added the comment: Sorry if there was any confusion. I didn't mean to suggest we get rid of argparse.Namespace (in favor of SimpleNamespace). Rather, the former would subclass the latter. > * types.SimpleNamespace() sorts attributes, so this would get in the way of > issue

[issue26219] implement per-opcode cache in ceval

2019-12-27 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue26219> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37340] remove free_list for bound method objects

2019-12-23 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue37340> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: So I see 3 things to address here: 1. Python daemon threads 2. Python threads created in atexit handlers 3. non-Python threads accessing the C-API Possible solutions (starting point for discussion): 1. stop them at the point we stop waiting for non-daemon

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: To put it another way: (from issue33608#msg358748) > The docs [1] aren't super clear about it, but there are some fundamental > assumptions we make about runtime finalization: > > * no use of the C-API while Py_FinalizeEx() is executing (except

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Analysis by @pconnell: * https://bugs.python.org/issue33608#msg357169 * https://bugs.python.org/issue33608#msg357170 * https://bugs.python.org/issue33608#msg357179 tl;dr daemon threads and external C-API access during/after runtime finalization are causing

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Thanks for the detailed analysis, Phil. I think the results are pretty conclusive: daemon threads are the worst. :) But seriously, thanks. As you demonstrated, it isn't just Python "daemon" threads that cause the problem. It is essentially any exter

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue36476> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Problems with lingering threads during/after runtime finalization continue to be a problem. I'm going to use this issue as the focal point for efforts to resolve this. Related issues: * #36479 "Exit threads when interpreter is finalizing rather than ru

[issue24770] Py_Finalize() doesn't stop daemon threads

2019-12-20 Thread Eric Snow
Eric Snow added the comment: I'm closing this in favor of #36476 "Runtime finalization assumes all other threads have exited." -- nosy: +eric.snow resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Runtime finalization assumes

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- stage: -> needs patch versions: +Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue36476> ___ ___ Python-

[issue36476] Runtime finalization assumes all other threads have exited.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Adding to the list: * any OS threads created by an extension module or embedding application -- ___ Python tracker <https://bugs.python.org/issue36

[issue13077] Unclear behavior of daemon threads on main thread exit

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue13077> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34296] Speed up python startup by pre-warming the vm

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue34296> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31517] MainThread association logic is fragile

2019-12-20 Thread Eric Snow
Eric Snow added the comment: probably a duplicate: issue #39042 "Use the runtime's main thread ID in the threading module." -- ___ Python tracker <https://bugs.python.o

[issue14073] allow per-thread atexit()

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue14073> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28812] Deadlock between GIL and pystate head_mutex.

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue28812> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1332869] Fatal Python error: Interpreter not initialized

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue1332869> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1596321] KeyError at exit after 'import threading' in other thread

2019-12-20 Thread Eric Snow
Eric Snow added the comment: related: issue #39042 "Use the runtime's main thread ID in the threading module." -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org

[issue38918] Add __module__ entry for function type in inspect docs table.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Thanks for working on this, @parthsharma2! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39042] Use the runtime's main thread ID in the threading module.

2019-12-20 Thread Eric Snow
Eric Snow added the comment: I don't see a reason not to consider this is a regression. The only problem with the fix would be for any users that rely on the inaccurate reporting of the threading module. Considering that possibly includes only some embedders (and folks using _thread module

[issue39110] It seems that list() changes the value of the parameter

2019-12-20 Thread Eric Snow
Eric Snow added the comment: Your problem is with UserList. This is from the implementation: def __getitem__(self, i): if isinstance(i, slice): return self.__class__(self.data[i]) else: return self.data[i] So each slice is creating a new Tree

[issue38904] "signal only works in main thread" in main thread

2019-12-17 Thread Eric Snow
Eric Snow added the comment: So resolving issue39042 would be enough, particularly if we backported the change to 3.8? -- ___ Python tracker <https://bugs.python.org/issue38

[issue39042] Use the runtime's main thread ID in the threading module.

2019-12-17 Thread Eric Snow
Eric Snow added the comment: Hmm, I wonder if this should be considered a regression in 3.8. As demonstrated in issue38904, the following code changed behavior as of 3.8, under certain conditions: import signal import threading def int_handler(): ... if threading.current_thread

[issue39058] argparse should preserve argument ordering in Namespace

2019-12-17 Thread Eric Snow
Eric Snow added the comment: FWIW, I've also opened issue #39076 about subclassing types.SimpleNamespace. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39076] Use types.SimpleNamespace for argparse.Namespace

2019-12-17 Thread Eric Snow
New submission from Eric Snow : types.SimpleNamespace does pretty much exactly the same thing as argparse.Namespace. We should have the latter subclass the former. I expect the only reason that wasn't done before is because SimpleNamespace is newer. The only thing argparse.Namespace does

[issue39075] types.SimpleNamespace should preserve attribute ordering (?)

2019-12-17 Thread Eric Snow
Change by Eric Snow : -- stage: -> needs patch ___ Python tracker <https://bugs.python.org/issue39075> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39058] argparse should preserve argument ordering in Namespace

2019-12-17 Thread Eric Snow
Eric Snow added the comment: > Currently, Namespace() objects sort the attributes in the __repr__. This is > annoying because argument > order matters and because everywhere else in the module we preserve order > (i.e. users see help in the > order that arguments are

[issue39075] types.SimpleNamespace should preserve attribute ordering (?)

2019-12-17 Thread Eric Snow
New submission from Eric Snow : types.SimpleNamespace was added in 3.3 (for use in sys.implementation; see PEP 421), which predates the change to preserving insertion order in dict. At the time we chose to sort the attributes in the repr, both for ease of reading and for a consistent output

[issue37224] test__xxsubinterpreters fails randomly

2019-12-17 Thread Eric Snow
Eric Snow added the comment: On Fri, Dec 13, 2019 at 8:08 PM Kyle Stanley wrote: > Yeah, I named it "_PyInterpreterIsFinalizing" and it's within > Include/cpython. Definitely open > to suggestions on the name though, it's basically just a private getter for &

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-12-13 Thread Eric Snow
Eric Snow added the comment: I'm out of time and this deserves some careful discussion. I'll get to it next Friday (or sooner if possible). Sorry! -- ___ Python tracker <https://bugs.python.org/issue33

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-12-13 Thread Eric Snow
Eric Snow added the comment: Sorry for the delay, Phil. I'll try to take a look in the next couple of hours. -- ___ Python tracker <https://bugs.python.org/issue33

[issue38904] "signal only works in main thread" in main thread

2019-12-13 Thread Eric Snow
Eric Snow added the comment: Before 3.8, the "signal" module checked against the thread in which the module was initially loaded, treating that thread as the "main" thread. That same was true (and still is) for the "threading" module. The problem for bo

[issue39042] Use the runtime's main thread ID in the threading module.

2019-12-13 Thread Eric Snow
New submission from Eric Snow : The threading module has a "main_thread()" function that returns a Thread instance for the "main" thread. The main thread is the one running when the runtime is initialized and has a specific role in various parts of the runtime. Cur

[issue37224] test__xxsubinterpreters fails randomly

2019-12-13 Thread Eric Snow
Eric Snow added the comment: On Sat, Nov 30, 2019 at 9:23 PM Kyle Stanley wrote: > I have a few ideas that I'd like to test out for fixing this failure, and if > any of them produce positive results I'll report back. Sounds good. > Since the failures are still consistently occ

[issue37224] test__xxsubinterpreters fails randomly

2019-12-13 Thread Eric Snow
Eric Snow added the comment: On Sat, Nov 30, 2019 at 9:23 PM Kyle Stanley wrote: > Based on the above hint, I was able to make some progress on a potential > solution. Thanks Eric. That's great! > Instead of only checking "frame->f_executing", I changed "_is_

[issue37776] Test Py_Finalize() from a subinterpreter

2019-12-13 Thread Eric Snow
Eric Snow added the comment: On Fri, Dec 13, 2019 at 11:22 AM Lewis Gaul wrote: > So it looks like adding a specific testcase for this is likely to weed out an > actual issue here! +1 -- ___ Python tracker <https://bugs.python.org/i

[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-12-13 Thread Eric Snow
Eric Snow added the comment: Thanks for working on this. It really does have far-reaching benefits, not just for the subinterpreter stuff I'm interested in. :) -- ___ Python tracker <https://bugs.python.org/issue38

[issue36854] GC operates out of global runtime state.

2019-12-13 Thread Eric Snow
Eric Snow added the comment: On Wed, Dec 4, 2019 at 4:36 AM STINNER Victor wrote: > Each time I tried to fix a bug in the Python finalization, I introduced worse > bugs :-D :) > We cannot fix all bugs at once, we have to work incrementally. +1 > I like the idea of introducing

[issue38962] Reference leaks in subinterpreters

2019-12-13 Thread Eric Snow
Eric Snow added the comment: Thanks for all the work on this! -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue38962> ___ ___ Python-bug

[issue1021318] PyThreadState_Next not thread safe

2019-12-13 Thread Eric Snow
Eric Snow added the comment: On Wed, Dec 11, 2019 at 7:02 AM STINNER Victor wrote: > We may have to fix this API first, and clarify the scope of the different > locks. +1 -- ___ Python tracker <https://bugs.python.org/iss

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-11-26 Thread Eric Snow
Eric Snow added the comment: Exactly. :) I'd expect PEP 499 to specify changing __module__ of classes and functions from __main__ to the module name (__spec__.name). This aligns closely with the whole point of the PEP. :) As a bonus, it will simplify things for pickling (which doesn't

[issue38918] Add __module__ entry for function type in inspect docs table.

2019-11-26 Thread Eric Snow
New submission from Eric Snow : The docs page for the inspect module has a large table describing the special attributes of various important types. One entry for function attributes is missing: __module__. It should be added. Note that __module__ *is* included in the function attributes

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-11-25 Thread Eric Snow
Eric Snow added the comment: FWIW, I have some feedback on the PEP. (See msg357448.) Can we discuss here or should I open a mailing list thread? -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue36

  1   2   3   4   5   6   7   8   9   10   >