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

2019-09-24 Thread Michael Felt


Michael Felt  added the comment:

Hi all,

Now that I have finally noticed that the 3.8 branches are active for AIX bots I 
see something that I had always thought was in the 3.8 branch, but is not yet.

https://github.com/python/cpython/pull/12202

Seems the backport never succeeded. Although, iirc it was, then, very near the 
day that "3.9" started. So, surprised that it failed the backport. Can that 
process be started again, or will I need to do this manually, so that the PPC64 
bot also passes.

--

___
Python tracker 

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



[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread Arno-Can Uestuensoez


New submission from Arno-Can Uestuensoez :

The attached examples evaluate inheritance by mixins with different
arameters and in different orders.

The 'super()' call propagates the call resolution by definition
to the next level, and cares about multiple inheritance as well
as mixins. Where mixins are the superior case as they represent multiple 
inheritance in any case due to the common top class 'object'.
So far perfect.

The oddity I came around is the simple case of mixins with different
parameters, where both are derived from 'object'. It is obvious, that such a 
class has to comply to the parents call interface - here object - when to be 
used standalone. BUT when I ignore this and set intentionally a parameter - for 
test-purposes of mixins only - the resolution algorithm seems to normalize both 
for the final call without parameters -  as soon as one of the mixins is a 
non-parameter call. This is independent from the inheritance order for the 
derived class.

I expect for the rightmost of the inherited classes to pass the parameters 
literally.

When both classes have parameters, the parameter is passed to 'object' and 
correctly raises an exception.

#--

[acue@lap001 mixin-order-with-different-params]$ ./call.sh 



different parameters for mixin classes at diffeent positions

  0: super() method signature has no param
  1: super() method signature has param

final top-class is 'object()' which does not know the 
parameter - here 'propagate'



#---
#
# CALL: mixin_C_is_A1B0.py
#
B:C
A:C
C:C

#---
#
# CALL: mixin_C_is_A1B1.py
#
Traceback (most recent call last):
  File "mixin_C_is_A1B1.py", line 24, in 
c=C(True)
  File "mixin_C_is_A1B1.py", line 20, in __init__
super(C, self).__init__(propagate)
  File "mixin_C_is_A1B1.py", line 4, in __init__
super(A, self).__init__(propagate)
  File "mixin_C_is_A1B1.py", line 12, in __init__
super(B, self).__init__(propagate)
TypeError: object.__init__() takes no parameters

#---
#
# CALL: mixin_C_is_B0A1.py
#
A:C
B:C
C:C

#---
#
# CALL: mixin_C_is_B1A1.py
#
Traceback (most recent call last):
  File "mixin_C_is_B1A1.py", line 25, in 
c=C(True)
  File "mixin_C_is_B1A1.py", line 20, in __init__
super(C, self).__init__(propagate)
  File "mixin_C_is_B1A1.py", line 12, in __init__
super(B, self).__init__(propagate)
  File "mixin_C_is_B1A1.py", line 4, in __init__
super(A, self).__init__(propagate)
TypeError: object.__init__() takes no parameters

[acue@lap001 mixin-order-with-different-params]$ 


#--


Is this intentional?

If so, what is the explanation? - Because it potentially hides bugs for later 
debugging...

--
files: tests.tar.gz
messages: 353062
nosy: acue
priority: normal
severity: normal
status: open
title: Mixins - super calls in bases of multiple-inheritance with different 
parameters
type: compile error
versions: Python 2.7, Python 3.6
Added file: https://bugs.python.org/file48621/tests.tar.gz

___
Python tracker 

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



[issue38203] regrtest fails to stop test_multiprocessing_spawn worker process

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

I worked around the issue, but see bpo-37531 for the root issue which is not 
fixed yet.

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



[issue38212] test_multiprocessing_spawn: test_queue_feeder_donot_stop_onexc() failed on x86 Windows7 3.x

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue37123] test_multiprocessing fails randomly on Windows

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue30356] test_mymanager_context() of test_multiprocessing_spawn: manager._process.exitcode=-15 on x86 Windows7 3.x

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15927
pull_request: https://github.com/python/cpython/pull/16349

___
Python tracker 

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



[issue38263] [Windows] multiprocessing: DupHandle.detach() race condition on DuplicateHandle(DUPLICATE_CLOSE_SOURCE)

2019-09-24 Thread STINNER Victor


New submission from STINNER Victor :

On Windows, the multiprocessing DupHandle.detach() method has race condition on 
DuplicateHandle(DUPLICATE_CLOSE_SOURCE).

Error on duplicate():

Traceback (most recent call last):
  File "", line 1, in 
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\spawn.py",
 line 107, in spawn_main
new_handle = reduction.duplicate(pipe_handle,
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\reduction.py",
 line 79, in duplicate
return _winapi.DuplicateHandle(
PermissionError: [WinError 5] Access is denied

Example: bpo-34714


Error on detach():

Traceback (most recent call last):
  File "", line 1, in 
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\spawn.py",
 line 117, in spawn_main
exitcode = _main(fd)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\spawn.py",
 line 127, in _main
self = reduction.pickle.load(from_parent)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\connection.py",
 line 951, in rebuild_pipe_connection
handle = dh.detach()
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\reduction.py",
 line 133, in detach
self._access, False, _winapi.DUPLICATE_CLOSE_SOURCE)
PermissionError: [WinError 5] Access is denied

Example: bpo-34513

--
components: Library (Lib)
messages: 353064
nosy: pablogsal, pitrou, vstinner
priority: normal
severity: normal
status: open
title: [Windows] multiprocessing: DupHandle.detach() race condition on 
DuplicateHandle(DUPLICATE_CLOSE_SOURCE)
versions: 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



[issue34513] test_multiprocessing_spawn fails on x86 Windows7 3.7 buildbot

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\reduction.py",
 line 133, in detach
self._access, False, _winapi.DUPLICATE_CLOSE_SOURCE)
PermissionError: [WinError 5] Access is denied

I created bpo-38263 "[Windows] multiprocessing: DupHandle.detach() race 
condition on DuplicateHandle(DUPLICATE_CLOSE_SOURCE)" for this bug.

I close this issue as outdated.

--
nosy: +vstinner
resolution:  -> out of date
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



[issue34714] timeout in test_multiprocessing_spawn x86 Windows7 3.x buildbot

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\reduction.py",
 line 79, in duplicate
