[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2018-02-05 Thread Nick Coghlan
Nick Coghlan added the comment: I'd also ask whether the use case can be satisfied by rebinding __class__ instead of __bases__. That's far better defined than replacing the contents of the bases list and attempting to dynamically recalcula

[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2018-02-06 Thread Nick Coghlan
Nick Coghlan added the comment: >From VA's description of the intended use case, this actually sounds a bit >like a variant of https://bugs.python.org/issue29944: one reason that >replacing C with a new dynamically constructed type won't work reliably is >because som

[issue11015] Bring test.support docs up to date

2018-02-11 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 988fb28431d3a3fc5dc6eb657c8a4baacc04d9ce by Nick Coghlan (Cheryl Sabella) in branch 'master': bpo-11015: Update test.support documentation (GH-5610) https://github.com/python/cpython/commit/988fb28431d3a3fc5dc6eb657c8a4b

[issue11015] Bring test.support docs up to date

2018-02-11 Thread Nick Coghlan
Nick Coghlan added the comment: I merged Cheryl's PR to the dev branch, and triggered the backport to 3.7. If nobody beats me to it, I'll merge the latter tomorrow :) -- assignee: docs@python -> ncoghlan resolution: -> fixed stage: patch review -&

[issue11015] Bring test.support docs up to date

2018-02-11 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset a0b998df314370f00502efe7ad84206f5bb782ff by Nick Coghlan (Miss Islington (bot)) in branch '3.7': bpo-11015: Update test.support documentation (GH-5619) https://github.com/python/cpython/commit/a0b998df314370f00502efe7ad8420

[issue32820] Add bits method to ipaddress

2018-02-12 Thread Nick Coghlan
Nick Coghlan added the comment: I think the aspect that makes this potentially worthy of a helper function is the need to dynamically adjust the field width based on whether you're printing an IPv4 address or an IPv6 one, whether you're printing it in binary or hexadecimal, whet

[issue32834] test_gdb fails with Posix locale in 3.7

2018-02-12 Thread Nick Coghlan
Nick Coghlan added the comment: I can reproduce this, but it looks to me like it's being triggered by UTF-8 mode rather than locale coercion (the "LC_ALL=C" setting will implicitly disable locale coercion entirely): ``` $ LANG=C PYTHONCOERCECLOCALE=warn ./python -We -

[issue20632] Define a new __key__ protocol

2018-02-12 Thread Nick Coghlan
Nick Coghlan added the comment: For now, I'm going to close this as "out of date", with the guidance being "Define a data class instead" (since that gets rid of the historical boilerplate a different way: auto-generating suitable methods based on the field declarat

[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-02-12 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +5455 ___ Python tracker <https://bugs.python.org/issue30579> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20632] Define a new __key__ protocol

2018-02-12 Thread Nick Coghlan
Nick Coghlan added the comment: It isn't InitVar that you want for that use case (that's just for passing extra information to __post_init__). Instead, you want: extra_field = field(compare=False): int # Excluded from __hash__, __eq_, etc You can also exclude a field from __h

[issue30579] Allow traceback objects to be instantiated/mutated/annotated

2018-02-13 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset aec7532ed3ccbd29d3429a3f375e25f956c44003 by Nick Coghlan in branch 'master': bpo-30579: Docs for dynamic traceback creation (GH-5653) https://github.com/python/cpython/commit/aec7532ed3ccbd29d3429a3f375e25

[issue32836] Symbol table for comprehensions (list, dict, set) still includes temporary _[1] variable

2018-02-13 Thread Nick Coghlan
Nick Coghlan added the comment: We still need to the ".0" style temporary variables that are used for argument names in the implicitly generated functions, but it's definitely plausible that we're not actually using the "_[1]" style hidden variables anyw

[issue32820] Add bits method to ipaddress

2018-02-13 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, definitely worth a thread on python-ideas. My rationale for suggesting something based on the built-in numeric codes is that it makes it straightforward for *users* to transfer knowledge from that mini-language. As far as parsing goes, I was thinking of

[issue20632] Define a new __key__ protocol

2018-02-14 Thread Nick Coghlan
Nick Coghlan added the comment: Allowing for None-first and None-last ordering is a fair use case, but I'm not sure a __key__ protocol is the right answer to that - as your own example shows, it gets tricky when dealing with nested containers. It may make sense to raise the questi

[issue32820] Add bits method to ipaddress

2018-02-19 Thread Nick Coghlan
Nick Coghlan added the comment: The python-ideas discussion didn't turn up any major concerns we hadn't already considered, so you're in "wait for PR review" mode now. If you wanted to do a self-review in the meantime, then https://devguide.python.org/committing

[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Nick Coghlan
Nick Coghlan added the comment: +1 from me for making the change 3.7.0+ only - 3.6 isn't doing the right thing, but given folks are relying on it doing the wrong thing, then let's leave it alone given where it is in its lifecycle. --

[issue32820] Add __format__ method to ipaddress

2018-02-20 Thread Nick Coghlan
Nick Coghlan added the comment: I've updated the issue title to reflect the revised proposal (i.e. using __format__ rather than a new IP address specific method). -- title: Add bits method to ipaddress -> Add __format__ method to i

[issue32843] More revisions to test.support docs

2018-02-20 Thread Nick Coghlan
Nick Coghlan added the comment: For TESTFN_NONASCII vs TESTFN_UNICODE (inferred from reading the current code & https://github.com/python/cpython/commit/8b219b2936d767bf6c6c17618db3a7b22fc2e865): * TESTFN_NONASCII guarantees that it can be encoded and decoded with the default filesy

[issue32892] Remove specific constant AST types in favor of ast.Constant

2018-02-21 Thread Nick Coghlan
Nick Coghlan added the comment: As pure aliases, those wouldn't necessarily be that useful, as aside from NameConstant, the field names are different (Num.n, Str.s, Bytes.s). I do wonder whether it might be worth keeping "NameConstant", though, and use that for Ellipsis

[issue32892] Remove specific constant AST types in favor of ast.Constant

2018-02-21 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, right - in that case, I think the subclasses would be worthwhile, as they shouldn't be too much hassle to maintain for a release, and will provide a more graceful migration for folks doing their own AST processing and gener

[issue23077] PEP 1: Allow Provisional status for PEPs

2018-02-21 Thread Nick Coghlan
Nick Coghlan added the comment: I'll also note that I made my comments above about writing a new PEP prior to the migration to GitHub and the availability of a PR-based workflow for reviewing PEP changes. So consider the PR Cheryl linked and the post at https://mail.python.org/pipe

[issue32912] Raise non-silent warning for invalid escape sequences

2018-02-22 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for the DeprecationWarning->SyntaxWarning->SyntaxError approach from me (especially as 3.7 will make the existing deprecation warning visible in interactive shells and __main__ modules by default). -- ___

[issue17232] Improve -O docs

2018-02-22 Thread Nick Coghlan
Nick Coghlan added the comment: We don't change the extension on optimised pyc files any more, we add an optimisation marker to the name without changing the file extension: https://www.python.org/dev/peps/pep-0488/ (This means `-O` and `-OO` don't tread on each othe

[issue32820] Add __format__ method to ipaddress

2018-02-23 Thread Nick Coghlan
Nick Coghlan added the comment: I think supporting "s" makes sense, as we're going to need to treat the empty format string as implying "s" for backwards compatibility reasons: >>> f"{v4}" '1.2.3.4' Right now, attempting to for

[issue32932] better error message when __all__ contains non-str objects

2018-02-24 Thread Nick Coghlan
Nick Coghlan added the comment: I believe the original rationale for the `__path__` check was to restrict that branch to the case where we may need to import a not-yet-imported submodule in order to get the attribute set appropriately. However, giving a better error message for __all__ in

[issue12345] Add math.tau

2018-02-24 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: -5640 ___ Python tracker <https://bugs.python.org/issue12345> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2018-02-25 Thread Nick Coghlan
Nick Coghlan added the comment: With issue 17611 merged (which moves stack unwinding to the compiler), I expect the exact details of this problem to have changed, but the general problem still exists: Ctrl-C may lead to __exit__ (or __aexit__) not being called even after __enter__ (or

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

2018-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: _xxsubinterpreters has been added, and we'll use PEP 554 as the interim documentation while it's only exposed for testing purposes. -- resolution: -> fixed stage: patch review -> resolved status

[issue32932] better error message when __all__ contains non-str objects

2018-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: I +1'ed Serhiy's patch for issue 32946, so we'll have to take that micro-optimisation into account if we decide to rely on the Python level `_handle_fromlist` to cover the "*" import case. Given that optimisation, it's probably

[issue32836] Symbol table for comprehensions (list, dict, set) still includes temporary _[1] variable

2018-02-26 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 3a087beddd9f0955eb9080a6fd1499ff89ca74bf by Nick Coghlan (Nitish Chandra) in branch 'master': bpo-32836: Remove obsolete code from symtable pass (GH-5680) https://github.com/python/cpython/commit/3a087beddd9f0955eb9080a6fd1499

[issue32980] Remove functions that do nothing in _Py_InitializeCore()

2018-03-02 Thread Nick Coghlan
Nick Coghlan added the comment: (Bringing my response from core-mentorship over to the main tracker) These APIs are exposed to embedding applications via the pylifecycle header: https://github.com/python/cpython/blob/master/Include/pylifecycle.h#L143 While we technically *could* deprecate

[issue32980] Remove functions that do nothing in _Py_InitializeCore()

2018-03-02 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, dropping _PyFrame_Init/Fini for 3.8+ would make sense. It's PyByteArray_Init/Fini that probably aren't worth the hassle of removing, since the lack of a leading underscore means they'd need to go through a deprecation cycle. -- re

[issue33032] Mention implicit cache in struct.Struct docs

2018-03-08 Thread Nick Coghlan
New submission from Nick Coghlan : The struct.Struct docs claim that creating and re-using a Struct object will be noticeably faster than calling the module level methods repeatedly with the same format string, as it will avoid parsing the format string multiple times: https://docs.python.org

[issue33032] Mention implicit cache in struct.Struct docs

2018-03-08 Thread Nick Coghlan
Nick Coghlan added the comment: The note on https://docs.python.org/3/library/re.html#re.compile provides a useful precedent for possible wording here, as the struct cache and the regex cache are quite similar. -- ___ Python tracker <ht

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 308eab979d153f1ab934383dc08bc4546ced8b6c by Nick Coghlan (Eric Appelt) in branch 'master': bpo-26701: Add documentation for __trunc__ (GH-6022) https://github.com/python/cpython/commit/308eab979d153f1ab934383dc08bc4546ced8b6c -

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

2018-03-10 Thread Nick Coghlan
New submission from Nick Coghlan : (Note: I haven't categorised this yet, as I'm not sure how it *should* be categorised) Back when the __index__/nb_index slot was added, the focus was on allowing 3rd party integer types to be used in places where potentially lossy conversion wi

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: I think __trunc__ is special here, as it's called by a built-in type constructor, whereas __floor__ and __ceil__ really are specific to their respective math module functions. That said, I also wouldn't be opposed to listing all 4 methods togethe

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

2018-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: Marking this as a documentation enhancement request for now, but I think we should also consider changing the type creation behaviour in 3.8 to implicitly add __int__ and __trunc__ definitions when __index__ is defined, but they aren't. That way, no beha

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset f34e0d60e27acff3f9604ec63e9de36878c3743a by Nick Coghlan (Miss Islington (bot)) in branch '3.7': bpo-26701: Add documentation for __trunc__ (GH-6049) https://github.com/python/cpython/commit/f34e0d60e27acff3f9604ec63e9de3

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 1028ca4f04c14cf40a8f3e7951623a96ec0143c2 by Nick Coghlan (Miss Islington (bot)) in branch '3.6': bpo-26701: Add documentation for __trunc__ (GH-6050) https://github.com/python/cpython/commit/1028ca4f04c14cf40a8f3e7951623a

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread Nick Coghlan
Nick Coghlan added the comment: I don't think we made any start-up changes that were specific to PySys_AddWarnOption, so my suspicion is that the crash is going to be related to a change in the constraints on either the unicode object creation or the list append operation. The att

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread Nick Coghlan
Change by Nick Coghlan : -- assignee: -> ncoghlan ___ Python tracker <https://bugs.python.org/issue33042> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-03-12 Thread Nick Coghlan
Nick Coghlan added the comment: With both Eric's and Serhiy's updates merged, and issue 33039 broken out for the __index__ oddities, this is resolved now. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-12 Thread Nick Coghlan
Nick Coghlan added the comment: Adding a bit of context from my prior email discussion with Hartmut: CPython actually reads sys.warnoptions at the end of Py_Initialize (its the last thing we do before the function returns). It also reads sys._xoptions during startup, since that's one w

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-14 Thread Nick Coghlan
Nick Coghlan added the comment: https://github.com/python/cpython/commit/b4d1e1f7c1af6ae33f0e371576c8bcafedb099db (the first attempted fix for bpo-20891) is the last commit where the draft test case patch applies cleanly. That still segfaults, so I'll jump all the way back to 3.7.0a1, r

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-14 Thread Nick Coghlan
Nick Coghlan added the comment: After reworking the patch to backport the pre-initialization embedding tests to 3.7.0a1, they *both* failed, as that was before Victor fixed Py_DecodeLocale to work prior to initialization again. As a result, I tried https://github.com/python/cpython/commit

[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-14 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the report and pull request. Do you happen to know if setuptools is also affected? If yes, the problem will need to be reported & fixed there as well (otherwise the maintainer metadata will still be missing for many publishers), if no, then u

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-14 Thread Nick Coghlan
Nick Coghlan added the comment: While I haven't definitely narrowed it down yet, I suspect it isn't your changes that are the problem: since the reported crash relates to attempting to access a not-yet-created thread state, `warnoptions` and `_xoptions` likely need to become C lev

[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-15 Thread Nick Coghlan
Nick Coghlan added the comment: We allowed semi-standardised additional fields for an extended period with 1.2 (for Provides-Extra and Description-Content-Type), but folks mostly found it confusingly ambiguous, so Dustin created PEP 566 to define them officially as Metadata 1.3. Given that

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-15 Thread Nick Coghlan
Nick Coghlan added the comment: Patched test_capi results for 2ebc5ce42a8a9e047e790aefbf9a94811569b2b6 (the global state consolidation commit): both pre-initialization tests fail Patched test_capi results for bab21faded31c70b142776b9a6075a4cda055d7f (the immediately preceding commit): both

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-03-16 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset c2b0b12d1a137ada1023ab7c10b8d9a0249d95f9 by Nick Coghlan (Marcel Plch) in branch 'master': bpo-32374: m_traverse may be called with m_state=NULL (GH-5140) https://github.com/python/cpython/commit/c2b0b12d1a137ada1023ab7c10b8d9

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-17 Thread Nick Coghlan
Nick Coghlan added the comment: This shouldn't affect the public ABI, so I don't think it's a blocker for the ABI freeze, but it's a regression that effectively makes PySys_AddWarnOption (and related APIs) unusable, so we should definitely fix it before shipping 3.7. For

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-17 Thread Nick Coghlan
Nick Coghlan added the comment: This isn't considered a security issue, as running "python3" interactively behaves in exactly the same way (i.e. tracking changes to the current working directory for the duration of the session), and running "python3 script.py"

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-17 Thread Nick Coghlan
Nick Coghlan added the comment: Also, a small upstream community interaction tip: if you want people to seriously consider your requests for changes in default behaviour (which inevitably risk backwards compatibility breaks), don't start out by insulting them. Python's de

[issue33095] Cross-reference isolated mode from relevant locations

2018-03-17 Thread Nick Coghlan
New submission from Nick Coghlan : In https://bugs.python.org/issue33053#msg313966, jwilk noted that it isn't obvious from https://docs.python.org/3/using/cmdline.html#cmdoption-m how to keep the current directory from being added to `sys.path` when using the -m switch. The answer is to

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-17 Thread Nick Coghlan
Nick Coghlan added the comment: I've also separated out https://bugs.python.org/issue33095 (a docs issue about making isolated mode more discoverable) based on the jwilk's comment that it wasn't clear how to disable the default "add the current directory to

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-17 Thread Nick Coghlan
Nick Coghlan added the comment: Regarding 2.7: if folks want this fixed on RHEL/CentOS, then they need to talk to Red Hat about it, not the upstream CPython devs. I used to work there, and was told multiple times by Red Hat executives that none of their customers actually used Python, so the

[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-17 Thread Nick Coghlan
Nick Coghlan added the comment: I'm going to abuse the "third party" resolution type a bit and mark this as closed (at least for now) on the basis of "use setuptools instead if you want the improved behaviour". I've also opened https://github.com/pypa/pa

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: "python -m mypkg.myscript" does the right thing as far as local packages are concerned, whereas "python -m mypkg/myscript.py" will set you up for double-import bugs. Note that you can almost always trigger arbitrary non-obvious code execut

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: https://bugs.python.org/issue13475 is the existing enhancement request to expose sys.path[0] management independently of the other execution isolation features. -- ___ Python tracker <https://bugs.python.

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2018-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: This question recently came up again over in https://bugs.python.org/issue33053#msg314040. With the assorted startup refactorings that were landed for 3.7, it likely makes sense to take another run at this for 3.8

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-19 Thread Nick Coghlan
Nick Coghlan added the comment: It occurs to me that there may be some additional unshared context here: the way `python -m pip` searches for the module to execute is much closer to the way Windows searches for a command like `pip` (i.e. current directory first) than it is to the way *nix

[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-20 Thread Nick Coghlan
Nick Coghlan added the comment: Donald made an interesting suggestion over on https://github.com/pypa/packaging-problems/issues/127#issuecomment-374401331, which was to have distutils stop overwriting the Author metadata with the Maintainer metadata when both are specified and instead emit a

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-20 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +5914 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33042> ___ ___ Python-bugs-list mai

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-20 Thread Nick Coghlan
Nick Coghlan added the comment: The linked PR has the draft test case for this - it goes beyond the ones I used to find the cause of the problem by actually checking that sys.warnoptions and sys._xoptions have been populated as expected

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-21 Thread Nick Coghlan
Nick Coghlan added the comment: (Adding the other import system maintainers to the nosy list, along with Ned as the release manager for 3.6 and 3.7) Summarizing my current thoughts on this: I think the fact that "-m" currently adds the empty directory as sys.path[0] instead of

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2018-03-21 Thread Nick Coghlan
Nick Coghlan added the comment: Over in https://bugs.python.org/issue33053#msg314192, I came up with `--basepath ` as another possible spelling (`--no-basepath` would then be an option for turning it off. The main argument *against* that name is that we use "base" to mean

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-21 Thread Nick Coghlan
Nick Coghlan added the comment: Thinking about PySys_AddWarnOptionUnicode a little further, I'm not sure we actually need to change anything in the implementation there - I think we can just make it clearer in the docs that *only* PySys_AddWarnOption is supported prior to Py_Initializ

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-22 Thread Nick Coghlan
Nick Coghlan added the comment: Brett or Eric, any chance one of you could run with this for 3.7b3? I already have a startup refactoring related regression that I'm aiming to have fixed before then. Thanks to Victor's refactoring work, there's at least a clear interception

[issue23203] Aliasing import of sub-{module, package} from the package raises AttributeError on import.

2018-03-22 Thread Nick Coghlan
Nick Coghlan added the comment: Heh, apparently I forgot how IMPORT_FROM currently works some time between 2015 and 2017 :) I agree this is out of date now, as the requested behaviour was already implemented for 3.7 -- resolution: -> out of date stage: -> resolved status

[issue22257] PEP 432: Redesign the interpreter startup sequence

2018-03-23 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, this is the issue for making the API public, so it will stay open until PEP 432 is actually accepted. We switched to the pre-implement-changes-as-an-internal-CPython-refactoring approach after we/I realised there was no feasible way to develop and

[issue33119] python sys.argv argument parsing not clear

2018-03-23 Thread Nick Coghlan
Nick Coghlan added the comment: This is deliberate, and is covered in the documentation at https://docs.python.org/3/using/cmdline.html#cmdoption-m where it says 'If this option is given, the first element of sys.argv will be the full path to the module file (while the module file is

[issue33131] Upgrade to pip 10 for Python 3.7

2018-03-24 Thread Nick Coghlan
New submission from Nick Coghlan : Paul brought up recently [1] that with pip 10.0.0 due for release next month [2], we'd really prefer to ship that in Python 3.7.0 (such that 3.7 launches with PEP 518/517 pyproject.toml support), rather than shipping with 9.0.x and then upgrading to 1

[issue33131] Upgrade to pip 10 for Python 3.7

2018-03-24 Thread Nick Coghlan
Nick Coghlan added the comment: Possibly - we implemented ensurepip the way we did just because it was the easiest option, not because we closely considered all the available approaches. That would be a separate process improvement issue, though

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-24 Thread Nick Coghlan
Nick Coghlan added the comment: PR has been updated to be mostly complete (just pending docs changes now), but I think I've found a potential issue with the interaction between the way I've currently implemented it and the way _Py_InitializeCore and _Py_InitializeMainInterp

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-24 Thread Nick Coghlan
Nick Coghlan added the comment: I added the new test case, and found to my surprise that it didn't fail, even in debug mode (where there aren't any default filters). The point I had missed was that even though warnoptions can be NULL in CoreConfig, _Py_MainInterpreterConfig_Read en

[issue33135] Define field prefixes for the various config structs

2018-03-24 Thread Nick Coghlan
New submission from Nick Coghlan : While working on https://bugs.python.org/issue33042, I found it hard to keep track of which kind of config struct a particular piece of code was referencing. As a particularly relevant example, we currently have 3 different "warnoptions" fields: t

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Change by Nick Coghlan : -- assignee: -> ncoghlan ___ Python tracker <https://bugs.python.org/issue33053> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Change by Nick Coghlan : -- keywords: +patch pull_requests: +5970 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: PR posted with the change to use an absolute path for the starting working directory in the "-m" case. That PR also includes a change to improve the fidelity of the test suite: back when I first wrote test_cmd_line_script, I was mainly focused on t

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: It turned out some tests in CPython's own test suite were implicitly relying on the old behaviour where the current working directory automatically ended up on sys.path (see the changes to test_bdb and test_doctest in the updat

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: While I've merged an initial fix for this (so it should be working again in 3.7.0b3), I'm not going to close the issue until folks have had a chance to review and comment on the linked list based approach I've taken. -- versio

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +5973 ___ Python tracker <https://bugs.python.org/issue33053> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: Initial fix has been merged to master, CI runs pending for the backport to 3.7 and a follow-up master branch PR to remove a debugging print I noticed when resolving a test_import conflict in the backport. I won't get to merging those until some time after

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +5974 ___ Python tracker <https://bugs.python.org/issue33053> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: 3.7 CI finished before I logged off for the night, so this is good to go for 3.7.0b3 now :) -- priority: release blocker -> normal ___ Python tracker <https://bugs.python.org/issu

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset a9e5d0e9ef27b14e34631d415e727a07d0f63bef by Nick Coghlan in branch 'master': bpo-33053: Remove test_cmd_line_script debugging print (GH-6237) https://github.com/python/cpython/commit/a9e5d0e9ef27b14e34631d415e727a

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: Marking as fixed, since this is now the version likely to go out in 3.7.0b3 - if we find further problems with it (beyond the potential enhancement discussed above to make local directory usage opt-in), then those can go in a new issue. -- resolution

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset bc77eff8b96be4f035e665ab35c1d06e22f46491 by Nick Coghlan in branch 'master': bpo-33042: Fix pre-initialization sys module configuration (GH-6157) https://github.com/python/cpython/commit/bc77eff8b96be4f035e665ab35c1d0

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b by Nick Coghlan in branch 'master': bpo-33053: -m now adds *starting* directory to sys.path (GH-6231) https://github.com/python/cpython/commit/d5d9e02dd3c6df06a8dd9ce75ee9b5

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset ee3784594b33c72c3fdca6a71892d22f14045ab6 by Nick Coghlan in branch '3.7': bpo-33053: -m now adds *starting* directory to sys.path (GH-6231) (#6236) https://github.com/python/cpython/commit/ee3784594b33c72c3fdca6a71892d2

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-26 Thread Nick Coghlan
Nick Coghlan added the comment: Harmut, thanks for the status update! Victor, the problem is that both sys.warnoptions and sys._xoptions get read by Py_Initialize(), so setting them afterwards is essentially pointless - while you do still change the contents of the sys attributes, doing so

[issue33042] New 3.7 startup sequence crashes PyInstaller

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

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-26 Thread Nick Coghlan
Nick Coghlan added the comment: Just noting that while I've closed this issue as fixed, I think we still have quite a bit of work to do to get our handling of these pre-init config settings to a place we're genuinely happy with (or as happy as backwards compatibility constrai

[issue33146] contextlib.suppress should capture exception for inspection and filter on substrings

2018-03-27 Thread Nick Coghlan
Nick Coghlan added the comment: I wouldn't expand the scope of contextlib.suppress, since it has a pretty clear purpose: pretend the exception never happened. (This was even clearer with the original "ignored" name, before I was talked into changing it to use the current m

[issue33165] Add stacklevel parameter to logging APIs

2018-03-28 Thread Nick Coghlan
New submission from Nick Coghlan : warnings.warn() offers a stacklevel parameter to make it easier to write helper functions that generate warnings - by passing "stacklevel=2", you can ensure the warning is attributed to the caller of the helper function, rather than to the helpe

[issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8

2018-03-28 Thread Nick Coghlan
Nick Coghlan added the comment: Given that issue 32002 and issue 30672 track the known challenges in testing the expected locale coercion behaviour reliably, I'm going to go ahead and close this overall implementation issue (the feature is there, and works in a way we're happy w

[issue33128] PathFinder is twice on sys.meta_path

2018-03-28 Thread Nick Coghlan
Nick Coghlan added the comment: Calling initexternalimports InitalizeMainInterpreter and from new_interpreter is right, since we only want these importers on the metapath after we know sys.path has been configured appropriately. It's the call from InitializeCore that's questionable

[issue33131] Upgrade to pip 10 for Python 3.7

2018-03-28 Thread Nick Coghlan
Nick Coghlan added the comment: It's a useful data point for folks trying to diagnose post-maintenance-update failures when we upgrade pip on their behalf, rather than them explicitly doing it themselves. -- ___ Python tracker &

[issue32380] functools.singledispatch interacts poorly with methods

2018-03-29 Thread Nick Coghlan
Nick Coghlan added the comment: Added Ɓukasz to the nosy list, as I'd like his +1 before accepting this change (I do still think it's a good idea, for the same reasons we added partialmethod). -- nosy: +lukasz.langa, ncoghlan ___ Pyth

<    19   20   21   22   23   24   25   26   27   28   >