[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-04-29 Thread Rahul Kumaresan


Rahul Kumaresan  added the comment:

Although the documentation for 'typing.NoReturn' is made in: 
https://github.com/python/cpython/pull/7107/files

The actual inclusion of the 'typing.NoReturn' was made through the following 
this PR: https://github.com/python/typing/pull/397

Also the change is registered in the changelog under Python 3.6.2 rc1 release 
as:
'''
bpo-28556: Various updates to typing module: add typing.NoReturn type, use 
WrapperDescriptorType, minor bug-fixes. Original PRs by Jim Fasarakis-Hilliard 
and Ivan Levkivskyi.
'''

So shouldn't the correct version here should be 3.6.2?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43976] Introduce mechanism to allow Python distributors to add custom site install schemes

2021-04-29 Thread Lumír Balhar

Change by Lumír Balhar :


--
nosy: +frenzy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15443] datetime module has no support for nanoseconds

2021-04-29 Thread mdcb


mdcb  added the comment:

In the confines of PTP / IEEE1588, it's actually quite common and can be 
useful. It's not so much the ns, but the <1us that is missing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43981] test_idle is leaking references

2021-04-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

test_squeezer.ExpandingButtonTest accounts for most of the leak.
python -m test -R3:3 -v -ugui -m *zer.Expand* test_idle
test_idle leaked [576, 576, 576] references, sum=1728
test_idle leaked [282, 282, 282] memory blocks, sum=846
All 6 methods failed.  I believe the difference [108, 108, 108] [0, 0, 0] would 
not be a failure.

Yesterday's patch, https://github.com/python/cpython/pull/22682/files,
only made what seems like a trivial change in 2 of the 6 methods. Only a name 
was changed in squeeze.py.  

Tal, any idea why these are leaking?

--
nosy: +taleinat
stage: patch review -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43817] Add inspect.get_annotations()

2021-04-29 Thread Larry Hastings


Larry Hastings  added the comment:

Thanks for your feedback, everybody!  It's now checked in.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43817] Add inspect.get_annotations()

2021-04-29 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset 74613a46fc79cacc88d3eae4105b12691cd4ba20 by larryhastings in 
branch 'master':
bpo-43817: Add inspect.get_annotations(). (#25522)
https://github.com/python/cpython/commit/74613a46fc79cacc88d3eae4105b12691cd4ba20


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-04-29 Thread Rahul Kumaresan


Change by Rahul Kumaresan :


--
nosy: +rahul-kumi

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit

2021-04-29 Thread Marwan Essam


Change by Marwan Essam :


--
nosy:  -Marwan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit

2021-04-29 Thread Marwan Essam


New submission from Marwan Essam :

Hello, 
While I was trying to install Python version 3.9.4 on Windows 10 64bit, Error 
0x80070643 - Fatal error during installation is showing, with a message saying 
" install the process cannot access the file because another process has locked 
a portion of the file", 

Note: There was an older version of Python installed on my laptop in 2018, but 
a while ago i did a system format, but some of the .XMl and .py files still 
there ( i don't know if that's the case)

Core_AllUsers (https://pastebin.com/iAZGTrkx)

--
components: Installation
files: Python 3.9.4 (64-bit)_20210430053233.log
messages: 392378
nosy: Marwan, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file5/Python 3.9.4 
(64-bit)_20210430053233.log

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43981] test_idle is leaking references

2021-04-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset a62e424de0c394cda178a8d934d06f0559b5e28d by Terry Jan Reedy in 
branch 'master':
bpo-43981: Fix error in idle-test leak test (GH-25739)
https://github.com/python/cpython/commit/a62e424de0c394cda178a8d934d06f0559b5e28d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43981] test_idle is leaking references

2021-04-29 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +24430
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25739

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43981] test_idle is leaking references

2021-04-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The only recently added tests are the 11 in test_sidebar.ShellSidebarTest.  
Leak testing just these with
  python -m test -R3:3 -ugui -m *Sidebar* test_idle
does not fail.  Leak test all of test_idle with
  >python -m test -R3:3 -v -ugui test_idle
ends after the second round with two error failures.

FAIL: test_menudefs (idlelib.idle_test.test_mainmenu.MainMenuTest)
--
Traceback (most recent call last):
  File "f:\dev\3x\lib\idlelib\idle_test\test_mainmenu.py", line 15, in 
test_menudefs
self.assertEqual(actual, expect)
AssertionError: Lists differ:
  ['application', 'file', 'edit', 'format', '[47 chars]elp'] !=
  ['file', 'edit', 'format', 'run', 'shell', [32 chars]elp']

The 'application' menu was by added by a call to macosx.setupApp, which calls 
overrideRootMenu, in ShellSidebarTest.setUpClass.  This call is not needed for 
this testcase, so the first PR replaces it with a comment referring to this 
issue.

Note: when test_macosc calls setupApp, overrideRootMenu is replaced with a mock.

The second execution of ShellSidebarTest.setUpClass failed with

ERROR: setUpClass (idlelib.idle_test.test_sidebar.ShellSidebarTest)
--
Traceback (most recent call last):
  File "f:\dev\3x\lib\idlelib\idle_test\test_sidebar.py", line 414, in 
setUpClass
cls.init_shell()
  File "f:\dev\3x\lib\idlelib\idle_test\test_sidebar.py", line 429, in 
init_shell
cls.shell = cls.flist.open_shell()
  File "f:\dev\3x\lib\idlelib\pyshell.py", line 334, in open_shell
self.pyshell = PyShell(self)
  File "f:\dev\3x\lib\idlelib\pyshell.py", line 890, in __init__
OutputWindow.__init__(self, flist, None, None)
  File "f:\dev\3x\lib\idlelib\outwin.py", line 79, in __init__
EditorWindow.__init__(self, *args)
  File "f:\dev\3x\lib\idlelib\editor.py", line 342, in __init__
self.update_menu_state('options', '*ode*ontext', 'disabled')
  File "f:\dev\3x\lib\idlelib\editor.py", line 488, in update_menu_state
menuitem.entryconfig(index, state=state)
  File "f:\dev\3x\lib\tkinter\__init__.py", line 3383, in entryconfigure
return self._configure(('entryconfigure', index), cnf, kw)
  File "f:\dev\3x\lib\tkinter\__init__.py", line 1660, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: bad menu entry index "*ode*ontext"

One of the things that overrideRootMenu does is to move the option setting 
item, above the code context item, to the application submenu.  I don't 
understand why this caused the failure above.  However, removing the setupApp 
call fixed this failure also.  The first PR does this.

With this fix, test_idle runs 6 times with leak report 
test_idle leaked [684, 684, 684] references, sum=2052
test_idle leaked [282, 282, 282] memory blocks, sum=846

With ShellSidebarTest skipped, the result is only slightly better.
test_idle leaked [684, 684, 665] references, sum=2033
test_idle leaked [282, 282, 283] memory blocks, sum=847

--
versions: +Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43951] Two minor fixes for C module object

