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

2020-07-14 Thread wyz23x2


Change by wyz23x2 :


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



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

2020-07-14 Thread Yongjik Kim


Yongjik Kim  added the comment:

Hi, sorry if I'm interrupting, but while we're at this, could we also not 
escape regex for "message" part?  (Or at least amend the documentation to 
clarify that the message part is literal string match?)

Currently, the docs on -W just say "The meaning of each of these fields is as 
described in The Warnings Filter" and then "The Warnings Filter" section says 
that the "message" field is a regex, but currently it's only true if you run 
warnings.filterwarnings() directly, and not if you use the -W option.

--
nosy: +Yongjik Kim

___
Python tracker 

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



[issue41285] memoryview does not support subclassing

2020-07-14 Thread Michiel de Hoon


Michiel de Hoon  added the comment:

Thank you, I have posted an explanation in the "Ideas" category of 
discuss.python.org.

--

___
Python tracker 

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



[issue33007] Objects referencing private-mangled names do not roundtrip properly under pickling.

2020-07-14 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 3.0 -> 4.0
pull_requests: +20623
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21480

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2020-07-14 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +20622
pull_request: https://github.com/python/cpython/pull/21479

___
Python tracker 

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



[issue41300] IDLE: add missing import io in iomenu.py

2020-07-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Your suggestion is correct.

A side issue is that the line numbers in the traceback are correct but the 
quoted text lines from iomenu (and only iomenu) are wrong, being from the line 
previous.  I will have to investigate this discrepancy.

After the patch, two weeks ago, for #41158, iomenu line 199 in save is
if self.writefile(self.filename):
line 232 in writefile is 
chars = self.encode(text)
line 291 in encode is
enc, _ = tokenize.detect_encoding(io.BytesIO(encoded).readline)
This is only tried if ascii encoding fails and require the addition of 'import 
io'.

Before I close this, I will try to add a unittest that similarly fails without 
the import added, as well as some others for other exit points.

--
stage:  -> test needed
title: IDLE: missing import io in iomenu.py -> IDLE: add missing import io in 
iomenu.py
type:  -> behavior
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



[issue41158] IDLE: rewrite the code for handling file encoding

2020-07-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#41300 reports that the new iomenu line 291
   enc, _ = tokenize.detect_encoding(io.BytesIO(encoded).readline)
fails without 'import io' added.  I should have tested more thoroughly.  I will 
fix and add tests there.

--

___
Python tracker 

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



[issue41296] unittest.mock: patched mocks do not propagate calls to parent when set via setattr

2020-07-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
stage:  -> 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



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2020-07-14 Thread paul j3


paul j3  added the comment:

I just realized if the subparser argument used 

default=argparse.SUPPRESS

it would not clobber values (default or user) set by the main parser.

(a 'store_true' would have to be replaced with a 'store_const' to do this)

--

___
Python tracker 

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



[issue41300] IDLE: missing import io in iomenu.py

2020-07-14 Thread nirinA raseliarison


New submission from nirinA raseliarison :

idle cannot save file with non ascii character, leading to:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib64/python3.8/tkinter/__init__.py", line 1883, in __call__
return self.func(*args)
  File "/usr/lib64/python3.8/idlelib/multicall.py", line 176, in handler
r = l[i](event)
  File "/usr/lib64/python3.8/idlelib/iomenu.py", line 199, in save
else:
  File "/usr/lib64/python3.8/idlelib/iomenu.py", line 232, in writefile
text = self.fixnewlines()
  File "/usr/lib64/python3.8/idlelib/iomenu.py", line 271, in encode
encoded = chars.encode('ascii', 'replace')
NameError: name 'io' is not defined

just adding `import io` seems to fix this.

--
assignee: terry.reedy
components: IDLE
messages: 373664
nosy: nirinA raseliarison, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: missing import io in iomenu.py

___
Python tracker 

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



[issue41297] Remove doctest import from heapq

2020-07-14 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I concur with Steven.