return _winapi.DuplicateHandle(
PermissionError: [WinError 5] Access is denied

I created bpo-38263 "[Windows] multiprocessing: DupHandle.detach() race 
condition on DuplicateHandle(DUPLICATE_CLOSE_SOURCE)" for this bug.

I close this issue as outdated.

--
resolution:  -> out of date
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



[issue26195] Windows frozen .exe multiprocessing.Queue access is denied exception

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

No activity since 2016 and Davin considers that we lack information to debug 
this issue, so I close this issue as out of date.

--
nosy: +vstinner
resolution:  -> out of date
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



[issue17101] __main__.py Multiprocessing on Windows

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

> Is it possible to backport the fix from #10845 to 2.7?  Is it actually worth 
> doing?

I close the issue, it has been done in 2015:

commit 2a6c2c9baa4bef29d605438c3e2ada01a240bdc3
Author: Nick Coghlan 
Date:   Thu Nov 19 12:59:39 2015 +1000

Close #10128: don't rerun __main__.py in multiprocessing

- backports issue #10845's mitigation of incompatibilities between
  the multiprocessing module and directory and zipfile execution
- Multiprocessing on Windows will now automatically skip rerunning top
  level __main__.py modules in spawned processes, rather than failing
  with AssertionError

--
nosy: +vstinner
resolution:  -> fixed
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



[issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

x86 Windows7 3.8:
https://buildbot.python.org/all/#/builders/210/builds/308

test_level (test.test_multiprocessing_spawn.WithProcessesTestLogging) ... ok
test_rapid_restart 
(test.test_multiprocessing_spawn.WithProcessesTestManagerRestart) ... ok
Warning -- Dangling processes: {}
test_access 
(test.test_multiprocessing_spawn.WithProcessesTestPicklingConnections) ... ok

--

___
Python tracker 

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



[issue38258] ctypes ignores when a DLL function is called with too many arguments

2019-09-24 Thread Sebastian Ernst


Sebastian Ernst  added the comment:

Thanks a lot for the clarification, Eryk. I did not notice that it was 
deprecated behavior.

For the "too many arguments" case I guess this is not an issue. However, just 
for the symmetry of things, I also looked at calling a function with TOO FEW 
arguments. 

```C
int16_t __stdcall __declspec(dllimport) mul_ints(
int16_t a,
int16_t b
)
{
return a * b;
}
```

```python
def test_error_callargs_unconfigured_too_few_args():

dll = ctypes.windll.LoadLibrary('tests/demo_dll.dll')
mul_ints = dll.mul_ints

with pytest.raises(ValueError):
a = mul_ints(7)
```

As expected after your explanation, also no error in CPython 3.8 (i.e. the test 
fails, while is passes on CPython <= 3.7). If I run this manually, I even get a 
"result":

```python
>>> dll = ctypes.windll.LoadLibrary('tests/demo_dll.dll')
>>> mul_ints = dll.mul_ints
>>> a = mul_ints(7)
>>> a
445564 # !
>>> 445564/7 # Just looking at where this result is coming from ...
63652.0
```

Re-starting Python (3.8) and (intentionally) misconfiguring the function 
interestingly also does not change the result:

```python
>>> dll = ctypes.windll.LoadLibrary('tests/demo_dll.dll')
>>> mul_ints = dll.mul_ints
>>> mul_ints.argtypes = (ctypes.c_int16,)
>>> a = mul_ints(7)  
>>> a
445564 # Apparently, this is deterministic?!?
```

Just out of curiosity, where is this data coming from?

This ONLY way to prevent things like this to happen is to actually correctly 
configure the function:

```python
>>> dll = ctypes.windll.LoadLibrary('tests/demo_dll.dll')
>>> mul_ints = dll.mul_ints
>>> mul_ints.argtypes = (ctypes.c_int16, ctypes.c_int16)
>>> mul_ints(7)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: this function takes 2 arguments (1 given)
```

This should very CLEARLY be mentioned in the documentation ...

--

___
Python tracker 

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



[issue36560] test_functools leaks randomly 1 memory block

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

Recent fail on AMD64 Fedora Rawhide Refleaks 3.x:
https://buildbot.python.org/all/#builders/189/builds/162
test_functools leaked [1, 2, 1] memory blocks, sum=4

--

___
Python tracker 

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



[issue38212] test_multiprocessing_spawn: test_queue_feeder_donot_stop_onexc() failed on x86 Windows7 3.x

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 99799c722065d0524f3ab0bc455e1938bb8dc60f by Victor Stinner in 
branch 'master':
bpo-38212: Increase MP test_queue_feeder_donot_stop_onexc() timeout (GH-16348)
https://github.com/python/cpython/commit/99799c722065d0524f3ab0bc455e1938bb8dc60f


--

___
Python tracker 

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



[issue38212] test_multiprocessing_spawn: test_queue_feeder_donot_stop_onexc() failed on x86 Windows7 3.x

2019-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15929
pull_request: https://github.com/python/cpython/pull/16351

___
Python tracker 

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



[issue38212] test_multiprocessing_spawn: test_queue_feeder_donot_stop_onexc() failed on x86 Windows7 3.x

2019-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15928
pull_request: https://github.com/python/cpython/pull/16350

___
Python tracker 

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



[issue38212] test_multiprocessing_spawn: test_queue_feeder_donot_stop_onexc() failed on x86 Windows7 3.x

2019-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset c13a4d6a94b5fab52422fcba612b3d1790aa3422 by Miss Islington (bot) 
in branch '3.7':
bpo-38212: Increase MP test_queue_feeder_donot_stop_onexc() timeout (GH-16348)
https://github.com/python/cpython/commit/c13a4d6a94b5fab52422fcba612b3d1790aa3422


--
nosy: +miss-islington

___
Python tracker 

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



[issue38212] test_multiprocessing_spawn: test_queue_feeder_donot_stop_onexc() failed on x86 Windows7 3.x

2019-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset fea9ca1b0c6279f483a73f2040b068dd0e0d3acd by Miss Islington (bot) 
in branch '3.8':
bpo-38212: Increase MP test_queue_feeder_donot_stop_onexc() timeout (GH-16348)
https://github.com/python/cpython/commit/fea9ca1b0c6279f483a73f2040b068dd0e0d3acd


--

___
Python tracker 

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



[issue38172] Python 3.8 Segfult with Bandersnatch pytest Suite

2019-09-24 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



[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Are your tests so huge that you need to gzip them before uploading? That makes 
them extremely difficult to read from the browser, and makes me extremely 
suspicious that this could be some form of zip bomb or other malware. Couldn't 
you upload a single .py file instead a shell script?

You say that super() "cares about multiple inheritance as well
as mixins" and then say "It is obvious, that such a class has to comply to the 
parents call interface - here object - when to be used standalone."

I don't understand what you mean by "standalone" here, but to be clear, Python 
mixins are just regular classes. There is no difference between ordinary 
classes and mixin classes in Python, and they use the same multiple-inheritance 
method resolution order whether you think of them as "mixins" or "multiple 
inheritance".

You say: "BUT when I ignore this and set intentionally a parameter - for 
test-purposes of mixins only - the resolution algorithm seems to normalize both 
for the final call without parameters -  as soon as one of the mixins is a 
non-parameter call. This is independent from the inheritance order for the 
derived class."

I am sorry, I cannot work out what you are saying here.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue38172] Python 3.8 Segfult with Bandersnatch pytest Suite

2019-09-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I am not sure about the difference between python 3.8-dev and nightly . The 
pipelines seem to have same configuration. The version on both pipelines is 
3.8.0b4+ and the nightly build passes : 
https://travis-ci.org/pypa/bandersnatch/jobs/588664064 . Maybe getting the 
exact commit hash for the python version might help here in trying to replicate 
the issue under the environment.

--

___
Python tracker 

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



[issue38172] Python 3.8 Segfult with Bandersnatch pytest Suite

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to wait one or two weeks, and if the bug doesn't reoccur: simply 
close the issue.

--

___
Python tracker 

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



[issue37896] test_multiprocessing_fork hangs on an IPv6-only host

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2019-09-24 Thread Géry

Change by Géry :


--
nosy: +maggyero

___
Python tracker 

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



[issue37338] test_multiprocessing_forkserver, SemLock: test_thousand() logged on AMD64 Ubuntu Shared 3.x: Exception ignored in:

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_multiprocessing_forkserver: test_thousand() logged on AMD64 Ubuntu 
Shared 3.x: Exception ignored in:  -> 
test_multiprocessing_forkserver, SemLock: test_thousand() logged on AMD64 
Ubuntu Shared 3.x: Exception ignored in: 

___
Python tracker 

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



[issue36342] test_venv failure when executed by test_multiprocessing and the platform lacks a functional sem_open()

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like this issue has been fixed in the master branch. Reopen the issue 
if you consider that the fix should be backported.

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



[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2019-09-24 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

Update, Some user of this function just complained on the merged pull requests 
here : https://github.com/python/cpython/pull/15315#issuecomment-534522962.

Do we revert and deprecate ? cc @victor

--

___
Python tracker 

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



[issue34607] test_multiprocessing_forkserver is altering the environment on AMD64 FreeBSD 10.x Shared 3.7

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> out of date
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



[issue38239] test_gdb fails on AMD64 Fedora Stable LTO 3.8 and AMD64 RHEL8 LTO 3.x: Unexpected gdb output

2019-09-24 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
nosy: +cstratak

___
Python tracker 

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



[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

2019-09-24 Thread Wenzel Jakob


Wenzel Jakob  added the comment:

Hi,

pybind11 developer here. A bit on context of our usage of this function:

Pybind11 supports some advanced GIL-related tricks that *require* access this 
function. For instance, pybind11 can intercept a Python function call on the 
`main()` thread and delete the associated thread state, launching a new thread 
and continuing Python execution there (with a newly created thread state).

Kind of crazy, but why is this useful? UI libraries. On some platforms, it is 
not legal to poll UI events on any thread other than the main thread. This 
means that it's impossible to implement a proper UI event loop because Python 
is hogging the main thread. With the functionality in pybind11's 
``gil_scoped_acquire``, I can launch an event polling loop on the main thread, 
continue running an interactive Python session on another thread, and even swap 
them back e.g. when the user interface is no longer needed.

Best,
Wenzel

--
nosy: +wenzel

___
Python tracker 

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



[issue37123] test_multiprocessing fails randomly on Windows

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b0e1ae5f5430433766e023c1a6936aeba0f2b84e by Victor Stinner in 
branch 'master':
bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)
https://github.com/python/cpython/commit/b0e1ae5f5430433766e023c1a6936aeba0f2b84e


--
nosy: +vstinner

___
Python tracker 

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



[issue30356] test_mymanager_context() of test_multiprocessing_spawn: manager._process.exitcode=-15 on x86 Windows7 3.x

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b0e1ae5f5430433766e023c1a6936aeba0f2b84e by Victor Stinner in 
branch 'master':
bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)
https://github.com/python/cpython/commit/b0e1ae5f5430433766e023c1a6936aeba0f2b84e


--

___
Python tracker 

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



[issue37123] test_multiprocessing fails randomly on Windows

2019-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15930
pull_request: https://github.com/python/cpython/pull/16352

___
Python tracker 

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



[issue37123] test_multiprocessing fails randomly on Windows

2019-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15932
pull_request: https://github.com/python/cpython/pull/16353

___
Python tracker 

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



[issue30356] test_mymanager_context() of test_multiprocessing_spawn: manager._process.exitcode=-15 on x86 Windows7 3.x

2019-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15931
pull_request: https://github.com/python/cpython/pull/16352

___
Python tracker 

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



[issue30356] test_mymanager_context() of test_multiprocessing_spawn: manager._process.exitcode=-15 on x86 Windows7 3.x

2019-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15933
pull_request: https://github.com/python/cpython/pull/16353

___
Python tracker 

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



[issue38212] test_multiprocessing_spawn: test_queue_feeder_donot_stop_onexc() failed on x86 Windows7 3.x

2019-09-24 Thread STINNER Victor


Change by STINNER 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



[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-09-24 Thread Tal Einat

Tal Einat  added the comment:

I can confirm that the crash from pasting these characters happens when trying 
to fetch the clipboard contents.  We can override the built-in <> event, 
but then we have to get the clipboard's contents directly, and the only 
portable way to do that in the stdlib is via Tkinter's clipboard_get(). (For a 
non-stdlib solution, check out pyperclip on PyPI.)

clipboard_get(), which I assume calls what Tk uses internally to handle the 
<> event, crashes in the C code with a UnicodeDecodeError.  Here's a 
traceback from calling clipboard_get() with 🐱 in the clipboard (Windows 10, 
recent master branch, i.e. to be 3.9):

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\Tal\dev\cpython\lib\tkinter\__init__.py", line 1885, in 
__call__
return self.func(*args)
  File "C:\Users\Tal\dev\cpython\lib\idlelib\multicall.py", line 176, in handler
r = l[i](event)
  File "C:\Users\Tal\dev\cpython\lib\idlelib\editor.py", line 618, in paste
print(self.text.clipboard_get())
  File "C:\Users\Tal\dev\cpython\lib\tkinter\__init__.py", line 867, in 
clipboard_get
return self.tk.call(('clipboard', 'get') + self._options(kw))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 0: invalid 
continuation byte

>From a quick look, this appears to be happening in _tkinter.c, here:

static PyObject *
unicodeFromTclStringAndSize(const char *s, Py_ssize_t size)
{
PyObject *r = PyUnicode_DecodeUTF8(s, size, NULL);
...

My guess is that Tk is passing the clipboard contents as-is, and we're simply 
not decoding it with the proper encoding (i.e. utf-16le on Windows).

Is this something worth fixing / working around in Tkinter, e.g. by using a 
proper encoding depending on the platform for fetching clipboard contents? Or 
are we content to continue waiting for Tk to fix this?

--
nosy: +taleinat

___
Python tracker 

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



[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I took the health of my PC into my hands *smiles* and unzipped your test cases. 
I don't know .sh scripts well, so I didn't run that (and Windows users won't be 
able to run it), but I looked at the Python scripts, and I think I have 
duplicated your test cases in a way that I find easier to understand.

(Fewer files, more descriptive names, less code duplication.)

--
Added file: https://bugs.python.org/file48622/mixin_tests.py

___
Python tracker 

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



[issue37123] test_multiprocessing fails randomly on Windows

2019-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset 46f6c566a888fb637913ef71fed28568180eafb4 by Miss Islington (bot) 
in branch '3.7':
bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)
https://github.com/python/cpython/commit/46f6c566a888fb637913ef71fed28568180eafb4


--
nosy: +miss-islington

___
Python tracker 

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



[issue30356] test_mymanager_context() of test_multiprocessing_spawn: manager._process.exitcode=-15 on x86 Windows7 3.x

2019-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset 46f6c566a888fb637913ef71fed28568180eafb4 by Miss Islington (bot) 
in branch '3.7':
bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)
https://github.com/python/cpython/commit/46f6c566a888fb637913ef71fed28568180eafb4


--

___
Python tracker 

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



[issue30356] test_mymanager_context() of test_multiprocessing_spawn: manager._process.exitcode=-15 on x86 Windows7 3.x

2019-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset 081641fe520382d48ffead158ab528180f72017d by Miss Islington (bot) 
in branch '3.8':
bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)
https://github.com/python/cpython/commit/081641fe520382d48ffead158ab528180f72017d


--

___
Python tracker 

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



[issue37123] test_multiprocessing fails randomly on Windows

2019-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset 081641fe520382d48ffead158ab528180f72017d by Miss Islington (bot) 
in branch '3.8':
bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)
https://github.com/python/cpython/commit/081641fe520382d48ffead158ab528180f72017d