2021-04-29 Thread Larry Hastings


Larry Hastings  added the comment:

Thanks for the review, Victor!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules

2021-04-29 Thread Larry Hastings


Larry Hastings  added the comment:

Thanks for your feedback and reviews, everybody!  Python just got an eensy 
teensy tiny bit better.

--
assignee:  -> larry
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules

2021-04-29 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset 2f2b69855d6524e15d12c15ddc0adce629e7de84 by larryhastings in 
branch 'master':
bpo-43901: Lazy-create an empty annotations dict in all unannotated user 
classes and modules (#25623)
https://github.com/python/cpython/commit/2f2b69855d6524e15d12c15ddc0adce629e7de84


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-29 Thread Ma Lin


Ma Lin  added the comment:

Found a backward incompatible behavior. 

Before the patch, in 64-bit build, zlib module allows the initial size > 
UINT32_MAX.
It creates a bytes object, and uses a sliding window to deal with the 
UINT32_MAX limit:
https://github.com/python/cpython/blob/v3.9.4/Modules/zlibmodule.c#L183

After the patch, when init_size > UINT32_MAX, it raises a ValueError.

PR 25738 fixes this backward incompatibility.
If the initial size > UINT32_MAX, it clamps to UINT32_MAX, rather than raising 
an exception.

Moreover, if you don't mind, I would like to take this opportunity to rename 
the wrapper functions from Buffer_* to OutputBuffer_*, so that the readers can 
easily distinguish between input buffer and output buffer.
If you don't think it's necessary, you may merge PR 25738 as is.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-29 Thread Ma Lin


Change by Ma Lin :


--
pull_requests: +24429
pull_request: https://github.com/python/cpython/pull/25738

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36077] Inheritance dataclasses fields and default init statement

2021-04-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm going to close this in favor of the kw_only work done in issue 43532. I 
realize they're not quite the same thing, but we'll see how it works out in 
Python 3.10, and possibly make adjustments when we have some real world 
experience.

--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42800] Traceback objects allow accessing frame objects without triggering audit hooks

2021-04-29 Thread Steve Dower


Steve Dower  added the comment:

The 3.9 backport is a bit different from what's in master, so would appreciate 
someone double-check it. It should go back to 3.8 just fine.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43979] Simplify urllib.parse_qsl

2021-04-29 Thread robertohueso


robertohueso  added the comment:

Seems like a nice simplification to me. Can I open PR? :)

--
nosy: +robertohueso

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42800] Traceback objects allow accessing frame objects without triggering audit hooks

2021-04-29 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +24428
pull_request: https://github.com/python/cpython/pull/25737

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43892] Make match patterns explicit in the AST

2021-04-29 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset dbe60ee09dc5a624cfb78dff61ecf050a5b3f105 by Brandt Bucher in 
branch 'master':
bpo-43892: Validate the first term of complex literal value patterns (GH-25735)
https://github.com/python/cpython/commit/dbe60ee09dc5a624cfb78dff61ecf050a5b3f105


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43976] Introduce mechanism to allow Python distributors to add custom site install schemes

2021-04-29 Thread Filipe Laíns

Filipe Laíns  added the comment:

Making sysconfig look at sitecustomize seems like the wrong approach. It is 
behavior I would never expect, and there are use-cases where I still want the 
schemes to be present when the site module initialization is disabled.

I would also argue that having this mechanism available will be useful for 
other things.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43982] Code coverage on the CI: validate codecov shell script checksum

2021-04-29 Thread Ned Deily


Ned Deily  added the comment:

I agree that we should just remove the code coverage runs rather than trying to 
improve their security. It seems to me to be rude of us to use so much of the 
open source build resources for an activity that appears to have little benefit.

--
nosy: +ned.deily

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42800] Traceback objects allow accessing frame objects without triggering audit hooks

2021-04-29 Thread Steve Dower


Steve Dower  added the comment:


New changeset 87655e2cf58c543914ea05ebe5a0377441da1ef2 by Steve Dower in branch 
'master':
bpo-42800: Rename AUDIT_READ to PY_AUDIT_READ (GH-25736)
https://github.com/python/cpython/commit/87655e2cf58c543914ea05ebe5a0377441da1ef2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42904] get_type_hints does not provide localns for classes

2021-04-29 Thread Ken Jin


Ken Jin  added the comment:

Hmm I think you're right - the normal behavior in Python is for local
variables to shadow global variables, and as a user I expect the same for
eval in inspect.get_annotation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42800] Traceback objects allow accessing frame objects without triggering audit hooks

2021-04-29 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +24427
pull_request: https://github.com/python/cpython/pull/25736

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43982] Code coverage on the CI: validate codecov shell script checksum

2021-04-29 Thread Ammar Askar


Ammar Askar  added the comment:

See also https://github.com/python/cpython/pull/25679 where we're proposing 
just removing the coverage build altogether.

--
nosy: +ammar2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43982] Code coverage on the CI: validate codecov shell script checksum

