[issue36665] Dropping __main__ from sys.modules clears the REPL namespace

2019-04-18 Thread Nick Coghlan
Nick Coghlan added the comment: The ``sys`` import gets cleared as well (accidentally omitted from the previous comment): ``` >>> sys Traceback (most recent call last): File "", line 1, in NameError: name 'sys' is not defined ``` -- ___

[issue36665] Dropping __main__ from sys.modules clears the REPL namespace

2019-04-18 Thread Nick Coghlan
Nick Coghlan added the comment: Additional info showing the module getting reset back to the state of a freshly created module namespace: ``` >>> dir() ['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__'] >>> __builtins

[issue36665] Dropping __main__ from sys.modules clears the REPL namespace

2019-04-18 Thread Nick Coghlan
New submission from Nick Coghlan : While trying to create an example for a pickle bug discussion, I deliberately dropped `__main__` out of sys.modules, and the REPL session lost all of its runtime state. Simplified reproducer: ``` >>> import sys >>> mod = sy

[issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads

2019-04-17 Thread Nick Davies
Nick Davies added the comment: My preference would actually be number 3 because: 1: I agree that this isn't really a safe option because it could slow things down (possibly a lot) 2: I haven't found this to be rare in my situation but I am not sure how common my setup is. We have

[issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads

2019-04-16 Thread Nick Davies
Change by Nick Davies : -- type: -> behavior versions: +Python 3.6 ___ Python tracker <https://bugs.python.org/issue36607> ___ ___ Python-bugs-list mai

[issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads

2019-04-11 Thread Nick Davies
New submission from Nick Davies : This problem was identified in https://bugs.python.org/issue34970 but I think the fix might have been incorrect. The theory in issue34970 was that GC was causing the weakrefset for `all_tasks` to change during iteration. However Weakset provides

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Nick Coghlan
Nick Coghlan added the comment: I was going to note that the algorithm Anthony has pursued here is the same one we already use for the list constructor and list.extend(), but Inada-san already pointed that out :) While length_hint is allowed to be somewhat inaccurate, we do expect

[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2019-04-08 Thread Nick Coghlan
Nick Coghlan added the comment: Retitled the issue using the `--mainpath` spelling, as I wanted to link to it from the PEP 582 discussion, and that's my current favourite from the various ideas I've had since first filing the issue. (I decided I didn't like `--basepath` because we already

[issue14017] Make it easy to create a new TextIOWrapper based on an existing

2019-04-07 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, let's close this for now - swapping streams out has enough other problems with stale references to the original stream that using reconfigure() to update the existing stream in place is usually going to be the better option. -- resolution

[issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion

2019-04-07 Thread Nick Coghlan
Nick Coghlan added the comment: I'm inclined to leave 3.7 alone unless/until we get an actual bug report for the current behaviour - if an embedder finds that it just straight up doesn't work for them, then they can either resort to tinkering with the private APIs (since they won't change

[issue36053] pkgutil.walk_packages jumps out from given path if there is package with the same name in sys.path

2019-04-07 Thread Nick Coghlan
Nick Coghlan added the comment: Piotr: does it always jump out, or does it only jump out if the relevant module has already been imported? (The tests for walk_packages are relatively weak and never generate conflicting names, so it's entirely plausible that there are caching side effects

[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2019-04-07 Thread Nick Coghlan
Nick Coghlan added the comment: The recommended handling in the article that Serhiy mentions is to strip the leading zeroes, which the ipaddress module will still do - it's only being made more tolerant on input. That means it will become usable as a prefilter step (pass string

[issue25160] Stop using deprecated imp module; imp should now emit a real DeprecationWarning

2019-04-07 Thread Nick Coghlan
Nick Coghlan added the comment: Oops, this covers more than just modulefinder - reopening until the other remaining uses of the imp module have been removed. -- resolution: fixed -> stage: resolved -> needs patch status: closed -> open _

[issue25160] Stop using deprecated imp module; imp should now emit a real DeprecationWarning

2019-04-07 Thread Nick Coghlan
Nick Coghlan added the comment: Fixed for Python 3.8 via the patch for #35936. -- nosy: +ncoghlan resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.6 ___ Python tracke

[issue35376] modulefinder skips nested modules with same name as top-level bad module

2019-04-07 Thread Nick Coghlan
Nick Coghlan added the comment: Fixed for Python 3.8 via the patch for #35936. We won't be backporting that patch as it also migrates modulefinder from the deprecated imp API to the supported importlib one, and is hence considered overly intrusive for a bug fix release

[issue17396] modulefinder fails if module contains syntax error

2019-04-07 Thread Nick Coghlan
Nick Coghlan added the comment: Fixed for Python 3.8 via the patch for #35936. We won't be backporting that patch as it also migrates modulefinder from the deprecated imp API to support importlib one, and is hence considered overly intrusive for a bug fix release. -- resolution

[issue35936] Give modulefinder some much-needed updates.

2019-04-07 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 9d7b2c0909b78800d1376fd696f73824ea680463 by Nick Coghlan (Brandt Bucher) in branch 'master': bpo-35936: Updates to modulefinder (GH-11787) https://github.com/python/cpython/commit/9d7b2c0909b78800d1376fd696f73824ea680463

[issue35936] Give modulefinder some much-needed updates.

2019-04-07 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks Brandt! I'll also go back and close #17396, #35376, and #25160 -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue30661] Support tarfile.PAX_FORMAT in shutil.make_archive

2019-04-06 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the technical clarification Lars, and for the docs update C.A.M. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue30661] Support tarfile.PAX_FORMAT in shutil.make_archive

2019-04-06 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 89a894403cfa880d7f9d1d67070f61456d14cbde by Nick Coghlan (CAM Gerlach) in branch 'master': bpo-30661: Improve docs for tarfile pax change and effect on shutil (GH-12635) https://github.com/python/cpython/commit

[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: I've merged the change for Python 3.8 (thanks Joel!). I'm not sure whether to classify it as an enhancement or as an interoperability bug fix, though, so I've put the status to pending and added Ned to the nosy list to get his thoughts as the Python 3.7 RM

[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset e653d4d8e820a7a004ad399530af0135b45db27a by Nick Coghlan (Joel Croteau) in branch 'master': bpo-36384: Remove check for leading zeroes in IPv4 addresses (GH-12577) https://github.com/python/cpython/commit/e653d4d8e820a7a004ad399530af0135b45db27a

[issue19495] context manager for measuring duration of blocks of code

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: I think Caleb's "sample_before_and_after" idea hints that this may be an idea that could benefit from the ExitStack treatment where contextlib provides a building block that handles the interaction with the context management machinery, with the doc

[issue36236] Python crash on macOS when CWD is invalid

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for sorting this out, Victor! -- resolution: -> fixed ___ Python tracker <https://bugs.python.org/issue36236> ___ _

[issue14934] generator objects can clear their weakrefs before being resurrected

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: If I recall correctly, it's the generator destructor that handles throwing in ``GeneratorExit`` to get the generator to terminate. So this code can resurrect a generator as it's being collected by the GC: def resurrecting(resurrected): self

[issue16961] No regression tests for -E and individual environment vars

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: Victor Stinner added a great many regression tests in this area for Python 3.7+ -- ___ Python tracker <https://bugs.python.org/issue16

[issue30661] Support tarfile.PAX_FORMAT in shutil.make_archive

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, I agree that changing the default resolves the feature request here. I've recategorised this as a documentation issue, as the initial PR only changed the `tarfile` documentation, so the impact on `shutil` isn't obvious. So the changes needed

[issue36225] Lingering subinterpreters should be implicitly cleared on shutdown

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: I think test_embed would be the right home for this, as there's an existing test case there for subinterpreter lifecycles and repeated init/finalize cycles: https://github.com/python/cpython/blob/ddbb978e1065dde21d1662386b26ded359f4b16e/Programs/_testembed.c

[issue36426] exec() issue when used inside function

2019-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: This is not a bug - to enable function level optimisations, the compiler must be able to see all local variable names at compile time. In Python 2.x the exec statement implementation included special code to allow even function local variables to be rebound

[CfP] DLS 2019 - 15th Dynamic Languages Symposium, co-located with SPLASH 2019

2019-03-23 Thread Nick Papoylias
, University of Glasgow Joe Gibbs Politz, University of California San Diego Juan Fumero, The University of Manchester Julien Ponge, Red Hat Mandana Vaziri, IBM Research Manuel Serrano, Inria Marc Feeley, Université de Montréal Mark Marron, Microsoft Research Na Meng, Virginia Tech Nick Papoulias

[issue36236] Python crash on macOS when CWD is invalid

2019-03-16 Thread Nick Coghlan
Nick Coghlan added the comment: Omitting it from sys.path in that case makes sense to me, but I'm not sure what sys.argv[0] should be set to. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36138] Improve documentation about converting datetime.timedelta to scalars

2019-03-15 Thread Nick Coghlan
Nick Coghlan added the comment: I've merged Yasser's PR (thank you!), but in the review discussion for that, we noticed something else: the `total_seconds()` documentation mentions the floating point dynamic resolution problem, but doesn't mention using `//` or `divmod()` as the fix

[issue36138] Improve documentation about converting datetime.timedelta to scalars

2019-03-15 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset f40b4a0b6277b2779b9ded3736325489f2af93e4 by Nick Coghlan (Yasser A) in branch 'master': bpo-36138: Clarify docs about converting datetime.timedelta to scalars. (GH-12137) https://github.com/python/cpython/commit

[issue33944] Deprecate and remove pth files

2019-03-14 Thread Nick Coghlan
Nick Coghlan added the comment: Just noting that https://bugs.python.org/issue14803 is probably our most comprehensive discussion of the coverage use case for arbitrary pre-__main__ code execution. Steve also made a comment above about potentially turning encodings into a namespace package

[issue36202] Calling Py_DecodeLocale() before _PyPreConfig_Write() can produce mojibake

2019-03-14 Thread Nick Coghlan
Nick Coghlan added the comment: Victor and I were discussing the appropriate behaviour for the "What do we do if _Py_PreInitialize() hasn't been called?" case, and Victor pointed out that the potential for mojibake provides a solid rationale for going back to the Python 3.6

[issue36260] Cpython/Lib vulnerability found and request a patch submission

2019-03-11 Thread Nick Sung
New submission from Nick Sung : Dear Python Community, We’ve found a vulnerability in cpython Lib and already received a cve number (CVE-2019-9674) https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9674 We also have a patch for this vulnerability, please tell us what to do next. Since

[issue21314] Document '/' in signatures

2019-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: I went ahead and merged Lysandros's new FAQ entry (Thank you Lysandros!), as having some level of documentation for this notation is markedly better than the previous "none at all", and the PR added cross-references from the builtins and inspect m

[issue21314] Document '/' in signatures

2019-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 1aeeaeb79efa4de41f97b58547e23c2965ecabc5 by Nick Coghlan (Lysandros Nikolaou) in branch 'master': bpo-21314: Add a FAQ entry about positional only parameters (GH-10641) https://github.com/python/cpython/commit

[issue35807] Update bundled pip to 19.0

2019-03-10 Thread Nick Coghlan
Change by Nick Coghlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement ___ Python tracker <https://bugs.python

[issue19702] Update pickle to take advantage of PEP 451

2019-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: Just noting that PEP 499 covers adding modules executed with `-m` to `sys.modules` under their real name in addition to `__main__`. -- ___ Python tracker <https://bugs.python.org/issue19

[issue36225] Lingering subinterpreters should be implicitly cleared on shutdown

2019-03-07 Thread Nick Coghlan
New submission from Nick Coghlan : https://docs.python.org/3/c-api/init.html#c.Py_EndInterpreter states that "Py_FinalizeEx() will destroy all sub-interpreters that haven’t been explicitly destroyed at that point." As discussed in https://github.com/hexchat/hexchat/issues/2237,

[issue36202] Calling Py_DecodeLocale() before _PyPreConfig_Write() can produce mojibake

2019-03-05 Thread Nick Coghlan
Nick Coghlan added the comment: They weren't *intended* to change it, and didn't in the original implementation of the PEP, but they do in the as-shipped Python 3.7 implementation, and I abandoned my attempts to revert to the as-designed behaviour as impractical given the other changes made

[issue36142] Add a new _PyPreConfig step to Python initialization to setup memory allocator and encodings

2019-03-02 Thread Nick Coghlan
Nick Coghlan added the comment: PEP 432 tweaked: https://github.com/python/peps/pull/904/files -- ___ Python tracker <https://bugs.python.org/issue36

[issue36142] Add a new _PyPreConfig step to Python initialization to setup memory allocator and encodings

2019-03-01 Thread Nick Coghlan
Nick Coghlan added the comment: Agreed - I think the biggest thing we learned from the pre-implementation in Python 3.7 is that the "Let's move as much config as we can to Python C API data types" fell down in a couple of areas: 1. The embedding application is likely to

[issue36124] Provide convenient C API for storing per-interpreter state

2019-02-26 Thread Nick Coghlan
Change by Nick Coghlan : -- stage: -> needs patch type: -> enhancement versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue36124> ___ __

[issue35886] Move PyInterpreterState into Include/internal/pycore_pystate.h

2019-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: Oh, cool (both the fact the issue here is only with building cffi itself, and that cffi creates extension modules that build with PY_LIMITED_API). I've filed https://bugs.python.org/issue36124 to follow up on the PyInterpreter_GetDict API idea

[issue36124] Provide convenient C API for storing per-interpreter state

2019-02-26 Thread Nick Coghlan
New submission from Nick Coghlan : (New issue derived from https://bugs.python.org/issue35886#msg336501 ) cffi needs a generally available way to get access to a caching dict for the currently active subinterpreter. Currently, they do that by storing it as an attribute in the builtins

[issue36085] Enable better DLL resolution

2019-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: As a note in favour of the "Allow package nesting to be encoded in names, not just directories" approach, we actually have a similar problem affecting builtin modules: they're currently limited to top-level modules, with no way for the module t

[issue33944] Deprecate and remove pth files

2019-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: Yep, I completely understand (and agree with) the desire to eliminate the code injection exploit that was introduced decades ago by using exec() to run lines starting with "import " (i.e. "import sys; "). I just don't want to lose th

[issue35886] Move PyInterpreterState into Include/internal/pycore_pystate.h

2019-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: (On closer inspection, that's actually be the same breakage as already mentioned above) However, what I'm not clear on is how this would affect projects that had *already* generated their cffi code, and include that in their sdist. Are all those sdists going

[issue35886] Move PyInterpreterState into Include/internal/pycore_pystate.h

2019-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: Next incompatibility: https://github.com/python-hyper/brotlipy/issues/147 (which indirectly broke httpbin) -- ___ Python tracker <https://bugs.python.org/issue35

[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2019-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: I think the only reason I didn't mention this discrepancy in my doc updates is because I wasn't aware there *was* a discrepancy. The weird syntax was then just an incorrect amalgamation of "optional argument" notation with an improperly escaped re

[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread Nick Coghlan
Nick Coghlan added the comment: The revised behaviour now makes the error messages consistent with each other: >>> class TooManyArgs(): ... def __new__(cls): ... super().__new__(cls, 1) ... >>> TooManyArgs() Traceback (most recent call last): File &quo

[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 5105483acb3aca318304bed056dcfd7e188fe4b5 by Nick Coghlan (Sanyam Khurana) in branch 'master': bpo-31506: Clarify error messages for object.__new__ and object.__init__ (GH-11641) https://github.com/python/cpython/commit

[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread Nick Coghlan
Nick Coghlan added the comment: Paolo: it still won't be completely clear, since there's still the subtle issue that __new__ is a static method rather than a class method, so the correct calls up to the base class are respectively: super(Singleton, cls).__new__(cls) # Static method, cls

[issue34720] Fix test_importlib.test_bad_traverse for AIX

2019-02-18 Thread Nick Coghlan
Change by Nick Coghlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35704] On AIX, test_unpack_archive_xztar fails with default MAXDATA settings

2019-02-18 Thread Nick Coghlan
Change by Nick Coghlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35704] On AIX, test_unpack_archive_xztar fails with default MAXDATA settings

2019-02-18 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +11941 ___ Python tracker <https://bugs.python.org/issue35704> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-16 Thread Nick Coghlan
Nick Coghlan added the comment: Since I haven't really written them down anywhere else, noting some items I'm aware of from the Python 3.7 internals work that haven't made their way back into the PEP 432 public API proposal yet: * If we only had to care about the pure embedding case

[issue35962] Slight error in words in [ 2.4.1. String and Bytes literals ]

2019-02-16 Thread Nick Coghlan
Nick Coghlan added the comment: I agree the current text is ambiguous given how often folks refer to the newline escape sequence as a "newline", but it isn't wrong - it's just talking about escaping literal newlines in your source code like: >>> "This is a

[issue35971] Documentation should warn about code injection from current working directory

2019-02-16 Thread Nick Coghlan
Nick Coghlan added the comment: Folks use "python -m myproject.mymodule" to run code that they're working on all the time - it's currently the only way to get sys.path right for cases like that (otherwise you're exposed to the double import trap, where you can get two copies of a

[issue35810] Object Initialization does not incref Heap-allocated Types

2019-02-16 Thread Nick Coghlan
Nick Coghlan added the comment: Having types created through the stable ABI potentially be deallocated when their instances are deallocated is indeed a major problem, and fixing that seems worth the risk of some types that were designed to handle that become immortal. -- nosy

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-16 Thread Nick Coghlan
Nick Coghlan added the comment: Note also that Eric and I haven't failed to agree with Victor on an API, as Victor hasn't actually written a concrete proposal *for* a public API (neither as a PR updating PEP 432, nor as a separate PEP). The current implementation does NOT follow the PEP

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-16 Thread Nick Coghlan
Nick Coghlan added the comment: Steve, you're describing the goals of PEP 432 - design the desired API, then write the code to implement it. So while Victor's goal was specifically to get PEP 540 implemented, mine was just to make it so working on the startup sequence was less awful

[issue12374] Execution model should explain compile vs definition vs execution time

2019-02-13 Thread Nick Coghlan
Nick Coghlan added the comment: Cheryl has started the conversion process for the old user reference manuscript [1], so I think it makes sense to mark this as "postponed" for now, until we see how far we can get with this more usage-centric level of explanation as a separate pr

[issue35927] Intra-package References Documentation Incomplete

2019-02-12 Thread Nick Coghlan
Nick Coghlan added the comment: As discussed in http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html#executing-the-main-module-twice and https://www.python.org/dev/peps/pep-0395/#why-are-my-imports-broken the cryptic error message here is due to the relative

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-07 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I mainly cc'ed Victor and Eric since making this easier ties into one of the original design goals for PEP 432 (even though I haven't managed to persuade either of them to become co-authors of that PEP yet

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-06 Thread Nick Coghlan
Nick Coghlan added the comment: (Added Victor, Eric, and Steve to the nosy list here, as I'd actually forgotten about this until issue #35706 reminded me) Core of the problem: the embedding APIs don't currently offer a Windows-compatible way of setting up "use this base Python and this

[issue12374] Execution model should explain compile vs definition vs execution time

2019-02-04 Thread Nick Coghlan
Nick Coghlan added the comment: https://github.com/ncoghlan/python-userref/blob/master/ODF/Chapter01_EssentialConcepts.odt is the Chapter 1 userref link now that the PSF SVN server has shut down. Depending on what you mean by "Pursuing this...": 1. I'd definitely still l

[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

2019-01-31 Thread Nick Coghlan
Nick Coghlan added the comment: Reviewing Rémi's page made me realise that a big part of the root cause here is pickle support in exceptions predating the introduction of `__getnewargs__` and `__getnewargs_ex__`. -- nosy: +ncoghlan ___ Python

[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

2019-01-31 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: -11260 ___ Python tracker <https://bugs.python.org/issue27015> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

2019-01-31 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: -11261 ___ Python tracker <https://bugs.python.org/issue27015> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-01-31 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for Antoine's comment - while our approach with memoryview has generally been "If you're doing serious work with n-dimensional data, you still need NumPy (or an equivalent)", we've also been open to borrowing more NumPy behaviours for

[issue32834] test_gdb fails with Posix locale in 3.7

2019-01-29 Thread Nick Coghlan
Nick Coghlan added the comment: Added Dave Malcolm to the nosy list, as the more recent tracebacks are actually throwing an exception in the gdb hooks, rather than just failing the expected output comparison in the test suite. -- nosy: +dmalcolm

[issue10915] Make the PyGILState API compatible with multiple interpreters

2019-01-28 Thread Nick Coghlan
Nick Coghlan added the comment: A more recent discussion of this on python-dev: https://mail.python.org/pipermail/python-dev/2019-January/156095.html The situation there appears to be a case of "Hand off an OS level thread from the creating interpreter to a different subinterpreter. A

[issue35791] Unexpected exception with importlib

2019-01-27 Thread Nick Coghlan
Nick Coghlan added the comment: #35839 is follow-up enhancement request, proposing that we tweak the sys.modules handling in find_spec to ignore cache entries that don't have a __spec__ attribute set. -- ___ Python tracker <ht

[issue35839] Suggestion: Ignore sys.modules entries with no __spec__ attribute in find_spec

2019-01-27 Thread Nick Coghlan
Nick Coghlan added the comment: I'd also suggest that we emit ImportWarning when taking the fallback path, since we really would prefer that sys.modules entries either have a valid __spec__, or else explicitly set `__spec__ = None`. -- ___ Python

[issue35806] typing module adds objects to sys.modules that don't look like modules

2019-01-27 Thread Nick Coghlan
Nick Coghlan added the comment: OK, I've filed #35839 to propose falling back to a regular search when the __spec__ attribute is missing, while treating "obj.__spec__ is None" as a true negative cache entry. -- ___ Python track

[issue35839] Suggestion: Ignore sys.modules entries with no __spec__ attribute in find_spec

2019-01-27 Thread Nick Coghlan
New submission from Nick Coghlan : (Alternate proposal inspired by the discussions in #35806 and #35791) Currently, a sys.modules entry with no __spec__ attribute will prevent importlib.util.find_spec() from locating the module, requiring the following workaround: def

[issue35806] typing module adds objects to sys.modules that don't look like modules

2019-01-27 Thread Nick Coghlan
Nick Coghlan added the comment: Closing this without any changes contradicts the answer we gave Ronald on #35791 that it's expected behaviour for importlib.find_spec() to throw an exception for already loaded modules without a __spec__ attribute. So if this stays closed, then we should

[issue35791] Unexpected exception with importlib

2019-01-22 Thread Nick Coghlan
Nick Coghlan added the comment: Yep, that's a bug in `py`'s module interface emulation - see the last paragraph in https://docs.python.org/3/reference/import.html#module-spec -- resolution: -> not a bug stage: -> resolved status: open -&g

[issue35486] subprocess module import hooks breaks back compatibility

2019-01-22 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, we can :) -- assignee: -> docs@python components: +Documentation -Library (Lib) nosy: +docs@python resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tra

[issue15045] Make textwrap.dedent() and textwrap.indent() handle whitespace consistently

2019-01-22 Thread Nick Coghlan
Nick Coghlan added the comment: Putting some of my comments here rather than on the PR, as they're design questions related to "Is the current behaviour actually wrong?" and "Even if the current behaviour is deemed technically incorrect, is it worth the risk of changi

[issue33944] Deprecate and remove pth files

2019-01-15 Thread Nick Coghlan
Nick Coghlan added the comment: Note that any PEP I contributed to writing would need to be restricted to eliminating arbitrary code execution, as I don't think there's anything wrong with the path extension feature. -- ___ Python tracker <ht

[issue33944] Deprecate and remove pth files

2019-01-15 Thread Nick Coghlan
Nick Coghlan added the comment: `site.addsitedir` is called for every site-packages directory (whether global, within a venv, or at the user level), so my proposal above covers appending multiple segments. Linux distros approach to handling this is terrible because they dump all

[issue33944] Deprecate and remove pth files

2019-01-14 Thread Nick Coghlan
Nick Coghlan added the comment: Namespace packages in general didn't rely on pth files - only the setuptools/pkg_resources implementation of them did. I'll also reiterate that I am *completely* opposed to deprecating the "append entries to sys.path" usage model, as there is

[issue33944] Deprecate and remove pth files

2019-01-13 Thread Nick Coghlan
Nick Coghlan added the comment: I'm suggesting PendingDeprecationWarning because we can't *actually* deprecate anything until we provide a more transparent alternative that offers comparable functionality, and I haven't seen a credible proposal for a replacement yet. So using PDW would

[issue35707] time.sleep() should support objects with __float__

2019-01-12 Thread Nick Coghlan
Nick Coghlan added the comment: Deriving __int__ from __float__ wouldn't be the right answer, as that can easily lead to unwanted OverflowError exceptions and other issues. However, Jeroen's suggested order of checking __index__ then __float__ then __int__ in _PyTime_FromObject makes sense

[issue33039] int() and math.trunc don't accept objects that only define __index__

2019-01-12 Thread Nick Coghlan
Nick Coghlan added the comment: @Rémi Aye, filling out derived slots is one of the things PyType_Ready does. This would need a discussion on python-dev before going ahead and doing it though, as the closest equivalent we have to this right now is the "negative" derivation, where

[issue35486] subprocess module import hooks breaks back compatibility

2019-01-12 Thread Nick Coghlan
Nick Coghlan added the comment: dw: we routinely impose new requirements on folks modifying runtime internals in new feature releases, so the only aspect we missed for this changing is to explicitly call it out in the Porting section of the Python 3.6 What's New document as a potential

[issue35486] subprocess module import hooks breaks back compatibility

2019-01-12 Thread Nick Coghlan
Change by Nick Coghlan : -- keywords: +patch, patch pull_requests: +11147, 11148 stage: test needed -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35486] subprocess module import hooks breaks back compatibility

2019-01-12 Thread Nick Coghlan
Change by Nick Coghlan : -- keywords: +patch, patch, patch pull_requests: +11147, 11148, 11149 stage: test needed -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35486] subprocess module import hooks breaks back compatibility

2019-01-12 Thread Nick Coghlan
Change by Nick Coghlan : -- keywords: +patch pull_requests: +11147 stage: test needed -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue33944] Deprecate and remove pth files

2019-01-12 Thread Nick Coghlan
Nick Coghlan added the comment: To make a potentially viable concrete proposal here, I think a reasonable first step would be to change the ".pth" file processing code in site.py to emit PendingDeprecationWarning for the 'if line.startswith(("import ", "import\t&

[issue35614] Broken help() on metaclasses

2018-12-30 Thread Nick Coghlan
Change by Nick Coghlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35614] Broken help() on metaclasses

2018-12-30 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset b539cef31c060c7eecc331d25a23b80ded0baf08 by Nick Coghlan (Sanyam Khurana) in branch 'master': bpo-35614: Fix pydoc help() on metaclasses (#11357) https://github.com/python/cpython/commit/b539cef31c060c7eecc331d25a23b80ded0baf08

[issue35596] Fatal Python error: initfsencoding: unable to load the file system codec zipimport.ZipImportError: can't find module 'encodings'

2018-12-30 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, you're right - I missed that the ForceASCII stuff was on the non-Windows side of an ifdef so it's literally impossible for that change to affect Windows, not just highly unlikely. It would be interesting to compare the output of `python -vv` between

[issue35596] Fatal Python error: initfsencoding: unable to load the file system codec zipimport.ZipImportError: can't find module 'encodings'

2018-12-28 Thread Nick Coghlan
Nick Coghlan added the comment: Reviewing the diff at https://github.com/python/cpython/compare/v3.7.1...v3.7.2 the only item I've spotted that seems like it could even plausibly be related is the tweak at https://github.com/python/cpython/compare/v3.7.1...v3.7.2#diff

[issue11192] test_socket error on AIX

2018-12-28 Thread Nick Coghlan
Change by Nick Coghlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue27643] test_ctypes fails on AIX with xlc

2018-12-28 Thread Nick Coghlan
Change by Nick Coghlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

<    1   2   3   4   5   6   7   8   9   10   >