--
nosy: +rhettinger

___
Python tracker 

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



[issue41278] IDLE: Clarify some completion details in doc

2020-07-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Although a few keystrokes are omitted, I reproduced the examples and can 
explain the results by elaborating on my claims above.

0. Python starts execution in module '__main__', which initially contains only 
double underscore names (now 7).

1. If a module name is not in the user code main namespace, IDLE checks in 
sys.modules, which initially contains '__main__' and many others.

2. 'fetch_completions' returns two completion lists: big, with all appropriate 
names, and small, without underscore names.  If big is not empty, the initial 
display is small if not empty, else big. 

Hence, at startup, '__main__.' displays the big list with 7 dunder names 
because small is empty.  Assign to *any* 'normal' name, so that small contains 
1 name, and '__main__.' initially displays that 1 name.  There is nothing 
special about 'idlelib' here.

The above is true when editing.

3. When there is no Shell, there is no user process, the same as if one started 
IDLE with -n to never have a separate user process.  When there is no user 
process, completions are done in the IDLE GUI process, and its main module 
contains 'idlelib' from IDLE's startup imports.  So the small completion list 
contains 'idlelib'.

For '__main__.x' to run, there must be a previous 'import __main__'.  If one 
runs the editor code after entering import statements, as the doc recommends, a 
user process will be started.


*** I just edited the IDLE completion doc, but 1, 2, and 3 could be made 
clearer.  I am leaving this issue open to do so. ***

--
stage:  -> needs patch
title: Wrong Completion on Editing Mode of IDLE -> IDLE: Clarify some 
completion details in doc
type: behavior -> enhancement
versions: +Python 3.10 -Python 3.8

___
Python tracker 

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



[issue41297] Remove doctest import from heapq

2020-07-14 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

The idiom of a module running doctests on itself when executed as a script is a 
common idiom.

If modulegraph and pyinstaller can't cope a module importing another module 
from inside an if statement, that's a bug in them, not in the heapq module (and 
many others).

This requested change is a regression, taking away functionality. 3.8 and older 
are in feature freeze, so this could only apply to 3.9 and 3.10, and even then, 
I do not believe it should apply at all.

--
nosy: +steven.daprano
versions:  -Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue41299] Python3 threading.Event().wait time is twice as large as Python27

2020-07-14 Thread SD


New submission from SD :

The overhead in Python 3 for threading.Event().wait() is much larger than 
Python 2. I am trying to run a script at 60hz which worked correctly in Python2 
but does not in Python 3. Here is a minimal example to demonstrate: 

#!/usr/bin/env python

import threading
import time

def sample_thread(stop_ev):
while not stop_ev.is_set():
t2 = time.time() 
stop_ev.wait(0.01659945)
print((time.time() - t2))

def main():
stop_ev = threading.Event()
sample_t = threading.Thread(target=sample_thread, args=(stop_ev, ))
sample_t.start()

# Other stuff here, sleep is just dummy
time.sleep(14)

stop_ev.set()

print('End reached.')

if __name__ == '__main__':
main()

Python 2.7.0 consistently prints :

0.016599457
0.016599457
0.0170001983643
0.016599457
0.016599457
0.016599457
0.016599457
0.016599457

Python 3.8.2 waits much longer

0.031026363372802734
0.0320279598236084
0.031026363372802734
0.031026840209960938
0.031527042388916016
0.031026601791381836
0.03103041648864746
0.03302431106567383

--
messages: 373660
nosy: SD
priority: normal
severity: normal
status: open
title: Python3 threading.Event().wait time is twice as large as Python27
type: performance
versions: Python 3.8

___
Python tracker 

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



[issue41298] Enable handling logoff and shutdown Windows console events

2020-07-14 Thread Eryk Sun


New submission from Eryk Sun :

A console script should be able to handle Windows console logoff and shutdown 
events with relatively simple ctypes code, such as the following:

import ctypes
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)