2021-04-29 Thread STINNER Victor


New submission from STINNER Victor :

Currently, GitHub Action and Travis CI run a codecov bash downloaded from 
https://codecov.io/bash without validating it.

The script was recently compromised:
https://about.codecov.io/security-update/

We should validate the shell script integrity by checking its checksum. Example 
from the documentation:
-
curl -s https://codecov.io/bash > codecov;
VERSION=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);
for i in 1 256 512
do
  shasum -a $i -c --ignore-missing <(curl -s 
"https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM;) 
||
  shasum -a $i -c <(curl -s 
"https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM;)
done
-

See: https://docs.codecov.io/docs/about-the-codecov-bash-uploader

--
components: Tests
messages: 392362
nosy: vstinner
priority: normal
severity: normal
status: open
title: Code coverage on the CI: validate codecov shell script checksum
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42800] Traceback objects allow accessing frame objects without triggering audit hooks

2021-04-29 Thread Steve Dower


Steve Dower  added the comment:

Sure, I can do that.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42800] Traceback objects allow accessing frame objects without triggering audit hooks

2021-04-29 Thread STINNER Victor


STINNER Victor  added the comment:

Can you please rename AUDIT_READ to PY_AUDIT_READ? We should avoid adding 
symbols without Py/PY prefix to the Python C API.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42800] Traceback objects allow accessing frame objects without triggering audit hooks

2021-04-29 Thread Steve Dower


Steve Dower  added the comment:


New changeset 9a2c2a9ec3140b6c54c9ef9d994311f114128ee3 by Ryan Hileman in 
branch 'master':
bpo-42800: add audit hooks for f_code and tb_frame (GH-24182)
https://github.com/python/cpython/commit/9a2c2a9ec3140b6c54c9ef9d994311f114128ee3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40379] multiprocessing's default start method of fork()-without-exec() is broken

2021-04-29 Thread Andrew Duncan


Andrew Duncan  added the comment:

I just ran into and fixed (thanks to itamarst's blog post) a problem likely 
related to this.

Multiprocessing workers performing work and sending a logging message back with 
success/fail info. I had a few intermittent deadlocks that became a recurring 
problem when I sped up the process that skipped tasks which had previously 
completed (I think this shortened the time between forking and attempting to 
send messages causing the third process to deadlock). After changing that it 
deadlocked *every time*.

Switching to "spawn" at the top of the main function has fixed it.

--
nosy: +aduncan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43892] Make match patterns explicit in the AST

2021-04-29 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +24426
pull_request: https://github.com/python/cpython/pull/25735

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths

2021-04-29 Thread Steve Dower


Steve Dower  added the comment:

I think Eryk's point is that the behaviour is correct, and it's unfortunate 
that certain tools use realpath() when they don't actually mean it (I've been 
bitten by this too with pytest).

Presumably you want to replace realpath with abspath?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43977] Implement the latest semantics for PEP 634 for matching collections

2021-04-29 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +24425
pull_request: https://github.com/python/cpython/pull/25734

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43916] Check that new heap types cannot be created uninitialised

2021-04-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +24424
pull_request: https://github.com/python/cpython/pull/25733

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43980] netrc module looks for .netrc even on Windows where the convention is _netrc

2021-04-29 Thread Jerry Heiselman


Jerry Heiselman  added the comment:

The netrc file has no formal standard, but the following supports the claim of 
its conventional naming.

Excerpt from https://curl.se/docs/manpage.html#-n:
"Makes curl scan the .netrc (_netrc on Windows) file in the user's home 
directory for login name and password."

Excerpt from https://www.labkey.org/Documentation/wiki-page.view?name=netrc:
"On a Mac, UNIX, or Linux system the netrc file should be named .netrc (dot 
netrc) and on Windows it should be named _netrc (underscore netrc)."

And a 9+ year old stack overflow post indicating that the use of _netrc on 
Windows is quite well established and has been for some time. I know it's not 
authoritative, but it does establish the length of history for this.
https://stackoverflow.com/questions/6031214/git-how-to-use-netrc-file-on-windows-to-save-user-and-password

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43980] netrc module looks for .netrc even on Windows where the convention is _netrc

2021-04-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This is a behaviour change not a simple bug fix. 3.6 through 3.9 are all in 
feature-freeze, and we're days away from the same for 3.10.

Not that I don't believe you about the _netrc convention on Windows, but do you 
have a link to a reliable source documenting that?

--
nosy: +steven.daprano
type: behavior -> enhancement
versions:  -Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43981] test_idle is leaking references

2021-04-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Marking this as a release blocker

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43981] test_idle is leaking references

2021-04-29 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

See for example:

https://buildbot.python.org/all/#/builders/511/builds/10/steps/4/logs/stdio

test_idle leaked [684, 684, 684] references, sum=2052
test_idle leaked [282, 282, 282] memory blocks, sum=846

--
assignee: terry.reedy
components: IDLE
messages: 392353
nosy: pablogsal, terry.reedy
priority: release blocker
severity: normal
status: open
title: test_idle is leaking references

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Eryk Sun


Eryk Sun  added the comment:

> What is the name of the new function introduced in Windows 10 NT API? 
> Should we use it if the version is detected as Windows 10 (through a
> callback to a platform function or through GetVersion API)?

No, _bootstrap_external._write_atomic() or py_compile.compile() could implement 
the typical retry with exponential backoff to address a race condition. 
Otherwise I don't see what could be done currently in the main code. It would 
have to be addressed in the test code.

Regarding the new support for POSIX semantics, the base NT API isn't organized 
as a separate function for every operation or query, so it's not a new function 
name per se. Each kernel object type (e.g. File) has many information classes 
and a few query/set functions such as NtQueryInformationFile() and 
NtSetInformationFile(). Windows 10 added file information classes that support 
the ability to replace/unlink an open file, including FileLinkInformationEx 
(link), FileRenameInformationEx (relink), and FileDispositionInformationEx 
(unlink). WinAPI DeleteFileW() and RemoveDirectoryW() were updated to use the 
latter. I expect that CreateHardlinkW() and MoveFileExW() will be updated as 
well. It's only POSIX-'ish' semantics because the shared read-write-delete 
model is deeply ingrained in the NT file API. Opens have to opt in by sharing 
delete access, and most don't.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42904] get_type_hints does not provide localns for classes