--

___
Python tracker 

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



[issue37123] test_multiprocessing fails randomly on Windows

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue38140] Py_tp_dictoffset / Py_tp_finalize are unsettable in stable API

2019-09-24 Thread Petr Viktorin


Petr Viktorin  added the comment:

Thanks for the feature!
This still needs documentation, however.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue38140] Py_tp_dictoffset / Py_tp_finalize are unsettable in stable API

2019-09-24 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +15934
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/16354

___
Python tracker 

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



[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I'm not an expert on super and multiple inheritance, but let me see if I can 
explain what is going on. (Hopefully an expert will correct me if I get 
something wrong.)

1. The class C(A_With_Arg, B_With_Arg) is straight-forward: the super call 
inside A passes the True parameter to B, which passes it to object, which 
raises.

2. The class C(B_With_Arg, A_With_Arg) is the same, except B passes the 
parameter to A, which passes it to object, which raises.

3. The class C(A_With_Arg, B_Without_Arg) is also straight-forward: the super 
call inside A passes the True parameter to B, but B ignores it and passes 
nothing to object.

4. The class C(B_Without_Arg, A_With_Arg) is the tricky case. The super call 
inside B passes no arguments to A, so A gets the default value of False for its 
parameter. Since A's propagate parameter is False, it doesn't call super at 
all, object's __init__ method doesn't get called, and there's no exception.


I've added another version, mixin_tests2.py, which hopefully makes it a bit 
easier to see what is happening.

You said: "The 'super()' call propagates the call resolution by definition
to the next level".

I think this means that you expect that in class C(A, B), A.__init__ will call 
object.__init__, and B.__init__ will call object.__init__ as well. But that's 
not what happens. That's what Python 2 "classic classes" did, but it was buggy, 
because superclasses would be called *twice*.

Perhaps it will help to read this:

https://www.python.org/download/releases/2.3/mro/


So I believe that the behaviour you are seeing is correct, there is no error or 
bug. Do you agree? If so, we can close this issue. Otherwise, if you disagree 
and still believe this is a bug, please explain why you think it is a bug.

--
Added file: https://bugs.python.org/file48623/mixin_tests2.py

___
Python tracker 

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



[issue38172] Python 3.8 Segfult with Bandersnatch pytest Suite

2019-09-24 Thread Cooper Lees


Cooper Lees  added the comment:

https://docs.travis-ci.com/user/languages/python/ make no mention of the 
difference between "3.8-dev" and "nightly". I'd expect it to be latest released 
3.8 alpha/beta and Trunk (or possibly trunk on 3.8 branch) respectively.

Have reached out via Twitter (unable to see a contact anywhere on their 
website) to see if we can get clarity: 
https://twitter.com/cooperlees/status/1176485344553754624

--

___
Python tracker 

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



[issue35540] dataclasses.asdict breaks with defaultdict fields

2019-09-24 Thread Paul Ganssle


Change by Paul Ganssle :


--
pull_requests: +15935
pull_request: https://github.com/python/cpython/pull/16356

___
Python tracker 

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



[issue35540] dataclasses.asdict breaks with defaultdict fields

2019-09-24 Thread Paul Ganssle


Paul Ganssle  added the comment:

Considering that `namedtuple` is special-cased, I think it's reasonable to 
special-case `defaultdict` as well, though it may be worth considering more 
general solutions that will also work for things other than the standard 
library. One would be to solve this the same way that other "subclasses may 
have a different constructor" problems are solved (e.g. `float`, `int`, 
formerly `datetime`) and ignore the subclass (or selectively ignore it if it's 
a problem), for example changing _asdict_inner to something like this:

if isinstance(obj, dict):
new_keys = tuple((_asdict_inner(k, dict_factory),
  _asdict_inner(v, dict_factory))
  for k, v in obj.items())

try:
return type(obj)(new_keys)
except Exception:
return dict(new_keys)

Another more general alternative would be to add a type registry for `asdict`, 
either as an additional parameter or with a new transformer class of some sort. 
I created a quick proof of concept for this in GH-16356 to see one way it could 
look.

In any case I think it's quite unfortunate that we can't easily just support 
anything that has a __deepcopy__ defined. There may be some crazy solution that 
involves passing a class with a custom __getitem__ to the `memo` argument of 
copy.deepcopy, but if it's even possible (haven't thought about it enough) I'm 
not sure it's *advisable*.

--
nosy: +p-ganssle

___
Python tracker 

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



[issue38172] Python 3.8 Segfult with Bandersnatch pytest Suite

2019-09-24 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



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

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

This change broke at least two projects:

* Blender: access "interp->modules" but also "interp->builtins"
* FreeCAD: access "interp->modules"

It would be nice to document replacement solutions at:
https://docs.python.org/dev/whatsnew/3.8.html#porting-to-python-3-8

* Replace "interp->modules" with PyImport_GetModuleDict()
* Replace "interp->builtins" with PyEval_GetBuiltins()

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



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

2019-09-24 Thread STINNER Victor

STINNER Victor  added the comment:

Note: IMHO the "The PyInterpreterState struct has been moved into the 
“internal” header files (...)" entry should be documented in the "Changes in 
the C API" section, rather than in the "Changes in the Python API" section of:
https://docs.python.org/dev/whatsnew/3.8.html#porting-to-python-3-8

--

___
Python tracker 

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



[issue38234] The value of Py_SetPath is not used to populate the configuration

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15936
pull_request: https://github.com/python/cpython/pull/16357

