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

Thank you @serhiy.storchaka and Kyle Stanley for the code review and approve.

This issue is now solved.
I close this issue.

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



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

2019-09-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ad7736faf5b82a24374c601a72599adf29951080 by Serhiy Storchaka 
(Dong-hee Na) in branch 'master':
bpo-38265: Update os.pread to accept the length type as Py_ssize_t. (GH-16359)
https://github.com/python/cpython/commit/ad7736faf5b82a24374c601a72599adf29951080


--

___
Python tracker 

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



[issue36046] support dropping privileges when running subprocesses

2019-09-24 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution:  -> fixed
stage: patch review -> commit review
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:

i believe the issues surfaces in this are fixed at this point.

of note, my mock_call_test.py example now passes.

i'm not entirely sure that it _should_ pass though, but that depends on what we 
want create_autospec of a class to do.  should that autospec'd class require 
instantiation before methods are called?  _that_ is outside the scope of this 
issue.  As is, the current behavior is likely what people expect to find 
convenient.

--
assignee: michael.foord -> gregory.p.smith
resolution:  -> fixed
stage: patch review -> commit review
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 4042e1afd252858de53e2b79d946a51a0182d1ba by Gregory P. Smith in 
branch '3.7':
[3.7] bpo-36871: Handle spec errors in assert_has_calls (GH-16364) (GH-16374)
https://github.com/python/cpython/commit/4042e1afd252858de53e2b79d946a51a0182d1ba


--

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-24 Thread Dong-hee Na


Dong-hee Na  added the comment:

I've proposed the patch on GitHub which escaping the server_title when the 
documenter.page is called. (It different point with msg353132.

--

___
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


Change by Gregory P. Smith :


--
pull_requests: +15954
pull_request: https://github.com/python/cpython/pull/16374

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-24 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2019-09-24 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset 16c0f6df62a39f9f7712b1c0577de4eefcb4c1bf by Vinay Sajip (Miss 
Islington (bot)) in branch '3.7':
bpo-22273: Update ctypes to correctly handle arrays in small structur… 
(GH-15839) (GH-16369)
https://github.com/python/cpython/commit/16c0f6df62a39f9f7712b1c0577de4eefcb4c1bf


--

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2019-09-24 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset ce62dcc460cf88f663c34c4a0948c1ee1dc53f4d by Vinay Sajip (Miss 
Islington (bot)) in branch '3.8':
bpo-22273: Update ctypes to correctly handle arrays in small structur… 
(GH-15839) (GH-16370)
https://github.com/python/cpython/commit/ce62dcc460cf88f663c34c4a0948c1ee1dc53f4d


--

___
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: +15952
pull_request: https://github.com/python/cpython/pull/16372

___
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: +15951
pull_request: https://github.com/python/cpython/pull/16371

___
Python tracker 

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



[issue38255] Replace "method" with "attribute" in the description of super()

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



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

Fix two typos in my previous post:

#>>>
This basic diamond structure represents the call signatures:

   I:   for D
   II:  for B and C
   III: for A
#<<<

and 

#>>>
The current implementation changes the routed method calls to the following 
call signatures:

   I:   for D
   II:  for B
   III: for C and A
#<<<

--

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

Hi,
first of all thank you both for the fast reply.

The point is here, that the call routing and the parameter passing are 
intermixed. The MRO defines the call order, but does not define a signature 
change for the call within one inheritance layer.

All articles I found including the mentioned 
blog-post(https://rhettinger.wordpress.com/2011/05/26/super-considered-super/) 
deal with the call order. But as far as I can see all imply silently the 
correctness of the call signatures defined by the derived classes - see also 
https://en.wikipedia.org/wiki/Object-oriented_programming#Polymorphism.

Well, this is so common for me since about 1990, that I even have to think 
about how to explain.

The simple diagram of the basic 4-class diamond depicts the call routing and 
the call signatures - see
https://en.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem.

The class hierarchy is

A
|
+---+---+
|   |
B   C
|   |
+---+---+
|
D

with the classes

   A or more precise A(object)
   B(A)
   C(A)   
   D(B, C)
   
The resulting call routing MRO/C3 linearization - 
https://en.wikipedia.org/wiki/C3_linearization - is:

   D -> B -> C -> A

See https://en.wikipedia.org/wiki/Multiple_inheritance#Mitigation, and 
https://www.python.org/download/releases/2.2.3/descrintro/#mro.

This basic diamond structure represents the call signatures:

   I:   for D
   II:  for B and C
   III: for D

The call signature of a given method interface for the implementation of class 
D has to be equally defined by the classes B *AND* C! Which means has to be the 
same - ignoring defaults here. This is how OO works. Though the called 
signatures of the classes B *AND* C has to be identical too! Which is 
completely independent from the dynamic call order - but defined by the static 
inheritance graph.

This is in particular true due to the fact, that the single inheritance call 
signatures has to be identical too

   D(B).mthX() == D(C).mthX()

or in general - related to the call signatures the following interface calls 
are defined to have equal call parameters(ignoring defaults here):

   D(B,C).mthX() == D(C,D).mthX() == D(B).mthX() == D(C).mthX()

Anything else is an error.

The current implementation changes the routed method calls to the following 
call signatures:

   I:   for D
   II:  for B
   III: for C and D

So this is not just an inconvenience as you mentioned. It is simply a bug.

--
resolution: not a bug -> postponed
Added file: https://bugs.python.org/file48625/mixin_C_is_B0A1.py

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2019-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15950
pull_request: https://github.com/python/cpython/pull/16370

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2019-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15949
pull_request: https://github.com/python/cpython/pull/16369

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2019-09-24 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset 12f209eccb1587e8c98057d9c5f865c21f4a16c1 by Vinay Sajip in branch 
'master':
bpo-22273: Update ctypes to correctly handle arrays in small structur… 
(GH-15839)
https://github.com/python/cpython/commit/12f209eccb1587e8c98057d9c5f865c21f4a16c1


--

___
Python tracker 

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



[issue36947] Fix 3.3.3.1 Metaclasses Documentation

2019-09-24 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

The existing documentation is correct, just hard to understand if you don't 
already understand the point of metaclasses (metaclasses are hard, the language 
to describe them will be inherently a little klunky).

At some point, it might be nice to write a proper metaclass tutorial, even if 
it's only targeted at advanced users (the only people who should really be 
considering writing their own metaclasses or even directly using existing ones; 
everyone else should be using more targeted tools and/or inheriting from 
classes that already implement the desired metaclass).

The Data model docs aren't concerned with tutorials and examples though; 
they're just dry description, and they're doing their job here, so I think this 
issue can be closed.

--

___
Python tracker 

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



[issue38255] Replace "method" with "attribute" in the description of super()

2019-09-24 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

I prefer rhettinger's PR to your proposed PR; while super() may be useful for 
things other than methods, the 99% use case is methods, and deemphasizing that 
is a bad idea. rhettinger's PR adds a note about other use cases without 
interfering with super()'s primary use case.

--
nosy: +josh.r

___
Python tracker 

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



[issue38255] Replace "method" with "attribute" in the description of super()

2019-09-24 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-24 Thread Dong-hee Na


Dong-hee Na  added the comment:

Looks like this issue can be solved by below code changed.

@@ -833,7 +834,7 @@ class XMLRPCDocGenerator:
 def set_server_title(self, server_title):
 """Set the HTML title of the generated server documentation"""

-self.server_title = server_title
+self.server_title = html.escape(server_title)

--

___
Python tracker 

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-24 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
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 Raymond Hettinger


Raymond Hettinger  added the comment:

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

Sorry, this isn't a bug.  In may be inconvenient but it is intrinsic to how 
cooperative multiple inheritance works.  

FWIW, the techniques for managing parameter passing are covered in this blog 
post:  https://rhettinger.wordpress.com/2011/05/26/super-considered-super/

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



[issue38243] A reflected XSS in python/Lib/DocXMLRPCServer.py

2019-09-24 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +mdk, vstinner

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

And on FreeBSD.

AMD64 FreeBSD CURRENT Shared 3.x:
https://buildbot.python.org/all/#/builders/168/builds/1510

==
FAIL: test_init_pybuilddir (test.test_embed.InitConfigTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_embed.py",
 line 1130, in test_init_pybuilddir
self.check_all_configs("test_init_compat_config", config,
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_embed.py",
 line 681, in check_all_configs
self.check_config(configs, expected_config)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_embed.py",
 line 613, in check_config
self.assertEqual(config, expected)
AssertionError: {'_co[671 chars]ne, 'module_search_paths': 
['/usr/home/buildbo[1297 chars]': 1} != {'_co[671 chars]ne, 'executable': 
'/tmp/tmpsa4mgwz2/_testembed[1285 chars]': 1}
  {'_config_init': 1,
   '_init_main': 1,
   '_install_importlib': 1,
   'argv': [''],
   'base_exec_prefix': 
'/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/target',
-  'base_executable': '/var/tmp/tmpsa4mgwz2/_testembed',
?  

+  'base_executable': '/tmp/tmpsa4mgwz2/_testembed',
   'base_prefix': 
'/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/target',
   'buffered_stdio': 1,
   'bytes_warning': 0,
   'check_hash_pycs_mode': 'default',
   'configure_c_stdio': 0,
   'dev_mode': 0,
   'dump_refs': 0,
   'exec_prefix': 
'/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/target',
-  'executable': '/var/tmp/tmpsa4mgwz2/_testembed',
? 

+  'executable': '/tmp/tmpsa4mgwz2/_testembed',
   'faulthandler': 0,
   'hash_seed': 0,
   'home': None,
   'import_time': 0,
   'inspect': 0,
   'install_signal_handlers': 1,
   'interactive': 0,
   'isolated': 0,
   'malloc_stats': 0,
   'module_search_paths': 
['/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/target/lib/python39.zip',
   
'/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib',
   
'/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/build/lib.freebsd-13.0-CURRENT-amd64-3.9-pydebug',
   
'/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/target/lib/python39.zip',
   
'/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/target/lib/python3.9',
-  '/var/tmp/tmpsa4mgwz2/libdir'],
?   

+  '/tmp/tmpsa4mgwz2/libdir'],
   'optimization_level': 0,
   'parse_argv': 0,
   'parser_debug': 0,
   'pathconfig_warnings': 1,
   'prefix': '/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/target',
   'program_name': './_testembed',
   'pycache_prefix': None,
   'pythonpath_env': 
'/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/target/lib/python39.zip:/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib:/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/build/lib.freebsd-13.0-CURRENT-amd64-3.9-pydebug',
   'quiet': 0,
   'run_command': None,
   'run_filename': None,
   'run_module': None,
   'show_alloc_count': 0,
   'show_ref_count': 0,
   'site_import': 1,
   'skip_source_first_line': 0,
   'tracemalloc': 0,
   'use_environment': 1,
   'use_hash_seed': 0,
   'user_site_directory': 1,
   'verbose': 0,
   'warnoptions': [],
   'write_bytecode': 1,
   'xoptions': []}

==
FAIL: test_init_pyvenv_cfg (test.test_embed.InitConfigTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_embed.py",
 line 1182, in test_init_pyvenv_cfg
self.check_all_configs("test_init_compat_config", config,
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_embed.py",
 line 681, in check_all_configs
self.check_config(configs, expected_config)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_embed.py",
 line 613, in check_config
self.assertEqual(config, expected)
AssertionError: {'_co[671 chars]ne, 'module_search_paths': 
['/usr/home/buildbo[1216 chars]': 1} != {'_co[671 chars]ne, 'executable': 
'/tmp/tmpszvtbyq4/_testembed[1208 chars]': 1}
  {'_config_init': 1,
   '_init_main': 1,
   '_install_importlib': 1,
   'argv': [''],
   'base_exec_prefix': '/tmp/tmpr0gyjdqs',
-  'base_executable': '/var/tmp/tmpszvtbyq4/_testembed',
?  

+  'base_executable': '/tmp/tmpszvtbyq4/_testembed',
   'base_prefix': 
'/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/target',
   'buffered_stdio': 1,
   'bytes_warning': 0,
   

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

2019-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

The new tests fail on macOS.

x86-64 High Sierra 3.x:
https://buildbot.python.org/all/#/builders/145/builds/2469

==
FAIL: test_init_pybuilddir (test.test_embed.InitConfigTests)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_embed.py",
 line 1130, in test_init_pybuilddir
self.check_all_configs("test_init_compat_config", config,
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_embed.py",
 line 681, in check_all_configs
self.check_config(configs, expected_config)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_embed.py",
 line 613, in check_config
self.assertEqual(config, expected)
AssertionError: {'_co[655 chars]ne, 'module_search_paths': 
['/Users/buildbot/b[1407 chars]': 1} != {'_co[655 chars]ne, 'executable': 
'/var/folders/sy/9hwmqyx14s1[1383 chars]': 1}
  {'_config_init': 1,
   '_init_main': 1,
   '_install_importlib': 1,
   'argv': [''],
   'base_exec_prefix': 
'/Users/buildbot/buildarea/3.x.billenstein-sierra/build/target',
-  'base_executable': 
'/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v4gt/T/tmp2a98rb5k/_testembed',
?  

+  'base_executable': 
'/var/folders/sy/9hwmqyx14s11577cvgzwf2v4gt/T/tmp2a98rb5k/_testembed',
   'base_prefix': 
'/Users/buildbot/buildarea/3.x.billenstein-sierra/build/target',
   'buffered_stdio': 1,
   'bytes_warning': 0,
   'check_hash_pycs_mode': 'default',
   'configure_c_stdio': 0,
   'dev_mode': 0,
   'dump_refs': 0,
   'exec_prefix': 
'/Users/buildbot/buildarea/3.x.billenstein-sierra/build/target',
-  'executable': 
'/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v4gt/T/tmp2a98rb5k/_testembed',
? 

+  'executable': 
'/var/folders/sy/9hwmqyx14s11577cvgzwf2v4gt/T/tmp2a98rb5k/_testembed',
   'faulthandler': 0,
   'hash_seed': 0,
   'home': None,
   'import_time': 0,
   'inspect': 0,
   'install_signal_handlers': 1,
   'interactive': 0,
   'isolated': 0,
   'malloc_stats': 0,
   'module_search_paths': 
['/Users/buildbot/buildarea/3.x.billenstein-sierra/build/target/lib/python39.zip',
   
'/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib',
   
'/Users/buildbot/buildarea/3.x.billenstein-sierra/build/build/lib.macosx-10.13-x86_64-3.9-pydebug',
   
'/Users/buildbot/buildarea/3.x.billenstein-sierra/build/target/lib/python39.zip',
   
'/Users/buildbot/buildarea/3.x.billenstein-sierra/build/target/lib/python3.9',
-  
'/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v4gt/T/tmp2a98rb5k/libdir'],
?   

+  
'/var/folders/sy/9hwmqyx14s11577cvgzwf2v4gt/T/tmp2a98rb5k/libdir'],
   'optimization_level': 0,
   'parse_argv': 0,
   'parser_debug': 0,
   'pathconfig_warnings': 1,
   'prefix': '/Users/buildbot/buildarea/3.x.billenstein-sierra/build/target',
   'program_name': './_testembed',
   'pycache_prefix': None,
   'pythonpath_env': 
'/Users/buildbot/buildarea/3.x.billenstein-sierra/build/target/lib/python39.zip:/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib:/Users/buildbot/buildarea/3.x.billenstein-sierra/build/build/lib.macosx-10.13-x86_64-3.9-pydebug',
   'quiet': 0,
   'run_command': None,
   'run_filename': None,
   'run_module': None,
   'show_alloc_count': 0,
   'show_ref_count': 0,
   'site_import': 1,
   'skip_source_first_line': 0,
   'tracemalloc': 0,
   'use_environment': 1,
   'use_hash_seed': 0,
   'user_site_directory': 1,
   'verbose': 0,
   'warnoptions': [],
   'write_bytecode': 1,
   'xoptions': []}

==
FAIL: test_init_pyvenv_cfg (test.test_embed.InitConfigTests)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_embed.py",
 line 1182, in test_init_pyvenv_cfg
self.check_all_configs("test_init_compat_config", config,
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_embed.py",
 line 681, in check_all_configs
self.check_config(configs, expected_config)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_embed.py",
 line 613, in check_config
self.assertEqual(config, expected)
AssertionError: {'_co[655 chars]ne, 'module_search_paths': 
['/Users/buildbot/b[1416 chars]': 1} != {'_co[655 chars]ne, 'executable': 
'/var/folders/sy/9hwmqyx14s1[1400 chars]': 1}
  {'_config_init': 1,
   '_init_main': 1,
   '_install_importlib': 1,
   'argv': [''],
   'base_exec_prefix': 
'/var/folders/sy/9hwmqyx14s11577cvgzwf2v4gt/T/tmprrz3csek',
-  

[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 221fd84703c545408bbb4a6e0b58459651331f5c by Victor Stinner in 
branch 'master':
bpo-38234: Cleanup getpath.c (GH-16367)
https://github.com/python/cpython/commit/221fd84703c545408bbb4a6e0b58459651331f5c


--

___
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 STINNER Victor


STINNER Victor  added the comment:

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

Some failures are LTO + PGO builds, but test_gdb also fails on LTO without PGO 
builds.

The PGO_PROF_USE_FLAG check only checks for PGO.

--

___
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: +15947
pull_request: https://github.com/python/cpython/pull/16367

___
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



[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



[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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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



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

[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



[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



[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



[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



[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



[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



[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



[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



[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



[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


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



[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



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

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:

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


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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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


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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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



[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



  1   2   >