2021-04-29 Thread Larry Hastings


Larry Hastings  added the comment:

Thank you for your in-depth and thoughtful reply!

I think that APIs should behave in a predictable way.  So, for my use case, I 
tell the user that I'm passing "globals" and "locals" into eval()--and I think 
I'd have to have a *very* compelling reason to swap them.  Since I don't have 
the backwards-compatibility problem you do, I think I should keep it simple and 
predictable and not swap them.

In reference to your example, I think it's natural enough that the A defined 
inside B eclipses the module-level A.  That's what the user would *expect* to 
happen.  If the user really wants to reference the module-level A, they have 
lots of options:

  * rename one or the other A to something else
  * establish an alias at module scope, and use that
  * explicitly say globals()['A']

So I'm not worried about it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43976] Introduce mechanism to allow Python distributors to add custom site install schemes

2021-04-29 Thread Steve Dower


Steve Dower  added the comment:

Any reason this couldn't be in sitecustomize.py? Either by poking values into 
sysconfig directly (for back-compat) or we train sysconfig to look inside 
sitecustomize for a well-known name.

--
nosy: +steve.dower

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43980] netrc module looks for .netrc even on Windows where the convention is _netrc

2021-04-29 Thread Jerry Heiselman


Jerry Heiselman  added the comment:

Created a simple PR to correct this.

--
keywords: +patch
message_count: 1.0 -> 2.0
pull_requests: +24423
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25732

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43980] netrc module looks for .netrc even on Windows where the convention is _netrc

2021-04-29 Thread Jerry Heiselman


New submission from Jerry Heiselman :

The netrc library defaults to looking for the .netrc file in the user's home 
directory. On Windows, this file is conventionally named _netrc. While one 
could pass the correct path to the library, the conventionally correct path 
should be used on all supported platforms.

--
components: Library (Lib)
messages: 392348
nosy: jheiselman
priority: normal
severity: normal
status: open
title: netrc module looks for .netrc even on Windows where the convention is 
_netrc
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43969] "bad magic number" when Python 2's pyc file exists without py file

2021-04-29 Thread Mitchell Hentges


Mitchell Hentges  added the comment:

Looking closer into this, it appears that Python 3 will still try to load 
non-__pycache__ `.pyc` files. Perhaps I'm missing context, but aren't those 
only supposed by to written and read by Python 2?

Location where `pyc` loader is registered: 
https://github.com/python/cpython/blob/v3.9.4/Lib/importlib/_bootstrap_external.py#L1571-L1572
Location where `__pycache__` loading happens is part of SourceFileLoader here: 
https://github.com/python/cpython/blob/v3.9.4/Lib/importlib/_bootstrap_external.py#L870

I'll attach a patch to remove this pyc-loading for convenience, but I don't 
have enough context to be confident that it's the correct solution.

--
keywords: +patch
message_count: 1.0 -> 2.0
pull_requests: +24422
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25731

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

What is the name of the new function introduced in Windows 10 NT API? Should we 
use it if the version is detected as Windows 10 (through a callback to a 
platform function or through GetVersion API)?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43979] Simplify urllib.parse_qsl

2021-04-29 Thread Christoph Zwerschke


New submission from Christoph Zwerschke :

Just noticed the following code in urrlib.parse_qsl:

pairs = [s1 for s1 in qs.split(separator)]
for name_value in pairs:
...

see 
https://github.com/python/cpython/blob/088a15c49d99ecb4c3bef93f8f40dd513c6cae3b/Lib/urllib/parse.py#L755

This looks like an unnecessary list comprehension to me, probably a relic of 
earlier code that used a nested list comprehension for splitting with two 
different separators.

Can't we just do this instead now, which is faster and shorter?

   for name_value qs.split(separator):

I can provide a PR if wanted.

--
components: Library (Lib)
messages: 392345
nosy: cito
priority: normal
severity: normal
status: open
title: Simplify urllib.parse_qsl
type: performance
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Eryk Sun


Eryk Sun  added the comment:

> I don't know enough about when and why CPython decides to 
> replace .pyc files 

It's straight-forward in the case of py_compile.compile():

>>> pyc = py_compile.compile('test.py')
>>> f = open(pyc)
>>> try: py_compile.compile('test.py')
... except OSError as e: print(e)
...
[WinError 5] Access is denied: 
'__pycache__\\test.cpython-310.pyc.1914201873840' -> 
'__pycache__\\test.cpython-310.pyc'

Rewriting the file uses `importlib._bootstrap_external._write_atomic()`, which 
writes the PYC to a temporary name and then tries to replace the existing file 
via os.replace(). 

Replacing an existing filename will fail with access denied in Windows if the 
target filename exists and is already open, mapped as image/data, readonly, or 
a directory. Notably it's not a sharing violation in the case of an open file, 
which means it doesn't matter whether the open(s) share delete access or not. 
In Windows 10 the NT API has a new file rename operation that supports a flag 
to replace an open file, but in this case we're still stuck with the problem 
that existing opens have to share delete access. Most opens could share delete 
access without a problem, but most don't.

--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 3.10, Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-04-29 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b by Mark Shannon in 
branch 'master':
bpo-43933: Show frame.f_lineno as None, rather than -1, if there is no line 
number. (GH-25717)
https://github.com/python/cpython/commit/088a15c49d99ecb4c3bef93f8f40dd513c6cae3b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42589] doc: Wrong "from" keyword link in Exceptions doc

2021-04-29 Thread miss-islington


miss-islington  added the comment:


New changeset 3eaa6f9d185f2a2c66d98a77d3ea3f407bc96d0e by Miss Islington (bot) 
in branch '3.9':
bpo-42589: Change URL for 'from' link when used in a raised exception (GH-23872)
https://github.com/python/cpython/commit/3eaa6f9d185f2a2c66d98a77d3ea3f407bc96d0e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-04-29 Thread Mariatta


New submission from Mariatta :

We received a documentation bug report in docs mailing list.

https://mail.python.org/archives/list/d...@python.org/thread/BLANNZUPUEOJ4LJYSJNNFLK5I7NYE3GH/#

It looks like the doc currently says that, typing.NoReturn was added in both 
3.5.4 and 3.6.2

It appeared from this change, that it was originally added in 3.6.5 
(https://github.com/python/cpython/pull/7107/files)

However, during a refactoring effort, in 
https://github.com/python/cpython/commit/ab72fdeb82c3ab045b480cd4bb4f928c12653ecb,
 the 3.5.4 and 3.6.2 info were added, perhaps due to copy-pasting.

I think it should be changed into .. versionadded:: 3.6.5

However, I'm curious to know whether there are other parts in the doc, where 
this info is wrong. So perhaps there was other parts of the doc that was added 
in 3.5.4, but somehow we moved that to the typing.NoReturn section.

For now, I think we can just fix it by adding .. versionadded: 3.6.5

And maybe someone else can look into other parts of the doc to see if the 
version info are correct.

--
assignee: docs@python
components: Documentation
keywords: easy, newcomer friendly
messages: 392341
nosy: Mariatta, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: Incorrect "versionadded" info in typing.NoReturn documentation
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42589] doc: Wrong "from" keyword link in Exceptions doc

2021-04-29 Thread Mariatta


Mariatta  added the comment:

Thanks for the PR. There is conflict with applying it to the 3.8 branch. If you 
can get to it, it would be great. Thanks.

--
nosy: +Mariatta
stage: patch review -> backport needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42589] doc: Wrong "from" keyword link in Exceptions doc

2021-04-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24421
pull_request: https://github.com/python/cpython/pull/25730

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42589] doc: Wrong "from" keyword link in Exceptions doc

2021-04-29 Thread miss-islington


miss-islington  added the comment:


New changeset 2fd928c8c1328424130cb9c51fc02ad5f9a66328 by sblondon in branch 
'master':
bpo-42589: Change URL for 'from' link when used in a raised exception (GH-23872)
https://github.com/python/cpython/commit/2fd928c8c1328424130cb9c51fc02ad5f9a66328


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-04-29 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset 491fde0161d5e527eeff8586dd3972d7d3a631a7 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-43882 - urllib.parse should sanitize urls containing ASCII newline 
and tabs. (GH-25595) (GH-25725)
https://github.com/python/cpython/commit/491fde0161d5e527eeff8586dd3972d7d3a631a7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Tim Peters


Tim Peters  added the comment:

A "good" solution would be one that runs the test in such a way that it doesn't 
fail only on Windows ;-)

There are presumably many ways that could be accomplished, including ugly ones. 
For example, if test_compileall is in the collection of tests to be run, and 
it's a parallel run, run it first by itself, before starting anything else in 
parallel.

No, I'm not suggesting we do that. Just trying to get across that there are 
_always_ ways to worm around the bug du jour.

I don't know enough about when and why CPython decides to replace .pyc files 
now to make another suggestion worth anyone else's time to evaluate. Victor 
already has something else in mind, though.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43977] Implement the latest semantics for PEP 634 for matching collections

2021-04-29 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

What should we do? Should we skip test_compileall if the test suite is run in 
parallel?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Tim Peters


Tim Peters  added the comment:

@Sheyvan, whether it's possible to delete (rename, etc) an open file is a 
property not of Python, but of the operating system. Windows doesn't allow it; 
Linux (for example) does.

It's generally considered to be "a bug" in CPython's implementation whenever it 
contains code that _assumes_ such things are safe (which is, alas, very easy 
for a Linux programmer to do by accident).

So that test_compileall fails in this way is inarguably "a bug". Guido's larger 
point is harder to address, though. In theory, we control everything our test 
suite does, but little of what arbitrary users do.

--
nosy: +tim.peters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-04-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +24417
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25725

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-04-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24420
pull_request: https://github.com/python/cpython/pull/25728

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-04-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24419
pull_request: https://github.com/python/cpython/pull/25727

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-04-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24418
pull_request: https://github.com/python/cpython/pull/25726

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-04-29 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset 76cd81d60310d65d01f9d7b48a8985d8ab89c8b4 by Senthil Kumaran in 
branch 'master':
bpo-43882 - urllib.parse should sanitize urls containing ASCII newline and 
tabs. (GH-25595)
https://github.com/python/cpython/commit/76cd81d60310d65d01f9d7b48a8985d8ab89c8b4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43974] setup.py should set Py_BUILD_CORE_MODULE as defined macro

2021-04-29 Thread STINNER Victor


STINNER Victor  added the comment:

> It looks like we can also cleanup Modules/Setup and remove 
> -DPy_BUILD_CORE_BUILTIN and -DPy_BUILD_CORE_MODULE. Modules/makesetup adds 
> $PY_BUILTIN_MODULE_CFLAGS in the compile step.

Oh, I didn't notice.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43974] setup.py should set Py_BUILD_CORE_MODULE as defined macro

2021-04-29 Thread STINNER Victor


STINNER Victor  added the comment:

I would prefer to limit the usage of the internal C API in extension modules 
built as dynamic libraries. See bpo-4: "[C API] Convert a few stdlib 
extensions to the limited C API (PEP 384)".

Also, this issue is motived by PR 25653 which requires to use the internal C 
API in many C extensions. But I proposed a different approach, PR 25710, which 
prevents that.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43565] PyUnicode_KIND macro does not has specified return type

2021-04-29 Thread Ammar Askar


Change by Ammar Askar :


--
keywords: +patch
nosy: +ammar2
nosy_count: 4.0 -> 5.0
pull_requests: +24416
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25724

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41282] Deprecate and remove distutils