___
Python tracker 

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



[issue38254] Pickle not deserializing an aiohttp ClientConnectorError exception as expected

2019-09-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

A simplified example to reproduce the issue as below. It seems that the OSError 
instance passed to the constructor is pickled such that during unpickling the 
string part of OSError 'unittest' is passed to the constructor instead of the 
original OSError object.


import pickle

ose = OSError(1, 'unittest')

class SubOSError(OSError):

def __init__(self, foo, os_error):
super().__init__(os_error.errno, os_error.strerror)

cce = SubOSError(1, ose)
cce_pickled = pickle.dumps(cce)
pickle.loads(cce_pickled)


./python.exe ../backups/bpo38254.py
Traceback (most recent call last):
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/../backups/bpo38254.py", 
line 12, in 
pickle.loads(cce_pickled)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/../backups/bpo38254.py", 
line 8, in __init__
super().__init__(os_error.errno, os_error.strerror)
AttributeError: 'str' object has no attribute 'errno'

--
nosy: +xtreak

___
Python tracker 

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



[issue38234] The value of Py_SetPath is not used to populate the configuration

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1ce152a42eaa917d7763bce93f1e1ca72530d7ca by Victor Stinner in 
branch 'master':
bpo-38234: Py_SetPath() uses the program full path (GH-16357)
https://github.com/python/cpython/commit/1ce152a42eaa917d7763bce93f1e1ca72530d7ca


--

___
Python tracker 

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



[issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x

2019-09-24 Thread Steve Dower


Steve Dower  added the comment:

Hey Davin - could this be related to the new tests/restart support we added at 
the sprints?

--
nosy: +davin, steve.dower

___
Python tracker 

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



[issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

> Hey Davin - could this be related to the new tests/restart support we added 
> at the sprints?

I saw this issue for the first time last April, so it's unlikely to be a recent 
regression.

--

___
Python tracker 

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



[issue38234] The value of Py_SetPath is not used to populate the configuration

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15937
pull_request: https://github.com/python/cpython/pull/16358

___
Python tracker 

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



[issue38234] The value of Py_SetPath is not used to populate the configuration

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bb6bf7d342b4503a6227fd209fac934905b6a1aa by Victor Stinner in 
branch 'master':
bpo-38234: Add tests for Python init path config (GH-16358)
https://github.com/python/cpython/commit/bb6bf7d342b4503a6227fd209fac934905b6a1aa


--

___
Python tracker 

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



[issue38258] ctypes ignores when a DLL function is called with too many arguments

2019-09-24 Thread Eryk Sun


Eryk Sun  added the comment:

> Just out of curiosity, where is this data coming from?

In general it's just random data on the stack. It's not worth investigating 
where this particular value comes from. It could be the low word of the address 
of a stack-allocated buffer, such as the buffer where ffi_call writes the 
return value.

> This ONLY way to prevent things like this to happen is to actually 
> correctly configure the function:
> ...
> >>> mul_ints.argtypes = (ctypes.c_int16, ctypes.c_int16)

Yes, the docs should explain that TypeError is raised for the wrong number of 
arguments when argtypes is assigned, and it should be noted that cdecl (CDLL) 
allows passing more (but not fewer) arguments than what argtypes defines. As I 
mentioned previously, we could extend this cdecl behavior to stdcall (WinDLL) 
for the x64 architecture, since it's caller cleanup like cdecl.

--

___
Python tracker 

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



[issue38254] Pickle not deserializing an aiohttp ClientConnectorError exception as expected

2019-09-24 Thread David Parks


David Parks  added the comment:

An answer came in over the stack overflow question. 

https://stackoverflow.com/questions/58019939/attributeerror-str-object-has-no-attribute-errno/58084380#58084380

The issue is that OSError implements a custom __reduce__ function which needs 
to be override by the subclass when the arguments to the subclass are different 
than the parent. 

So no bug, just pickle subtlety. Passing it back to the aiohttp repo for a fix 
there.

https://github.com/aio-libs/aiohttp/issues/4077

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue38254] Pickle not deserializing an aiohttp ClientConnectorError exception as expected

2019-09-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the clarification and the answer link. I was also just debugging 
along the similar lines around how OSError.__reduce__ treats the arguments 
something like. Custom __reduce__ for aiohttp works as explained in the SO 
answer.


class SubOSError(OSError):

def __init__(self, foo, os_error, /):
self.foo = foo
self.os_error = os_error
super().__init__(os_error.errno, os_error.strerror)

def __reduce__(self): # Custom __reduce__
return (self.__class__, (self.foo, self.os_error ))

def __reduce__(self): # OSError __reduce__
return (self.__class__, (self.os_error.errno, self.os_error.strerror ))

--
type: crash -> behavior

___
Python tracker 

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



[issue38242] Revert the new asyncio Streams API

2019-09-24 Thread Yury Selivanov


Yury Selivanov  added the comment:

I slept on this and discussed this issue privately with a few non-involved 
people who use asyncio daily.

My final opinion on this issue: we must revert the new streaming API from 
asyncio and take our time to design it properly.  I don't like what we have in 
the 3.8 branch right now.  I don't feel comfortable rushing decisions and doing 
last minute API changes.

Andrew, do you want me to submit a PR or you can do it?

--

___
Python tracker 

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



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

2019-09-24 Thread Vinay Sajip


Change by Vinay Sajip :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue36232] Improve error message on dbm.open

2019-09-24 Thread Dong-hee Na


Dong-hee Na  added the comment:

I think that this issue solved. Can we close this issue?

--
nosy: +corona10

___
Python tracker 

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



[issue38264] Makefile appears broken - touching header causes no build

2019-09-24 Thread Vinay Sajip


New submission from Vinay Sajip :

There appears to be a failure in the Makefile build logic. Steps to reproduce:

1. Make a fresh build using "make clean && make"
2. run "touch Modules/_io/_iomodule.h"
3. Run "make" again.

Observed result: No related files get built.
Expected result: The directly including compilation units 
Modules/_io/{_iomodule,iobase,fileio,bufferedio,textio,bytesio,stringio}.o 
should be built. The compilation units which depend on these (e.g. 
Modules/textio.o) should also be built.

The problem appears to be related to Modules/makesetup, which adds rules to tbe 
Makefile. An example of a rule is

Modules/textio.o: $(srcdir)/Modules/_io/textio.c; $(CC) 
$(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN 
-I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c 
$(srcdir)/Modules/_io/textio.c -o Modules/textio.o

The problem here looks like the lack of a dependency between 
Modules/_io/textio.o and Modules/_io/textio.o - there is only a dependency on 
Modules/_io/textio.c, which wouldn't be rebuilt on a touch of 
Modules/_io/_iomodule.h.

--
components: Build
messages: 353105
nosy: vinay.sajip
priority: high
severity: normal
status: open
title: Makefile appears broken - touching header causes no build
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue38264] Makefile appears broken - touching header causes no build

