[issue35224] PEP 572: Assignment Expressions

2019-08-04 Thread Nick Coghlan
Nick Coghlan added the comment: https://bugs.python.org/issue37757 separates out the TargetScopeError handling for conflicts between assignment expressions and comprehension iteration variables. -- ___ Python tracker <https://bugs.python.

[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-04 Thread Nick Coghlan
New submission from Nick Coghlan : While implementing PEP 572, Emily noted that the check for conflicts between assignment operators and comprehension iteration variables had not yet been implemented: https://bugs.python.org/issue35224#msg334331 Damien George came across this discrepancy

[issue35224] PEP 572: Assignment Expressions

2019-08-04 Thread Nick Coghlan
Nick Coghlan added the comment: Did the documentation PR get pushed/merged? Emily mentioned having one in progress above, but it doesn't appear in the linked PRs. -- nosy: +ncoghlan ___ Python tracker <https://bugs.python.org/is

[issue37587] JSON loads performance improvement for long strings

2019-07-30 Thread Nick Coghlan
Nick Coghlan added the comment: I went ahead and merged the minimal PR and flagged it for backporting to 3.8 - it's an obviously beneficial change, that clearly does less work on each pass through the loop. Even if you are doing non-strict parsing of a string that consists entire

[issue37587] JSON loads performance improvement for long strings

2019-07-30 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 8a758f5b99c5fc3fd32edeac049d7d4a4b7cc163 by Nick Coghlan (Marco Paolini) in branch 'master': bpo-37587: Make json.loads faster for long strings (GH-14752) https://github.com/python/cpython/commit/8a758f5b99c5fc3fd32edeac049d7d

[issue37636] Deprecate slicing and ordering operations on sys.version

2019-07-20 Thread Nick Coghlan
New submission from Nick Coghlan : At the core dev sprints in 2017 (IIRC), Ezio and I were talking about some of the potential issues with 3.10, and one of them was folks attempting to manipulate sys.version with string operations rather than using the already decomposed sys.version info

[issue35476] _imp_create_dynamic_impl() does not clear error.

2019-07-20 Thread Nick Coghlan
Nick Coghlan added the comment: Agreed, raising the exception properly would be the way to go. -- nosy: +ncoghlan ___ Python tracker <https://bugs.python.org/issue35

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2019-07-01 Thread Nick Coghlan
Nick Coghlan added the comment: Reviewing the thread, we never actually commented on thautwarm's proposal in https://bugs.python.org/issue12782#msg327875 that aims to strip out any INDENT, NEWLINE, and DEDENT tokens that appear between the opening "with" keyword and the s

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-07-01 Thread Nick Coghlan
Nick Coghlan added the comment: ImportError sounds right to me. We already raise that just above this for the "no dots at all" case, so also raising it for the "not enough dots" case makes more sense than leaving them different. -- __

[issue37250] C files generated by Cython set tp_print to 0: PyTypeObject.tp_print removed

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

[issue37438] ConfigParser.set() docs should mention allow_no_value

2019-06-28 Thread Nick Coghlan
New submission from Nick Coghlan : Reviewing some code today, I came across a ConfigParser.set() call that only specified the section and key, with the value argument missing. If you look at the ConfigParser.set() docs, this seems like incorrect code, as those docs indicate that the value

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-06-24 Thread Nick Coghlan
Nick Coghlan added the comment: In reviewing https://github.com/cython/cython/pull/3009, Jeroen pointed out that my symbol checking idea wouldn't actually work, since the preprocessor can only see preprocessor definitions, not compiler symbols. If we're going to rely on a pr

[issue37250] C files generated by Cython set tp_print to 0: PyTypeObject.tp_print removed

2019-06-24 Thread Nick Coghlan
Nick Coghlan added the comment: There's also the question of complying with our own deprecation policy, as the approval to ditch tp_print API compatibility in PEP 590 relied on the fact that it has been deprecated since Python 3.0. However, it turns out the associated program

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-06-21 Thread Nick Coghlan
Nick Coghlan added the comment: I'm happy with the change in https://github.com/python/cpython/pull/13959, but we need sign-off from Łukasz as release manager on bumping the Py_VERSION_SERIAL a bit early so Cython can reliably detect that this change has been reverted without having to

[issue37250] C files generated by Cython set tp_print to 0: PyTypeObject.tp_print removed

2019-06-21 Thread Nick Coghlan
Nick Coghlan added the comment: It isn't the actively maintained projects that publish wheel files that I'm worried about fixing - it's the sdist only projects that would otherwise only need recompilation to work on the new Python version. With this fixed, and the PyCode_Ne

[issue36210] correct AIX logic in setup.py for (non-existant) optional extensions

2019-06-21 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 08970cb03c61f62f4f69e7769d0075fa66bb86aa by Nick Coghlan (Michael Felt) in branch 'master': bpo-36210: update optional extension handling for AIX (GH-12202) https://github.com/python/cpython/commit/08970cb03c61f62f4f69e7769d0075

[issue20443] __code__. co_filename should always be an absolute path

2019-06-21 Thread Nick Coghlan
Nick Coghlan added the comment: Perhaps `os._abspath_for_import`? If importlib finds it, then it can handle making early paths absolute itself, otherwise it will defer doing that until it has the full external import system bootstrapped. (importlib does try to make all paths absolute as it

[issue37250] C files generated by Cython set tp_print to 0: PyTypeObject.tp_print removed

2019-06-18 Thread Nick Coghlan
Nick Coghlan added the comment: (Note: this isn't SC feedback yet, it's individual contributor feedback from me) As others noted, the reason we treat "Incompatible with Cython generated source code" distinctly from other C API source compatibility issues is because C

[issue28009] core logic of uuid.getnode() needs refresh

2019-06-15 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 3a1d50e7e573efb577714146bed5c03b9c95f466 by Nick Coghlan (Michael Felt) in branch 'master': bpo-28009: Fix uuid SkipUnless logic to be based on platform programs capable of introspection (GH-12777) https://github.com/python/cpyt

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-06-11 Thread Nick Coghlan
Nick Coghlan added the comment: The key problem isn't Cython itself, the problem is that Cython generated libraries can't be rebuilt for 3.8 without regenerating their C files. I'd be fine with PyCode_NewWithPosArgs (Victor's right that a descriptive naming convention ha

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-06-10 Thread Nick Coghlan
New submission from Nick Coghlan : The Porting section of the What's New guide is for changes where the old behaviour was at best arguably correct, but it's still possible someone was relying on it behaving exactly the way it used to. It isn't for us to say "We broke all

[issue34836] test_ssl.test_default_ecdh_curve needs no tls1.3 flag in 2.7, for now

2019-06-08 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 99b5c940d3471e0ed6579771d94e7342d7c733e0 by Nick Coghlan (Dimitri John Ledkov) in branch '2.7': [2.7] bpo-34836: fix test_default_ecdh_curve, needs no tlsv1.3. (GH-9626) https://github.com/python/cpyt

[issue37107] ensurepip --upgrade doesn't change the version of pip used by venv

2019-06-08 Thread Nick Coghlan
Nick Coghlan added the comment: Addressing the other part of Chris's initial post: there's also no `--upgrade-pip` option on `venv` itself. Instead, there's only an `--upgrade` option that is intended for *Python* version upgrades, and restructures the internal layout of the

[issue37107] ensurepip --upgrade doesn't change the version of pip used by venv

2019-06-08 Thread Nick Coghlan
Nick Coghlan added the comment: (Added packaging, Linux distro, and Windows and macOS installer folks to the cc list) Chris and I were discussing this behaviour, and it turns out even I had forgotten how we had specified this feature in PEP 453: `ensurepip --upgrade` ensures that an older

[issue36797] Cull more oudated distutils information

2019-05-23 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset e788057a9188ff37e232729815dfda2529079420 by Nick Coghlan in branch 'master': bpo-36797: Reduce levels of indirection in outdated distutils docs (#13462) https://github.com/python/cpython/commit/e788057a9188ff37e232729815dfda

[issue37010] Review performance of inspect.getfullargspec

2019-05-22 Thread Nick Coghlan
New submission from Nick Coghlan : (Splitting out a separate performance issue from https://bugs.python.org/issue36751#msg342683) There can be two quite different reasons for inspecting a function signature: * inspecting arbitrary functions to learn as much about them as possible in order

[issue36751] Changes in the inspect module for PEP 570

2019-05-22 Thread Nick Coghlan
Nick Coghlan added the comment: I split https://bugs.python.org/issue37010 out as a separate performance issue in case anyone is inclined to explore the idea of reversing the relationship between inspect.signature and inspect.getfullargspec, such that the latter becomes a fast building

[issue33071] Document that PyPI no longer requires 'register'

2019-05-21 Thread Nick Coghlan
Nick Coghlan added the comment: This has been merged for 3.8 and 3.7, but not for 2.7, since the docs have diverged far enough that the automatic backport didn't work: https://github.com/python/cpython/pull/13087#issuecomment-494402704 Given the proximity to the general end of life o

[issue36797] Cull more oudated distutils information

2019-05-21 Thread Nick Coghlan
Nick Coghlan added the comment: While I do have a second PR open with some additional smaller cleanups, the first PR removed the outdated information that seemed most problematic. -- resolution: -> fixed stage: patch review -> resolved status: open -&g

[issue36797] Cull more oudated distutils information

2019-05-21 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +13372 ___ Python tracker <https://bugs.python.org/issue36797> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36751] Changes in the inspect module for PEP 570

2019-05-16 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks Pablo. Noting for the record: positional-only arguments aren't new *semantically", since extension modules have always allowed them, and you've long been able to emulate them in Python code by accepting "*args". Prior to the

[issue36797] Cull more oudated distutils information

2019-05-14 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset dae1229729920e3aa2be015453b7f702dff9b375 by Nick Coghlan in branch 'master': bpo-36797: Prune more legacy distutils documentation (GH-13092) https://github.com/python/cpython/commit/dae1229729920e3aa2be015453b7f7

[issue36751] Changes in the inspect module for PEP 570

2019-05-10 Thread Nick Coghlan
Nick Coghlan added the comment: Also note #32190 regarding changing the way these APIs are documented, without introducing any programmatic deprecation warnings. -- ___ Python tracker <https://bugs.python.org/issue36

[issue27172] Undeprecate inspect.getfullargspec()

2019-05-10 Thread Nick Coghlan
Change by Nick Coghlan : -- status: open -> closed ___ Python tracker <https://bugs.python.org/issue27172> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue36751] Changes in the inspect module for PEP 570

2019-05-10 Thread Nick Coghlan
Nick Coghlan added the comment: And no, the undeprecation wasn't because of Python 2 (Py2 doesn't have getfullargspec() - it's a Py3 only API). The undeprecation was because there are a lot of 3rd party projects for whom the getfullargspec() representation is good enough, a

[issue36751] Changes in the inspect module for PEP 570

2019-05-10 Thread Nick Coghlan
Change by Nick Coghlan : -- priority: normal -> release blocker ___ Python tracker <https://bugs.python.org/issue36751> ___ ___ Python-bugs-list mai

[issue36751] Changes in the inspect module for PEP 570

2019-05-10 Thread Nick Coghlan
Nick Coghlan added the comment: This PR needs to be reverted - we previously deprecated this API, but then undeprecated it again in #27172, as the consequence of deprecating it was projects copying & pasting the getfullargspec() implementation into their own code, not switchin

[issue33071] Document that PyPI no longer requires 'register'

2019-05-10 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 1b4abcf302ff2c8f4d4881294510d48ba5186b53 by Nick Coghlan (Kojo Idrissa) in branch 'master': bpo-33071: remove outdated PyPI docs (GH-13087) https://github.com/python/cpython/commit/1b4abcf302ff2c8f4d4881294510d48ba5186b53 -

[issue24048] remove_module() needs to save/restore exception state

2019-05-08 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 94a64e9cd411a87514b68082c1c437eb3b49dfb9 by Nick Coghlan (Zackery Spytz) in branch 'master': bpo-24048: Save the live exception during import.c's remove_module() (GH-13005) https://github.com/python

[issue36479] Exit threads when interpreter is finalizing rather than runtime.

2019-05-08 Thread Nick Coghlan
Nick Coghlan added the comment: Another potential issue here is if a thread belonging to another interpreter attempts to access the interpreter being cleaned up. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36479] Exit threads when interpreter is finalizing rather than runtime.

2019-05-08 Thread Nick Coghlan
Nick Coghlan added the comment: Pablo pointed out a problem with this change at the PyCon sprints: the thread cleanup code doesn't currently distinguish between "Python created daemon thread" and "thread created by the embedding application". That's alre

[issue36797] Cull more oudated distutils information

2019-05-04 Thread Nick Coghlan
Change by Nick Coghlan : -- keywords: +patch pull_requests: +13006 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36797] Cull more oudated distutils information

2019-05-04 Thread Nick Coghlan
New submission from Nick Coghlan : Prompted by #33071, I'm going to do a pass through the legacy distutils documentation deleting outdated information that is better maintained elsewhere. -- assignee: ncoghlan messages: 341407 nosy: jaraco, ncoghlan priority: normal severity: n

[issue30840] Contrary to documentation, relative imports cannot pass through the top level

2019-04-24 Thread Nick Coghlan
Change by Nick Coghlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: behavior -> enhancement versions: +Python 3.8 -Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python

[issue30840] Contrary to documentation, relative imports cannot pass through the top level

2019-04-24 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 4d0233ec656bc7e7814e5f6f484e79a50a0daf91 by Nick Coghlan (Miss Islington (bot)) in branch '3.7': bpo-30840: Document relative imports (GH-12831) (GH-12938) https://github.com/python/cpython/commit/4d0233ec656bc7e7814e5f6f484e79

[issue30840] Contrary to documentation, relative imports cannot pass through the top level

2019-04-24 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 70bf713617e15fad390ed953e48b3c65d9bc90ec by Nick Coghlan (Joannah Nanjekye) in branch 'master': bpo-30840: Document relative imports (#12831) https://github.com/python/cpython/commit/70bf713617e15fad390ed953e48b3c

[issue36692] Unexpected stderr output from test_sys_settrace

2019-04-21 Thread Nick Coghlan
New submission from Nick Coghlan : The test output from test_sys_settrace makes it look like a couple of the async tracing tests aren't cleaning up after themselves properly: ``` [ncoghlan@localhost cpython]$ ./python -m test test_sys_settrace Run tests sequentially 0:00:00 load avg: 1.

[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-04-21 Thread Nick Coghlan
Change by Nick Coghlan : -- nosy: +ncoghlan ___ Python tracker <https://bugs.python.org/issue35998> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36665] REPL doesn't ensure builtins are available when implicitly recreating __main__

2019-04-18 Thread Nick Coghlan
Change by Nick Coghlan : -- title: Dropping __main__ from sys.modules clears the REPL namespace -> REPL doesn't ensure builtins are available when implicitly recreating __main__ ___ Python tracker <https://bugs.python.org

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

2019-04-18 Thread Nick Coghlan
Nick Coghlan added the comment: The relevant functions: * PyRun_InteractiveLoopFlags: https://github.com/python/cpython/blob/e8113f51a8bdf33188ee30a1c038a298329e7bfa/Python/pythonrun.c#L89 * PyRun_InteractiveOneObjectEx: https://github.com/python/cpython/blob

[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__',

[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

[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 it to be

[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` bec

[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. -- resol

[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 wo

[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 ef

[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 re

[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. -- resol

[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/9d7b2c0909b78800d1376fd696f738

[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.pyth

[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/cpyt

[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 th

[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/e653d4d8e820a7a004ad399530af01

[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 th

[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):

[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 need

[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/_testem

[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

[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/is

[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()`

[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/cpyt

[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 Pytho

[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 insp

[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/cpyt

[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 ch

[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 spe

[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

[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

[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 sd

[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

[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/cpyt

[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 m

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