2021-04-29 Thread Filipe Laíns

Filipe Laíns  added the comment:

We have discussed this approach a little in a few bug trackers, but I opened 
https://discuss.python.org/t/mechanism-for-distributors-to-add-site-install-schemes-to-python-installations/8467.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43977] Implement the latest semantics for PEP 634 for matching collections

2021-04-29 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +24415
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25723

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43977] Implement the latest semantics for PEP 634 for matching collections

2021-04-29 Thread Mark Shannon


New submission from Mark Shannon :

PEP 634 has been updated to allow a faster and more robust implementation of 
matching sequences and mappings: https://github.com/python/peps/pull/1937

It needs to be implemented.

--
assignee: Mark.Shannon
messages: 392330
nosy: Mark.Shannon
priority: high
severity: normal
status: open
title: Implement the latest semantics for PEP 634 for matching collections

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41282] Deprecate and remove distutils

2021-04-29 Thread Paul Moore


Paul Moore  added the comment:

I'd suggest also posting it on the Packaging discourse, to get feedback from 
other distro maintainers.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43614] Search is not beginner friendly

2021-04-29 Thread Ammar Askar


Ammar Askar  added the comment:

Just a little update to this, now that issue34398 is fixed it is possible to 
make this more beginner friendly by making sure the right terms have glossary 
entries.

As an example, here is a search for "argument" on the latest docs:

https://docs.python.org/3.10/search.html?q=argument

It would be nice if kwargs/args could also point to that.

--
nosy: +ammar2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41282] Deprecate and remove distutils

2021-04-29 Thread Filipe Laíns

Filipe Laíns  added the comment:

That is reasonable. I have created bpo-43976.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43976] Introduce mechanism to allow Python distributors to add custom site install schemes

2021-04-29 Thread Filipe Laíns

New submission from Filipe Laíns :

As part of the distutils migration we plan to add a mechanism to let Python 
distributors to add site install schemes.

Currently, Python distributors are patching distutils to add custom install 
schemes for their packages. I think most of the reasoning boils down to them 
wanting to stop Python installers, such as pip, to modify/interfere with their 
packages.

With the distutils deprecation, and it becoming a 3rd party module, Python 
distributors can no longer patch it. Because of this, we made distutils use the 
sysconfig module instead, which fixes the issue at the moment -- Python 
distributors can now patch sysconfig itself -- but is not a long term solution.
To prevent Python distributors from having to patch implementation details, and 
have things break unexpectedly, we aim to introduce a system that distributors 
can use for this purpose.

The idea is that they have a config file, which they can pass to configure, and 
in that config file they can specify some extra install schemes. These install 
schemes will get added in sysconfig, and will be loaded in the site module 
initialization.

In practice, it will look something like this:

config.py
```
EXTRA_SITE_INSTALL_SCHEMES = {
'posix_prefix': {
'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}',
'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}',
'purelib': '{base}/lib/python{py_version_short}/vendor-packages',
'platlib': 
'{platbase}/{platlibdir}/python{py_version_short}/vendor-packages',
'include':
'{installed_base}/include/python{py_version_short}{abiflags}',
'platinclude':
'{installed_platbase}/include/python{py_version_short}{abiflags}',
'scripts': '{base}/bin',
'data': '{base}',
},
}
```

./configure --with-vendor-config=config.py

--
components: Library (Lib)
messages: 392326
nosy: FFY00, jaraco
priority: normal
pull_requests: 24414
severity: normal
status: open
title: Introduce mechanism to allow Python distributors to add custom site 
install schemes
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-04-29 Thread Guido van Rossum

Guido van Rossum  added the comment:

I don’t think we’re waiting for more crazy hacks.

On Thu, Apr 29, 2021 at 07:27 STINNER Victor  wrote:

>
> STINNER Victor  added the comment:
>
> >
> https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403
>
> In the past, I used _random.Random for manual tests to compare static type
> and heap types, check which one is mutable.
>
> C type _random.Random is inherited by Python type random.Random which is
> mutable. Since _random.Random is not directly seen by developers, I don't
> think that it's worth it to make it immutable.
>
> For the other types, I would not say that they are "built-in types" or
> that it would be really bad to modify them. I would say that for the other
> types, the "We are consenting adults" rule stands. You can hack a type for
> a very specific need, but in this case you are on your own.
>
> For example, people love to hack AST. Maybe the fact that ast.AST became
> mutable in Python 3.9 will unlock some crazy hack?
>
> --
>
> ___
> Python tracker 
> 
> ___
>
-- 
--Guido (mobile)

--
title: array.array and re types must be immutable: add Py_TPFLAGS_IMMUTABLETYPE 
flag -> array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43908] array.array and re types must be immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-04-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

That is as intended, right?

On Thu, Apr 29, 2021 at 07:59 STINNER Victor  wrote:

>
> STINNER Victor  added the comment:
>
> check_set_special_type_attr() is used to prevent setting the following
> attributes:
>
> * __name__
> * __qualname__
> * __module__
> * __bases__
> * __doc__
>
> Right now, I cannot set the attribues on array.array type:
>
> $ ./python
> Python 3.10.0a7+ (heads/debug_doc2-dirty:0623fdb60d, Apr 29 2021, 12:06:18)
> >>> import array
>
> >>> array.array.__name__ = 'newname'
> TypeError: can't set attributes of built-in/extension type 'array.array'
>
> >>> array.array.__qualname__ = 'newname'
> TypeError: can't set attributes of built-in/extension type 'array.array'
>
> >>> array.array.__module__ = 'new module'
> TypeError: can't set attributes of built-in/extension type 'array.array'
>
> >>> array.array.__bases__ = (int,)
> TypeError: can't set attributes of built-in/extension type 'array.array'
>
> >>> array.array.__doc__ = 'doc'
> TypeError: can't set attributes of built-in/extension type 'array.array'
>
> I guess that type_setattro() is used and it checks for
> Py_TPFLAGS_IMMUTABLETYPE flag early.
>
> --
>
> ___
> Python tracker 
> 
> ___
>
-- 
--Guido (mobile)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43916] Check that new heap types cannot be created uninitialised