CTRL_C_EVENT = 0
CTRL_BREAK_EVENT = 1
CTRL_CLOSE_EVENT = 2
CTRL_LOGOFF_EVENT = 5
CTRL_SHUTDOWN_EVENT = 6

@ctypes.WINFUNCTYPE(ctypes.c_int, ctypes.c_ulong)
def console_ctrl_handler(event):
if event == CTRL_SHUTDOWN_EVENT:
return handle_shutdown()
if event == CTRL_LOGOFF_EVENT:
return handle_logoff()
if event == CTRL_CLOSE_EVENT:
return handle_close()
if event == CTRL_BREAK_EVENT:
return handle_break()
if event == CTRL_C_EVENT:
return handle_cancel()
return False # chain to next handler

if not kernel32.SetConsoleCtrlHandler(console_ctrl_handler, True):
raise ctypes.WinError(ctypes.get_last_error())

As of 3.9, it's not possible for python.exe to receive the above logoff and 
shutdown events via ctypes. In these two cases, the console doesn't even get to 
send a close event, so a console script cannot exit gracefully.

The session server (csrss.exe) doesn't send the logoff and shutdown console 
events to python.exe because it's seen as a GUI process, which is expected to 
handle WM_QUERYENDSESSION and WM_ENDSESSION instead. That requires creating a 
hidden window and running a message loop, which is not nearly as simple as a 
console control handler.

The system registers python.exe as a GUI process because user32.dll is loaded, 
which means the process is ready to interact with the desktop in every way, 
except for the final step of actually creating UI objects. In particular, 
loading user32.dll causes the system to extend the process and its threads with 
additional kernel data structures for use by win32k.sys (e.g. a message queue 
for each thread). It also opens handles for and connects to the session's 
"WinSta0" interactive window station (a container for an atom table, clipboard, 
and desktops) and "Default" desktop (a container for UI objects such as 
windows, menus, and hooks). (The process can connect to a different desktop or 
window station if set in the lpDesktop field of the process startup info. Also, 
if the process access token is for a service or batch logon, by default it 
connects to a non-interactive window station that's named for the logon ID. For 
example, the SYSTEM logon ID is 0x3e7, so a SYSTEM service or batch pro
 cess gets connected to "Service-0x0-3e7$".)

Prior to 3.9, python3x.dll loads shlwapi.dll (the lightweight shell API) to 
access the Windows path functions PathCanonicalizeW and PathCombineW. 
shlwapi.dll in turn loads user32.dll. 3.9+ is one step closer to the non-GUI 
goal because it no longer depends on shlwapi.dll. Instead it always uses the 
newer PathCchCanonicalizeEx and PathCchCombineEx functions from 
api-ms-win-core-path-l1-1-0.dll, which is implemented by the base API 
(kernelbase.dll) instead of the shell API. 

The next hurdle is extension modules, especially the _ctypes extension module, 
since it's needed for the console control handler. _ctypes.pyd loads ole32.dll, 
which in turn loads user32.dll. This is just to call ProgIDFromCLSID, which is 
rarely used. I see no reason that ole32.dll can't be delay loaded or just 
manually link to ProgIDFromCLSID on first use via GetModuleHandleW / 
LoadLibraryExW and GetProcAddress. I did a quick patch to implement the latter, 
and, since user32.dll no longer gets loaded, the console control handler is 
enabled for console logoff and shutdown events. So this is the minimal fix to 
resolve this issue in 3.9+.

--- 
Additional modules

winsound loads user32.dll for MessageBeep. The Beep and PlaySound functions 
don't require user32.dll, so winsound is still useful if it gets delay loaded. 

_ssl and _hashlib depend on libcrypto, which loads user32.dll for MessageBoxW, 
GetProcessWindowStation and GetUserObjectInformationW. The latter two are 
called in OPENSSL_isservice [1] in order to get the window station name. If 
StandardError isn't a valid file handle, OPENSSL_isservice determines whether 
an error should be reported as an event or interactively shown with a message 
box. user32.dll can be delay loaded for this, which, if I'm reading the source 
right, will never occur as long as StandardError is a valid file.
 