2019-09-24 Thread Vinay Sajip


Vinay Sajip  added the comment:

Problem also seems to occur in 3.8 and 3.7.

--
versions: +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



[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Dong-hee Na


New submission from Dong-hee Na :

I've found this comments.
// TODO length should be size_t!  but Python doesn't support parsing size_t yet.
(https://github.com/python/cpython/blob/279f44678c8b84a183f9eeb85e0b086228154497/Modules/posixmodule.c#L8830)


I don't know when this comment was created.
But at this point, it seems to provide that functionality.
It can be simply solved through the clinic.

How about updating this argument to be size_t and remove the TODO comment?

--
components: Library (Lib)
messages: 353107
nosy: corona10, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Update os.pread to accept the length type as size_t
versions: Python 3.9

___
Python tracker 

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



[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Length should be Py_ssize_t. Python does not support creating bytes objects 
larger than PY_SSIZE_T_MAX.

--

___
Python tracker 

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



[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Dong-hee Na


Dong-hee Na  added the comment:

Oh okay!
Thanks for letting me know.
Is it okay to switch it into Py_ssize_t?

--

___
Python tracker 

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



[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think it is okay. Just check that all platforms which support pread() (Linux, 
*BSD, macOS) pass the length as size_t instead of int. Windows does not always 
support length larger than 2 KiB, but it does not support pread() either.

--

___
Python tracker 

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



[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Dong-hee Na


Dong-hee Na  added the comment:

Linux: http://man7.org/linux/man-pages/man2/pread.2.html
BSD: https://www.freebsd.org/cgi/man.cgi?pread(2)
macOS: 
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/pread.2.html

All of them pass the length as size_t instead of int.
I will send the PR soon :)

--

___
Python tracker 

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



[issue13743] xml.dom.minidom.Document class is not documented

2019-09-24 Thread Alex Itkes


Alex Itkes  added the comment:

Although the Document, Element, etc. classes are well documented in online 
docs, it is sometimes easier to use pydoc to view the documentation. I think 
documentation strings should be included to these classes. Just created a PR 
adding some docstrings.

--
keywords: +patch
message_count: 3.0 -> 4.0
nosy: +alexitkes
nosy_count: 4.0 -> 5.0
pull_requests: +15938
stage: needs patch -> patch review
versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
pull_request: https://github.com/python/cpython/pull/16335

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset b5a7a4f0c20717a4c92c371583b5521b83f40f32 by Miss Islington (bot) 
(Samuel Freilich) in branch 'master':
bpo-36871: Handle spec errors in assert_has_calls (GH-16005)
https://github.com/python/cpython/commit/b5a7a4f0c20717a4c92c371583b5521b83f40f32


--
nosy: +miss-islington

___
Python tracker 

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



[issue13743] xml.dom.minidom.Document class is not documented

2019-09-24 Thread Alex Itkes


Change by Alex Itkes :


--
pull_requests:  -15938

___
Python tracker 

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



[issue13743] xml.dom.minidom.Document class is not documented

2019-09-24 Thread Alex Itkes


Change by Alex Itkes :


--
pull_requests: +15939
pull_request: https://github.com/python/cpython/pull/16355

___
Python tracker 

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



[issue38266] Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal

2019-09-24 Thread Wenzel Jakob


New submission from Wenzel Jakob :

A commit from a few days ago and discussed in issue #37878 removed an 
undocumented function PyThreadState_DeleteCurrent() from Python's public API.

This function was exposed for good reasons and simply removing it because it is 
undocumented strikes me as a somewhat brutal solution to achieve documentation 
coverage. This function is useful -- even essential -- to delete the current 
thread's thread state, which cannot be done using the still-public 
PyThreadState_Delete(). The documentation could simply be a line stating this 
explicitly.

I was asked to provide an example of an actual usage: this function is used by 
pybind11, which is a widely used library for creating Python bindings to C++ 
code. pybind11 only calls PyThreadState_DeleteCurrent() in a rare set of 
circumstances, but there is no alternative in this case. Specifically, pybind11 
can intercept a Python function call on the main() thread and delete the 
associated thread state, launching a new thread and continuing Python execution 
there (with a newly created thread state).

Kind of crazy, so why is this useful? The answer is UI libraries. On some 
platforms, it is not legal to poll UI events on any thread other than the main 
thread. This means that it's impossible to implement a proper asynchronous UI 
event loop because Python is hogging the main thread. With the functionality in 
pybind11's gil_scoped_acquire, it is possible can launch an event polling loop 
on the main thread, continue running an interactive Python REPL on another 
thread, and even swap them back e.g. when the user interface is no longer 
needed.

Best,
Wenzel

--
components: Interpreter Core
messages: 353114
nosy: eric.snow, nanjekyejoannah, ncoghlan, tcaswell, vstinner, wenzel
priority: normal
severity: normal
status: open
title: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal
type: behavior
versions: 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



[issue38267] Add thread timeout for loop.shutdown_default_executor

2019-09-24 Thread Kyle Stanley


New submission from Kyle Stanley :

Currently, for the recently added coroutine `loop.shutdown_default_executor()`, 
the executor shutdown can wait indefinitely for the threads to join. Under 
normal circumstances, waiting on the threads is appropriate, but there should 
be a timeout duration in the situation that the threads unable to finish 
joining. 

The motivation for this was based on the comments from Andrew Svetlov and Yury 
Selivanov in GH-16284.

The original idea from Andrew was to add the timeout duration as a default for 
a new parameter in `asyncio.run()` and `loop.shutdown_default_executor()`. 
However, Yury would prefer for this to be defined as a constant instead and not 
as a parameter for `asyncio.run()` to avoid the creation of an excessive number 
of parameters to tweak for the user.

I will attach a PR that adds the constant and the parameter for 
`loop.shutdown_default_executor()`, which will passed as an argument to 
`thread.join()`.

--
messages: 353115
nosy: aeros167, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Add thread timeout for loop.shutdown_default_executor
versions: Python 3.9

___
Python tracker 

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



[issue35540] dataclasses.asdict breaks with defaultdict fields

2019-09-24 Thread Paul Ganssle


Paul Ganssle  added the comment:

I checked and it appears that `attrs` handles this by creating *all* dicts 
using the default dict_factory (similar to my original suggestion of just using 
`dict` instead of the specific type), if I'm reading this right: 
https://github.com/python-attrs/attrs/blob/master/src/attr/_funcs.py#L102

Using `attr.asdict` seems to bear this out, as `defaultdict` attributes are 
converted to `dict` when the dict factory is not specified.

I think changing the default behavior like that would be a 
backwards-incompatible change at this point (and one that it's really hard to 
warn about, unfortunately), but we could still use the "fall back to 
dict_factory" behavior by trying to construct a `type(obj)(...)` and in the 
case of an exception return `dict_factory(...)`.

--

___
Python tracker 

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



[issue38266] Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal

2019-09-24 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I am okay with the revert but @victor may still have some reservations on this.

--

___
Python tracker 

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



[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue38267] Add thread timeout for loop.shutdown_default_executor

2019-09-24 Thread Kyle Stanley


Change by Kyle Stanley :


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

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-09-24 Thread Samuel Freilich


Change by Samuel Freilich :


--
keywords: +patch
pull_requests: +15942
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/16361

___
Python tracker 

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



[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread Arno-Can Uestuensoez


Arno-Can Uestuensoez  added the comment:

Hey,
first of all thank you for the fast reply.

Your examples reinforce exactly my issue. I prefer the KISS principle in 
providing isolated use-cases for transparency without extras. Which is 
seperated reduced flat calls only.

The other point is, I develop and test shared code for  Python2.7(which will be 
out there for a while...) and Python3.5+, thus prefer shared syntax whenever 
possible. The "super()" interface has changed, using the shared syntax from 
2.7.16:

- Python2.7.16:  super(type[, object-or-type])
- Python3.7.4:   super([type[, object-or-type]])

The test of your code with Python 2.7.16 requires modification.


You are right with the case 4, this is the actual issue related to the MRO and 
the parameter passing. I did not ask for the number of calls of the common base 
classes, but the passing of the parameters. The call order/MRO is OK, but I 
doubt the passed parameter signatures. My basic assumption here is that the 
call routing by MRO should or even must not be intermixed with the actually 
passed call parameters.

So I added the output of your example for "mixin_tests2.py" for Python3.6.5, 
tested for Python3.7.0 too.

#--
(3.6.5) [acue@lap001 test-modified]$ python mixin_tests2.py 

==
C MRO: ['C', 'A_With_Arg', 'B_With_Arg', 'MyBase', 'object']
C:C True
A_With_Arg:C True
call super().__init__ with argument
B_With_Arg:C True
call super().__init__ with argument
MyBase received 1 arguments
TypeError('object.__init__() takes no parameters',)
==
C MRO: ['C', 'B_With_Arg', 'A_With_Arg', 'MyBase', 'object']
C:C True
B_With_Arg:C True
call super().__init__ with argument
A_With_Arg:C True
call super().__init__ with argument
MyBase received 1 arguments
TypeError('object.__init__() takes no parameters',)
==
C MRO: ['C', 'A_With_Arg', 'B_Without_Arg', 'MyBase', 'object']
C:C True
A_With_Arg:C True
call super().__init__ with argument
B_Without_Arg:C True
call super().__init__ without argument
MyBase received 0 arguments
success
==
C MRO: ['C', 'B_Without_Arg', 'A_With_Arg', 'MyBase', 'object']
C:C True
B_Without_Arg:C True
call super().__init__ without argument
A_With_Arg:C False
success
(3.6.5) [acue@lap001 test-modified]$ 

#---

Or reduced to the focus of the actual issue and depicted the actual passed 
parameters. See the following "Case 4 - same as mixin_C_is_B0A1" for the 
essential question.

==

Case 0 - same as mixin_C_is_A1B1

   A_With_Arg:C True
   B_With_Arg:C True

   TypeError('object.__init__() takes no parameters',)

  Resulting in:
 C.__init__(True)
A_With_Arg.__init__(True)
   B_With_Arg.__init__(True)
  MyBase.__init__(True)
 object.__init__(True)

Comment:
  The TypeError is expected and OK.

==

Case 1 - same as mixin_C_is_B1A1

  B_With_Arg:C True
  A_With_Arg:C True

  TypeError('object.__init__() takes no parameters',)

  Resulting in:
 C.__init__(True)
B_With_Arg.__init__(True)
   A_With_Arg.__init__(True)
  MyBase.__init__(True)
 object.__init__(True)

Comment:
  The TypeError is expected and OK.

==

Case 2 - same as mixin_C_is_A1B0

  A_With_Arg:C True
  B_Without_Arg:C True

  MyBase received 0 arguments
  success

Comment:
  The success is expected and OK.

  The actual call due to MRO is:

 C(A_With_Arg(), B_Without_Arg())

  Resulting in:
 C.__init__(True)
A_With_Arg.__init__(True)
   B_Without_Arg.__init__(True)
  MyBase.__init__(False)
 object.__init__()

  Remark: I assume, that the single call of "object.__init__()" is here 
intentional.
  
==

Case 4 - same as mixin_C_is_B0A1

  B_Without_Arg:C True
  A_With_Arg:C False

  success

Comment:
  The success is NOT expected and as far as I can see should be treated as an 
Error so NOK.

  The actual call is:

 C(B_Without_Arg(), A_With_Arg())

  Resulting in:
 Seemingly the behaviour is:

 C.__init__(True)
B_Without_Arg.__init__(True)
   A_With_Arg.__init__(False)

 This means the call of "super(B, self).__init__()" within 
 "B.__init__()" defines the call parameters of "A.__init__()". 
 Even though I expect the call order as routed by the MRO, 
 I did not expected the parameters of A to be passed from the
 sibling class B, but as defined by the base class C. Thus the
 following:

 C.__init__(True)
B_Without_Arg()
   A_With_Arg.__init__(True)
  object.__init__(True)# this is the behaviour I expect 
   # due to the MRO and the
   # parame

[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-09-24 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +15943
pull_request: https://github.com/python/cpython/pull/16363

___
Python tracker 

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



[issue36587] race in logging code when fork()

2019-09-24 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

i don't have context for what test was needed where anymore, but 
https://github.com/python/cpython/pull/12704 removed the 
_at_fork_acquire_release_weakset.

--
resolution:  -> out of date
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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-09-24 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 2180f6b058effbf49ec819f7cedbe76ddd4b700c by Gregory P. Smith 
(Samuel Freilich) in branch 'master':
bpo-36871: Avoid duplicated 'Actual:' in assertion message (GH-16361)
https://github.com/python/cpython/commit/2180f6b058effbf49ec819f7cedbe76ddd4b700c


--

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15944
pull_request: https://github.com/python/cpython/pull/16364

___
Python tracker 

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



[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-09-24 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +15945
pull_request: https://github.com/python/cpython/pull/16365

___
Python tracker 

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



[issue38239] test_gdb fails on AMD64 Fedora Stable LTO 3.8 and AMD64 RHEL8 LTO 3.x: Unexpected gdb output

2019-09-24 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

The test probably has a fragile regex.  I don't spend time with gdb things much 
myself.

--

___
Python tracker 

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



[issue38239] test_gdb fails on AMD64 Fedora Stable LTO 3.8 and AMD64 RHEL8 LTO 3.x: Unexpected gdb output

2019-09-24 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy:  -gregory.p.smith

___
Python tracker 

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



[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread ppperry


Change by ppperry :


--
type: compile error -> behavior

___
Python tracker 

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



[issue38239] test_gdb fails on AMD64 Fedora Stable LTO 3.8 and AMD64 RHEL8 LTO 3.x: Unexpected gdb output

2019-09-24 Thread Steve Dower


Steve Dower  added the comment:

Um, okay then.

The test already includes this:

if ((sysconfig.get_config_var('PGO_PROF_USE_FLAG') or 'xxx') in
(sysconfig.get_config_var('PY_CORE_CFLAGS') or '')):
raise unittest.SkipTest("test_gdb is not reliable on PGO builds")

Apparently this no longer works. Who understands these variables enough to fix 
the issue?

--

___
Python tracker 

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



[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-09-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Recap: IDLE 3.x on Windows exits with UnicodeDecodeError when pasting into 
editor, grep, or shell window a non-BMP astral character such as
𐒢 '\U000104a2', 𝐇, 🐍 '\U0001F40D', or 
🐱 '\U0001F431' UTF-8 b'\xf0\x9f\x90\xb1', UTF-16LI b'\x3d\xd8\x31\xdc'.  
Display issues are not directly of this issue.

The exact error message has varied with the python version, but all likely 
result from the same error.

3.2 msg145581: traceback PyShell.main(), root.mainloop(), tk,mainloop().

  'utf8' codec can't decode bytes in position 1-2: invalid continuation byte

3.3 msg177750: traceback starts with two calls in new runpy module.
  'utf-8' codec can't decode bytes in position 0-2: invalid continuation byte

3.6 to now: same traceback
  'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte

The initial byte is 0xed regardless of which astral char above is pasted.  Tal, 
if the problem were utf-8 decoding uft-16le bytes, the initial byte in the 
error message for astral chars would (usually) be 0xd8, and there would be 
problems with BMP chars also.

In msg145584, I speculated that the problem might be trying to decode a now 
illegal utf-8 encoding of a surrogate character.  In msg145605, Ezio said that 
the first surrogate would be '\ud801' and showed that the 2.7 utf-8 'encoding' 
of that is b'\xed\xa0\x81' and that trying to decode that give the 3.2 error 
above, but with '0-1' instead of '1-2'.  (0xed is the utf-8 start byte for any 
BMP char and continuation bytes that map to the surrogate blocks, and some 
others, are now invalid.)  Today, b'\xed\xa0\x81'.decode('utf-8') gives exactly 
the current message above.

In msg254165, I noted that pasting copied astral chars into a plain Text widget 
works in the sense that there is no error.  (For me, 𐒢 is replaced by two 
replacement chars and the others are shown without colors, but this depends on 
OS and font.) I just verified this same for Entry widgets in IDLE dialogs and 
the Font settings sample text.  As Serhiy said in msg254165, Left x 2 is needed 
to move back past the char and Backspace x 2 to delete it.  (For me, only 1 
Right is needed to move forward past the char.)  But Serhiy also showed that 
once an astral char *is* displayed, it cannot be properly retrieved.

So the question is, if windows puts utf-16le surrogates on the clipboard, and 
they can be pasted and displayed some in a Text, why is something trying to 
utf-8 decode the utf-8 encoding of each surrogate when pasting into IDLE's 
augmented text?

In msg207381, Serhiy claimed "The root of issue is in converting strings when 
passed to Python-implemented callbacks. When a text is pasted in IDLE window, 
the callback is called (for highlighting). ...".  He goes on to explain that 
tcl *does* encode surrogates to modified utf-8 before passing to them to 
callbacks and claimed that tkinter_pythoncmd_args_2.patch should fix this.

Disabling Colorizer is not enough to allow astral pasting.  See PR 16365. 
Whatever Serhiy's patch did 5 years ago, my copy does not work now.  See PR 
16365. 

Tal, we augment the x11 paste callback in pyshell.fix_x11_paste.  There is no 
unittest and we would have to not break this with further change.

I have thought about replacing the paste callback with clipboard_get, but 
worried that we might not be able to replicate what the system-specific 
tcl/tk/C code does.  That sometimes includes displaying the actual astral 
character. I presume that tcl just passes the clipboard bytes to the graphics 
system, which we cannot do from python.

Anyway, you have shown that clipboard.get does not currently work as we might 
want.  From what Serhiy has said, char *s points to invalid utf-8 bytes.

--

___
Python tracker 

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



[issue38234] The value of Py_SetPath is not used to populate the configuration

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15946
pull_request: https://github.com/python/cpython/pull/16366

___
Python tracker 

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



[issue38234] The value of Py_SetPath is not used to populate the configuration

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 52ad33abbfb6637d74932617c7013bae0ccf6e32 by Victor Stinner in 
branch 'master':
bpo-38234: test_embed: test pyvenv.cfg and pybuilddir.txt (GH-16366)
https://github.com/python/cpython/commit/52ad33abbfb6637d74932617c7013bae0ccf6e32


--

___
Python tracker 

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



[issue38262] Mixins - super calls in bases of multiple-inheritance with different parameters

2019-09-24 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Apologies for the Python 2.7 incompatible syntax, I hadn't noticed that you had 
selected 2.7. But since 2.7 (and 3.8) are in feature freeze, any behavoural 
changes can only apply to 3.9 or later.

I'm afraid that you haven't explained why you think the code is buggy. Does the 
behaviour differ from the documented behaviour in any way?

"My basic assumption here is that the call routing by MRO should or even must 
not be intermixed with the actually passed call parameters."

I'm afraid I don't understand this.

"Remark: I assume, that the single call of "object.__init__()" is here 
intentional."

Of course it is intentional, as calling a superclass method twice is incorrect 
behaviour. You cannot expect that all superclass methods are idempotent. 
Obviously, in the case of ``object`` itself, there's no harm in calling 
__init__ twice but think about superclasses that have side-effects, or do 
expensive processing, and aren't idempotent. If you call them twice in the 
inheritance chain, bad things can happen.

Which is why languages that support multiple inheritance generally require that 
the MRO is linearized so that each superclass is called once and exactly once. 
That was the problem with Python 2 classic classes and fixing it was one of the 
motivations of introducing so-called "new style classes" and object.

See the link I provided in my previous comment, and also:

https://courses.cs.northwestern.edu/325/readings/inheritance.php

Unless you can explain how and why this behaviour differs from the documented 
behaviour, I'm going to close this as "Not a bug". If you want to argue that 
the C3 linearization algorithm is "wrong", you probably should take that to the 
Python-Dev mailing list. The argument by KISS is probably not going to be 
enough: it is more important for code to be *correct* than to be simple, and 
the simple multiple inheritance algorithm is demonstrably incorrect.

--
versions: +Python 3.9 -Python 2.7, Python 3.6

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset 1a17a054f6314ce29cd2632c28aeed317a615360 by Miss Islington (bot) 
in branch '3.8':
[3.8] bpo-36871: Handle spec errors in assert_has_calls (GH-16005) (GH-16364)
https://github.com/python/cpython/commit/1a17a054f6314ce29cd2632c28aeed317a615360


--

___
Python tracker 

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



  1   2   >