2021-04-29 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +24413
pull_request: https://github.com/python/cpython/pull/25722

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

@vstinner What do you think? I'm not sure if there's a solution to this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41282] Deprecate and remove distutils

2021-04-29 Thread Éric Araujo

Éric Araujo  added the comment:

PR 25718 was opened and linked to this ticket.  It changes sysconfig to load 
install schemes from a separate module, so it’s not strictly about removing 
distutils but adding a new system customization feature.  I think it needs its 
own bug and mailing-list discussion with interested parties to make sure the 
interface works for them.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43916] Check that new heap types cannot be created uninitialised

2021-04-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +24412
pull_request: https://github.com/python/cpython/pull/25721

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42904] get_type_hints does not provide localns for classes

2021-04-29 Thread Ken Jin


Ken Jin  added the comment:

@larry
> Is this "surprising, but required" behavior due specifically to this being a 
> backwards-incompatible change?

Yes. That's the main factor. I've since learnt that there's sadly more to it 
though :( (see below).

> Does that mean I don't have the problem you're solving by reversing the order 
> of namespace lookup, and I can just pass globals and locals in like normal?

I think it depends on the ergonomics of the function you're trying to achieve. 
I admit I haven't been fully keeping up with the inspect.get_annotations issue 
(sorry!), but here's what I learnt from get_type_hints:

(Partly copied over from PR 25632)
Example:

from typing import TypeVar, Generic
T = TypeVar('T')

class A(Generic[T]):
__annotations__ = dict(
some_b='B'
)


class B(Generic[T]):
class A(Generic[T]):
pass
__annotations__ = dict(
my_inner_a1='B.A',
my_inner_a2=A,
my_outer_a='A'  # unless somebody calls get_type_hints with 
localns=B.__dict__
)

>>> get_type_hints(B)

Currently (globalns then localns):
{'my_inner_a1': , 'my_inner_a2': , 
'my_outer_a': }

Swapped (localns then globalns):
{'my_inner_a1': , 'my_inner_a2': , 
'my_outer_a': }

I realized that looking into globalns then localns is a necessary evil: doing 
the converse (looking into localns first then globalns) would mean there is no 
way to point to the shadowed global `A`: it would always point to the local 
`B.A`. Unless of course you pass in localns=module.__dict__ or 
localns=globals().

Ultimately I think it's a sacrifice of ergonomics either way; looking into 
localns then globalns will require passing in the module's __dict__ to refer to 
a global being shadowed, while the converse (globalns then localns) introduces 
surprising eval behavior. Both are kind of tacky, but globalns then localns is 
slightly less so IMO. If the user wants to specify the inner class, they can 
just annotate 'B.A', if they want the outer, it's 'A'. But the localns then 
globalns approach will always point to `B.A`, the only way to access the 
shadowed global `A` is to pass in the strange looking argument 
localns=module.__dict__.

Phew, my head's spinning with localns and globalns now. Thanks for reading! I 
think it's your call. I'm inexperienced with elegant function design :P.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43899] separate builtin function

2021-04-29 Thread Ammar Askar


Ammar Askar  added the comment:

Note that the `more_itertools` package on pypi also has a partition method.

Shall we close this off given that a recipe is already present and this is 
available as part of a popular 3rd-party library?

--
nosy: +ammar2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43922] Double dots in quopri transported emails

2021-04-29 Thread Julien Castiaux


Julien Castiaux  added the comment:

Hello David,

The third party smtp software that causes troubles have been identified ! We 
are still investigating how to fix the problem at its root, ultimately this 
"fix" would not even be necessary. I'll keep you informed, just don't review or 
close the PR yet.

Regards,

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43908] array.array and re types must be immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-04-29 Thread STINNER Victor


STINNER Victor  added the comment:

check_set_special_type_attr() is used to prevent setting the following 
attributes:

* __name__
* __qualname__
* __module__
* __bases__
* __doc__

Right now, I cannot set the attribues on array.array type:

$ ./python
Python 3.10.0a7+ (heads/debug_doc2-dirty:0623fdb60d, Apr 29 2021, 12:06:18)
>>> import array

>>> array.array.__name__ = 'newname'
TypeError: can't set attributes of built-in/extension type 'array.array'

>>> array.array.__qualname__ = 'newname'
TypeError: can't set attributes of built-in/extension type 'array.array'

>>> array.array.__module__ = 'new module'
TypeError: can't set attributes of built-in/extension type 'array.array'

>>> array.array.__bases__ = (int,)
TypeError: can't set attributes of built-in/extension type 'array.array'

>>> array.array.__doc__ = 'doc'
TypeError: can't set attributes of built-in/extension type 'array.array'

I guess that type_setattro() is used and it checks for Py_TPFLAGS_IMMUTABLETYPE 
flag early.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42904] get_type_hints does not provide localns for classes

2021-04-29 Thread Larry Hastings


Larry Hastings  added the comment:

kj: I just added support for default locals to inspect.get_annotation(), and I 
basically copied-and-pasted your dict(vars(base)) approach.

Is this "surprising, but required" behavior due specifically to this being a 
backwards-incompatible change? inspect.get_annotations() will be a new function 
in Python 3.10, which means I have no existing users to worry about. Does that 
mean I don't have the problem you're solving by reversing the order of 
namespace lookup, and I can just pass globals and locals in like normal?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43908] array.array and re types must be immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-04-29 Thread STINNER Victor


Change by STINNER Victor :


--
title: array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag 
-> array.array and re types must be immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-04-29 Thread STINNER Victor


STINNER Victor  added the comment:

> https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403

In the past, I used _random.Random for manual tests to compare static type and 
heap types, check which one is mutable.

C type _random.Random is inherited by Python type random.Random which is 
mutable. Since _random.Random is not directly seen by developers, I don't think 
that it's worth it to make it immutable.