[1]: 
https://github.com/openssl/openssl/blob/e7fb44e7c3f7a37ff83a6b69ba51a738e549bf5c/crypto/cryptlib.c#L193

--
components: Extension Modules, Library (Lib), Windows, ctypes
messages: 373659
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Enable handling logoff and shutdown Windows console events
type: enhancement
versions: Python 3.10, Python 3.9

___
Python tracker 


[issue41297] Remove doctest import from heapq

2020-07-14 Thread alex c


New submission from alex c :

heapq.py imports doctest in the last 4 lines to perform unit tests:

if __name__ == "__main__":

import doctest # pragma: no cover
print(doctest.testmod()) # pragma: no cover

This disrupts dependency tracking modules and software, like modulegraph and 
pyinstaller, as doctest brings in many dependencies (including ctypes as of 
3.8).

This functionality could be factored out into a separate unit-testing file.

--
components: Tests
messages: 373658
nosy: alexchandel
priority: normal
severity: normal
status: open
title: Remove doctest import from heapq
type: resource usage
versions: Python 3.10, Python 3.5, 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



[issue40734] /usr/bin surprisingly in sys.path under IDLE

2020-07-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Lib/idlelib contains a startup file 'idle.py' (and 'idle.bat' and 'idle.pyw' on 
Windows).  IDLE, and I, have no control over the installation of IDLE, 
including the addition of system-specific auxiliary startup files and entries, 
with names containing 'idle', outside of /idlelib.  On Windows, there is no 
addition in pythondir/Scripts.  The 'IDLE' Start menu shortcut run 
idlelib/idle.pyw.

I believe IDLE's only manipulation of sys.path for the user process is to 
prepend '' or the the edited file's directory.  In my message above describing 
a possible experiment, 'sys.python' should be sys.path.  You can keep exploring 
if you want, but I am closing this for now.

--
resolution: works for me -> not a bug
stage:  -> 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



[issue41296] unittest.mock: patched mocks do not propagate calls to parent when set via setattr

2020-07-14 Thread thinkingmachin6


thinkingmachin6  added the comment:

This appears to be a case of RTFM 
(https://docs.python.org/3/library/unittest.mock.html#attaching-mocks-as-attributes).
 For anybody that comes across this, the short answer is use `attach_mock()` 
instead of plain attribute-setting.

--
resolution:  -> not a bug

___
Python tracker 

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



[issue41273] asyncio: proactor read transport: use recv_into instead of recv

2020-07-14 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 568fb0ff4aa641329261cdde20795b0aa9278175 by Tony Solomonik in 
branch 'master':
bpo-41273: asyncio's proactor read transport's better performance by using 
recv_into instead of recv (#21442)
https://github.com/python/cpython/commit/568fb0ff4aa641329261cdde20795b0aa9278175


--
nosy: +yselivanov

___
Python tracker 

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



[issue41296] unittest.mock: patched mocks do not propagate calls to parent when set via setattr

2020-07-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue41296] unittest.mock: patched mocks do not propagate calls to parent when set via setattr

2020-07-14 Thread john passaro


New submission from john passaro :

I expected the following code to print True:


import os
from unittest.mock import call, Mock, patch

parent = Mock()
parent.getenv = patch('os.getenv')
with parent.getenv:
os.getenv('FOO', 'bar')
expected = [call.getenv('FOO', 'bar')]
print(expected, '==', parent.mock_calls, ':', expected == parent.mock_calls)


It works fine if you replace the statement `parent.getenv = patch('os.getenv')` 
with:

parent.getenv = patch('os.getenv', _mock_parent=parent,
  _mock_new_parent=parent, _mock_new_name='getenv')



Background:

I was trying to make assertions about a mocked call within a mocked context 
generator.


# c.py
from . import a
from . import b
def func():
with a.context('c'):
b.operation()


# test_c.py
from package.c import func
from unittest.mock import Mock, call, patch
parent = Mock()
parent.context = patch('package.a.context')
parent.operation = patch('package.b.operation')
with parent.context, parent.operation:
func()
assert parent.mock_calls == [
   call.context('c'),
   call.context().__enter__(),
   call.operation(),
   call.context().__exit__(None, None, None),
]


in other words, to ensure the correct order of the __enter__/__exit__ calls 
relative to the actual operation. I have my workaround but it's very awkward 
looking.

--
components: Library (Lib)
messages: 373654
nosy: thinkingmachin6
priority: normal
severity: normal
status: open
title: unittest.mock: patched mocks do not propagate calls to parent when set 
via setattr
type: behavior
versions: Python 3.8

___
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

2020-07-14 Thread Paul Ganssle


Paul Ganssle  added the comment:

Oops, just realized my previous post said `pip install distutils`. I meant to 
say that `pip install setuptools` will provide the `distutils` module (right 
now you do `import setuptools; import distutils` and you get the 
setuptools-provided version; we're working on a version where `import 
distutils` comes from `setuptools` regardless of the import order).

--

___
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

2020-07-14 Thread Paul Ganssle

Paul Ganssle  added the comment:

> I don't think it's a good idea to replace bad habits from distutils with bad 
> habits in setuptools._distutils.  And this is exactly what you get with 
> pointing directly to setuptools.

These are two different questions. We're not asking people to migrate to 
`setuptools._distutils` (a private module which may not continue to exist in 
that location), `setuptools` is *adopting* `distutils`, such that `distutils` 
is a project provided by `pip install distutils` (mind you, this is happening 
independent of what the standard library does — the only question is whether 
`import distutils` continues to work if you don't have `setuptools` installed).

> While splitting out distutils to a separate package in a Linux distro, I 
> found some creative usages at runtime of a package (see my lightning talk at 
> the language summit 2018, and [1]).  From my point of view, CPython should 
> provide documentation how to forward-port these issues without using 
> setuptools._distutils.

At this point, the extent of CPython's documentation on this should probably 
be, "We are removing `distutils` and moving it into the `setuptools` namespace. 
In future versions, you will need to install `setuptools` to import the 
`distutils` package." `setuptools` should almost certainly deprecate 
`distutils` and probably remove large swathes of it in the process, but that's 
probably on a case-by-case basis, and it's a separate issue from what needs to 
happen in CPython.

> Currently setuptools only has one component (pkg_resources, [2]) which is 
> used at runtime.  I dislike it if more than that is used at runtime of a 
> package.

I don't think anyone is planning to recommend the use of *any* 
`setuptools`-provided packages at runtime, including `pkg_resources`. This move 
is actually a good one from that point of view, because it will require that 
projects using `distutils` declare a *runtime* dependency on `setuptools`, 
which will, hopefully, raise some eyebrows. Better than the current situation, 
where these dependencies are totally undeclared (though probably worse than if 
`setuptools`, `pkg_resources` and `distutils` were all separate PyPI packages).

--

___
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

2020-07-14 Thread Christian Heimes


Christian Heimes  added the comment:

The Windows build system didn't use setu.py even before I upgrade the VS build 
system to VS 2010.

--

___
Python tracker 

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



[issue32528] Change base class for futures.CancelledError

2020-07-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20621
pull_request: https://github.com/python/cpython/pull/21476

___
Python tracker 

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



[issue32528] Change base class for futures.CancelledError

2020-07-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20620
pull_request: https://github.com/python/cpython/pull/21475

___
Python tracker 

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



[issue32528] Change base class for futures.CancelledError

2020-07-14 Thread miss-islington


miss-islington  added the comment:


New changeset 2a5181829af394b82e8e8c917183c709ee72a2b7 by JustAnotherArchivist 
in branch 'master':
bpo-32528: Document the change in inheritance of asyncio.CancelledError 
(GH-21474)
https://github.com/python/cpython/commit/2a5181829af394b82e8e8c917183c709ee72a2b7


--
nosy: +miss-islington

___
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

2020-07-14 Thread Steve Dower


Steve Dower  added the comment:

The Windows build doesn't depend on distutils at all. We've had dedicated build 
scripts for each module since before I started contributing.

--

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-14 Thread Guido van Rossum


Guido van Rossum  added the comment:

@Stefan Do you agree that the fix proposed in PR 21473 needs to be made?

--

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-14 Thread Guido van Rossum


Guido van Rossum  added the comment:

Reopening because there appears to be a problem with the fix (see PR 21473).

--
status: closed -> open

___
Python tracker 

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



[issue32528] Change base class for futures.CancelledError

2020-07-14 Thread JustAnotherArchivist


Change by JustAnotherArchivist :


--
pull_requests: +20619
pull_request: https://github.com/python/cpython/pull/21474

___
Python tracker 

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



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-14 Thread David Caro


David Caro  added the comment:

Just sent a PR that fixes the issue (a first approach), let me know if it's 
addressing the issue correctly or if there's a better way.


Thanks!

--

___
Python tracker 

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



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-14 Thread David Caro


Change by David Caro :


--
keywords: +patch
nosy: +David Caro
nosy_count: 5.0 -> 6.0
pull_requests: +20617
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21473

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-14 Thread David Caro


Change by David Caro :


--
nosy: +David Caro
nosy_count: 5.0 -> 6.0
pull_requests: +20618
pull_request: https://github.com/python/cpython/pull/21473

___
Python tracker 

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



[issue35247] test.test_socket.RDSTest.testPeek hangs indefinitely

2020-07-14 Thread Michał Górny

Michał Górny  added the comment:

I can reproduce test_socket hanging in 2 out of 3 runs. However, in my case 
testPeek doesn't seem to be the (only) culprit.  Disabling whole RDSTest helps.

--
nosy: +mgorny

___
Python tracker 

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



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-14 Thread David Lord


David Lord  added the comment:

It appears to be solved in Flask-SQLAlchemy's development version already, as 
the mixins now inherit from `type`. We caught the issue when we started 
applying flake8 (possibly through flake8-bugbear).

--
nosy: +davidism

___
Python tracker 

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



[issue41286] Built-in platform module does not offer to check for processor instructions

2020-07-14 Thread Boštjan Mejak

Boštjan Mejak  added the comment:

Unfortunately, I don't know C, only Python.

--

___
Python tracker 

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



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-14 Thread Christian Heimes


Christian Heimes  added the comment:

Stefan, please take a look.

--
nosy: +scoder

___
Python tracker 

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



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-14 Thread Christian Heimes


Christian Heimes  added the comment:

The regression was introduced in commit 8912c182455de83e27d5c120639ec91b18247913

$ git checkout v3.8.4
$ ./configure -C
$ make
$ $ ./python bpo41295.py 
Traceback (most recent call last):
  File "bpo41295.py", line 14, in 
obj.test = True
  File "bpo41295.py", line 3, in __setattr__
type.__setattr__(cls, key, value)
TypeError: can't apply this __setattr__ to DefaultMeta object

$ git revert 8912c182455de83e27d5c120639ec91b18247913
[detached HEAD 8d3c7847a0] Revert "bpo-39960: Allow heap types in the "Carlo 
Verre" hack check that override "tp_setattro()" (GH-21092) (GH-21339)"
 3 files changed, 11 insertions(+), 117 deletions(-)
$ make
$ ./python bpo41295.py 
True

--
keywords: +3.9regression
priority: normal -> release blocker
versions: +Python 3.10, Python 3.9
Added file: https://bugs.python.org/file49316/bpo41295.py

___
Python tracker 

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



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-14 Thread Christian Heimes


Christian Heimes  added the comment:

The error message is coming from hackcheck function in Objects/typeobject.c, 
https://github.com/python/cpython/blob/b4cd77de05e5bbaa6a4be90f710b787e0790c36f/Objects/typeobject.c#L5811-L5845
 . The issue could be related to bpo-39960. Checking now...

--
nosy: +christian.heimes

___
Python tracker 

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



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-14 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +3.8regression
nosy: +lukasz.langa

___
Python tracker 

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



[issue41286] Built-in platform module does not offer to check for processor instructions

2020-07-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think your best bet will be to write a small C extension to find out what's 
supported by the processor.

--

___
Python tracker 

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



[issue41278] Wrong Completion on Editing Mode of IDLE

2020-07-14 Thread E. Paine


E. Paine  added the comment:

I can only seem to reproduce this in shell and that is by importing 
"idlelib.__main__" before then typing "__main__."

However, typing "__main__." in shell and editor (without importing 
"idlelib.__main__") does give different completions. In shell, it gives a list 
of the usual "__annotations__", "__builtins__", etc. However, in editor (run 
from the home directory without any command-line flags), the only completion is 
"main" (note: the shell must be closed, otherwise it will give the same 
completions as the shell)

--
nosy: +epaine

___
Python tracker 

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



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-14 Thread kam193


New submission from kam193 :

CPython 3.8.4 broke previously correct custom __setattr__ implementation, when 
metaclass inheritances from multiple classes, including not-meta.

Following code:

```
class Meta(type):
def __setattr__(cls, key, value):
type.__setattr__(cls, key, value)

class OtherClass:
pass


class DefaultMeta(OtherClass, Meta):
pass

obj = DefaultMeta('A', (object,), {})
obj.test = True
print(obj.test)
```

Works in Python up to 3.8.3, but in 3.8.4 it raises:

Traceback (most recent call last):
  File "repr.py", line 13, in 
obj.test = True
  File "repr.py", line 3, in __setattr__
type.__setattr__(cls, key, value)
TypeError: can't apply this __setattr__ to DefaultMeta object

This change affects e.g. https://github.com/pallets/flask-sqlalchemy/issues/852

--
messages: 373637
nosy: kam193
priority: normal
severity: normal
status: open
title: CPython 3.8.4 regression on __setattr__ in multiinheritance with 
metaclasses
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue41182] DefaultSelector fails to detect selector on VMware ESXi

2020-07-14 Thread Abhijeet Kasurde


Abhijeet Kasurde  added the comment:

Any news?

--

___
Python tracker 

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



[issue41278] Wrong Completion on Editing Mode of IDLE

2020-07-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

We cannot do anything with this report unless you give exact 
keystroke-by-keystroke details and we are able to reproduce the issue.  Also, 
what OS?  If *nix, which?  How did you start IDLE?

Unless you start IDLE with -n or explicitly import idlelib, it should not be 
possible for idlelib to appear as a completion.  The run.py code was written to 
avoid adding anything to the main namespace.  When you start or restart Shell, 
dir() only lists double underscore names.

--
status: pending -> open

___
Python tracker 

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



[issue41288] Pickle crashes unpickling invalid NEWOBJ_EX opcode

2020-07-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +20616
pull_request: https://github.com/python/cpython/pull/21472

___
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

2020-07-14 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125

___
Python tracker 

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



[issue37095] [Feature Request]: Add zstd support in tarfile

2020-07-14 Thread Ma Lin


Ma Lin  added the comment:

> Add zstd support in tarfile

This requires the stdlib to contain a Zstandard module.

You can ask in the Idea forum:
https://discuss.python.org/c/ideas

--
nosy: +malin

___
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

2020-07-14 Thread Matthias Klose


Matthias Klose  added the comment:

> A PEP may be a good idea, but I do think the change doesn't have a
> particularly large magnitude. Anyone using setuptools or pip has
> already been getting setuptools' monkey-patched version of distutils
> for ages now, and soon they will be getting setuptools' vendored
> version. The documentation already indicates that distutils is at
> least soft-deprecated in favor of setuptools and we've already been
> directing issues and PRs to setuptools instead of distutils.

I don't think it's a good idea to replace bad habits from distutils with bad 
habits in setuptools._distutils.  And this is exactly what you get with 
pointing directly to setuptools.

While splitting out distutils to a separate package in a Linux distro, I found 
some creative usages at runtime of a package (see my lightning talk at the 
language summit 2018, and [1]).  From my point of view, CPython should provide 
documentation how to forward-port these issues without using 
setuptools._distutils.

Currently setuptools only has one component (pkg_resources, [2]) which is used 
at runtime.  I dislike it if more than that is used at runtime of a package.

[1] 
https://mail.python.org/archives/list/distutils-...@python.org/thread/74WZ7D3ARF7B3N6MAV2JBV3DW6TRHFIV/
[2] https://github.com/pypa/setuptools/issues/863

--

___
Python tracker 

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



[issue39017] Infinite loop in the tarfile module

2020-07-14 Thread jvoisin


jvoisin  added the comment:

CVE-2019-20907 has been assigned to this issue.

--

___
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

2020-07-14 Thread Christian Heimes


Christian Heimes  added the comment:

+1

I would like to propose three changes:

1) rename distutils, either _distutils or _buildutils sounds good to me
2) make distutils a build-only dependency and no longer install it with make 
install and other install targets
3) start to build extensions from Makefile or Modules/Setup

For (3) we have to move some checks into autoconf and maybe extend 
Modules/Setup to support conditional compilation.

--
nosy: +christian.heimes

___
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

2020-07-14 Thread Matthias Klose


Matthias Klose  added the comment:

Renaming distutils to _buildutils only delays the problem to remove it.  But 
yes, it explicitly makes it explicit that code needs to be changed.

I would like to see that neither distutils or _buildutils is installed by 
default, and only is available internally for building the extensions of 
CPython.

The "old" build system to build builtins instead of extensions is still 
functional, so it should be ok to build the extensions also with the old build 
system.

That would require moving all the config stuff in setup.py to autoconf tests, 
which is perfectly doable.  The MacOS and Windows builds would need some 
attention too, but afaicr when asking Ned Deily and Steve Dower at the language 
summits, they didn't have a concern about this approach.

--

___
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

2020-07-14 Thread Matthias Klose


Matthias Klose  added the comment:

> It's too late to add a new deprecation in the Python 3.9 cycle

Please can we add a note in 3.9, that it will be deprecated in 3.10?

--
nosy: +doko

___
Python tracker 

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



[issue41275] Clarify whether Futures can be awaited multiple times

2020-07-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

The allowance to wait for the future object multiple times is settled in stone. 
This cannot be changed without breaking very many codes.

So yes, asyncio guarantees that the feature is settled in stone. If set_value() 
/ set_exception() was called, the value/exception is returned (raised) on every 
following `await fut`.


Pull request for documentation with clarification of the status quo is welcome!

--

___
Python tracker 

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



[issue41275] Clarify whether Futures can be awaited multiple times

2020-07-14 Thread Ammar Askar


Change by Ammar Askar :


--
nosy: +aeros

___
Python tracker 

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



[issue41287] __doc__ attribute is not set in property-derived classes

2020-07-14 Thread Sergei Izmailov


Sergei Izmailov  added the comment:

class Property(property):
'custom docstring'

print(Property(None, None, None, "hello").__doc__)

This snippet is expected to print "hello" as well (at least it's what comment 
in cpython implementation suggests) 

https://github.com/python/cpython/blob/master/Objects/descrobject.c#L1712-L1715

--

___
Python tracker 

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



[issue41122] functools.singledispatchfunction has confusing error message if no positional arguments are passed in

2020-07-14 Thread Ammar Askar


Change by Ammar Askar :


--
keywords: +patch
nosy: +ammar2
nosy_count: 1.0 -> 2.0
pull_requests: +20615
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21471

___
Python tracker 

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