For the other types, I would not say that they are "built-in types" or that it 
would be really bad to modify them. I would say that for the other types, the 
"We are consenting adults" rule stands. You can hack a type for a very specific 
need, but in this case you are on your own.

For example, people love to hack AST. Maybe the fact that ast.AST became 
mutable in Python 3.9 will unlock some crazy hack?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I don't think it's a bug at all. It's a feature of Python that's causing this. 
And since it's not a bug I don't think copying the files in temporary directory 
would help at all because Windows is not giving the error. Python is giving the 
error to Python itself!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-04-29 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

> check_set_special_type_attr() must also be updated to check for 
> Py_TPFLAGS_IMMUTABLETYPE flag.

Ok, lets just use this issue for the PR. I can fix it in an hour or so.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check

2021-04-29 Thread STINNER Victor


STINNER Victor  added the comment:

> IMO, we can drop most (all?) of the huge comment before the check in 
> object_set_class().

I don't think so. I don't understand why it's allowed to override the __class__ 
attribute of ModuleType instances whereas it's a static type. IMO the long 
comment remains useful and something should be done later to make the condition 
more generic, rather than checking PyType_IsSubtype(newto, _Type) 
specifically.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-04-29 Thread STINNER Victor


STINNER Victor  added the comment:

> Erlend: Do you want to write such change?

Erlend created bpo-43973 and PR 25714.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-04-29 Thread STINNER Victor


Change by STINNER Victor :


--
title: array.array should remain immutable -> array.array should remain 
immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43908] array.array should remain immutable

2021-04-29 Thread STINNER Victor


STINNER Victor  added the comment:

check_set_special_type_attr() must also be updated to check for 
Py_TPFLAGS_IMMUTABLETYPE flag.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2021-04-29 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I've experienced that when a module is imported in the interpreter that module 
file (.py, .pyc, .pyd) cannot be deleted, renamed, rewritten, etc.   When that 
session is closed only then the file can be deleted, renamed, rewritten, all 
that stuff. Running tests in parallel means running 2 or more tests at the same 
time right? Therefore may be when test_compileall tries to rewrite the .pyc it 
results in a error because the file may be open as a module in another test 
that is also being ran at the same time. This should also clarify why 
test_compileall fails randomly and not all the time.

--
nosy: +shreyanavigyan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40222] "Zero cost" exception handling

2021-04-29 Thread Mark Shannon


Mark Shannon  added the comment:

I've played around with a few formats, and what I've ended up with is this:

1. Use the >> marker for for exception targets, as well as normal branch 
targets.
2. Add a text version of the exception handler table at the end of the 
disassembly.

This has all the information, without too much visual clutter.

The function `f` above looks like this:
>>> dis.dis(f)
  2   0 NOP

  3   2 LOAD_CONST   1 (1)
  4 LOAD_CONST   2 (0)
  6 BINARY_TRUE_DIVIDE
  8 POP_TOP
 10 NOP
 12 LOAD_CONST   0 (None)
 14 RETURN_VALUE
>>   16 NOP
 18 PUSH_EXC_INFO

  4  20 POP_TOP
 22 POP_TOP
 24 POP_TOP

  5  26 NOP
 28 POP_EXCEPT
 30 LOAD_CONST   3 ('fail')
 32 RETURN_VALUE
>>   34 POP_EXCEPT_AND_RERAISE
ExceptionTable:
  2 to 8 -> 16 (depth 0)
  18 to 24 -> 34 (depth 3) lasti


The 'lasti' field indicates that the offset of the last instruction is pushed 
to the stack, which is needed for cleanup-then-reraise code.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

2021-04-29 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 14fc2bdfab857718429029e53ceffca456178827 by Petr Viktorin in 
branch 'master':
bpo-28254: Add PyGC_ functions to the stable ABI manifest (GH-25720)
https://github.com/python/cpython/commit/14fc2bdfab857718429029e53ceffca456178827


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32824] Docs: Using Python on a Macintosh has bad info per Apple site

2021-04-29 Thread Glenn Travis

Glenn Travis  added the comment:

Here is a copy of the Apple Python call as of April 29, 2021.  To my way of 
thinking it seems that Apple is saying that someday they will indeed eliminate 
all the included “scripting” software from macOS and they further imply that 
one should install an. Up-to-date version of one’s particular chosen software. 

Last login: Thu Apr 29 08:22:47 on console
% python

WARNING: Python 2.7 is not recommended. 
This version is included in macOS for compatibility with legacy software. 
Future versions of macOS will not include Python 2.7. 
Instead, it is recommended that you transition to using 'python3' from within 
Terminal.

Python 2.7.16 (default, Feb 28 2021, 12:34:25) 
[GCC Apple LLVM 12.0.5 (clang-1205.0.19.59.6) [+internal-os, ptrauth-isa=deploy 
on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
% exit
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

> On Apr 28, 2021, at 4:25 PM, Glenn Travis  wrote:
> 
> 
> Glenn Travis  added the comment:
> 
> I see that this remains alive. I do have a newer question. Apple continues to 
> say that they are going to drop all their included versions of python and I 
> believe ruby in some future version of macOS. I thought that this would 
> happen in Big Sur, but python versions 2.7.16 still remains with us, why, I 
> don’t know.
> 
>> On Apr 28, 2021, at 3:21 PM, Irit Katriel  wrote:
>> 
>> 
>> Change by Irit Katriel :
>> 
>> 
>> --
>> versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, 
>> Python 3.7, Python 3.8
>> 
>> ___
>> Python tracker 
>> 
>> ___
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40222] "Zero cost" exception handling

2021-04-29 Thread Mark Shannon


Mark Shannon  added the comment:

Responding to Serhiy's suggestions:
1 Add another column:
   Adding another column makes for lots of repetition in larger try blocks, and 
pushes useful information further to the right.
2 Add pseudo-instructions
  I find those misleading, as they aren't really there, and probably won't even 
correspond to the original SETUP_XXX instructions.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >