[issue39557] ThreadPoolExecutor is busy-waiting when idle.

2020-02-05 Thread Mark Dickinson


Mark Dickinson  added the comment:

On the HEAD of the current 3.7 branch, the file you refer to has the following 
code starting at line 37:

while True:
work_item = work_queue.get(block=True)
if work_item is not None:
work_item.run()
...

Code link: 
https://github.com/python/cpython/blob/6ba8dc6aae6fa0a7e29ba4ac18227beb38872392/Lib/concurrent/futures/thread.py#L77-L80

Is that the code you're referring to?

If that's not the code you mean, please could you say exactly which version of 
Python you're looking at? (Code gets added and removed over time, so a line 
number isn't all that helpful without additional information).

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue39557] ThreadPoolExecutor is busy-waiting when idle.

2020-02-05 Thread Mark Dickinson


Mark Dickinson  added the comment:

It would also be helpful to know which platform you're observing the 100% CPU 
usage on, so that we can try to reproduce.

--

___
Python tracker 

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



[issue39557] ThreadPoolExecutor is busy-waiting when idle.

2020-02-05 Thread Avraham Mahfuda


Avraham Mahfuda  added the comment:

1. I can confirm that the posted code above is the correct one.
2. The 100% CPU was observed in a docker instance using python:3.7.0-alpine3.8 
image.
3. The docker image was running on a 2 cores VM.

--

___
Python tracker 

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



[issue39505] redundant ‘/’ in $env:VIRTUAL_ENV when use venv in powershell

2020-02-05 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 787b6d548c250f36df6d3f3179f60d754c8aa5e3 by schwarzichet in 
branch 'master':
bpo-39505: delete the redundant '/' in $env:VIRTUAL_ENV (GH-18290)
https://github.com/python/cpython/commit/787b6d548c250f36df6d3f3179f60d754c8aa5e3


--

___
Python tracker 

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



[issue39505] redundant ‘/’ in $env:VIRTUAL_ENV when use venv in powershell

2020-02-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17734
pull_request: https://github.com/python/cpython/pull/18359

___
Python tracker 

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



[issue39557] ThreadPoolExecutor is busy-waiting when idle.

2020-02-05 Thread Avraham Mahfuda


Avraham Mahfuda  added the comment:

If I understand the following code correctly, there seems to be a busy loop 
waiting for the SimpleQueue.put to signal that an item was entered to queue.
https://github.com/python/cpython/blob/3.7/Modules/_queuemodule.c#L217

--

___
Python tracker 

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



[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-02-05 Thread Stefan Behnel


Stefan Behnel  added the comment:

Ok, this is merged into 3.9. To which versions should we backport it?
Definitely 3.8, definitely not 3.5, probably not 3.6 (since it's not a security 
issue). Ned, what about 3.7?

--
nosy: +ned.deily
stage: patch review -> backport needed

___
Python tracker 

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



[issue39505] redundant ‘/’ in $env:VIRTUAL_ENV when use venv in powershell

2020-02-05 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 927d3aab1c7874b5705fcc8269ea608315434e66 by Miss Islington (bot) 
in branch '3.8':
bpo-39505: delete the redundant '/' in $env:VIRTUAL_ENV (GH-18290) (GH-18359)
https://github.com/python/cpython/commit/927d3aab1c7874b5705fcc8269ea608315434e66


--

___
Python tracker 

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



[issue39505] redundant ‘/’ in $env:VIRTUAL_ENV when use venv in powershell

2020-02-05 Thread Vinay Sajip


Change by Vinay Sajip :


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



[issue39538] SystemError when set Element.attrib to non-dict

2020-02-05 Thread Stefan Behnel

Stefan Behnel  added the comment:

I agree that SystemError is the wrong response. Whether it needs to be 
AttributeError – probably fine to consider this an implementation detail. 
TypeError also seems ok in at least some of the cases. I think we should widen 
the code to expect some kind of Mapping (instead of strictly a dict), and if we 
don't find that on access, a TypeError seems just as good as an AttributeError 
from Python.

I'm unsure if we should restrict assignments to ".attrib". It's probably enough 
to allow "None" assignments to say "no attributes allowed", Everything else can 
be handled by some kind of Mapping object. But then, why not just use the 
Mapping protocol on access and leave errors to that stage?

--
stage:  -> needs patch

___
Python tracker 

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



[issue38149] sys.audit() is called multiple times for glob.glob()

2020-02-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39543] Py_DECREF(): use inlined _Py_Dealloc()

2020-02-05 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39543] Py_DECREF(): use inlined _Py_Dealloc()

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote a quick & dirty local patch to define again _Py_NewReference() and 
_Py_Dealloc() as inline function in object.h before Py_DECREF(). I failed to 
see a clear win in term of performance.

Microbenchmark:

./python -m pyperf timeit --duplicate=4096 'o=object(); o=None' -l 512

Result if _Py_Dealloc() is inlined again:

Mean +- std dev: [opaque] 69.3 ns +- 1.5 ns -> [dealloc] 67.5 ns +- 1.5 ns: 
1.03x faster (-3%)

Result if _Py_Dealloc() and _Py_NewReference() are inlined again:

Mean +- std dev: [opaque] 69.3 ns +- 1.5 ns -> [dealloc_newref] 66.1 ns +- 1.3 
ns: 1.05x faster (-5%)

It's a matter of 3.2 nanoseconds. Honestly, I don't think that it's worth it to 
bother with that. I expect way more siginificant speedup with more advanced 
optimizations like using a tracing GC or tagged pointers, and these 
optimizations require to better hide implementation details.

_Py_Dealloc() was converted to a regular function was mistake when I moved code 
to cpython/object.h and nobody noticed.

For all these reasons, I wrote PR 18361 to remove the unused _Py_Dealloc() 
macro, rather than trying to inline it again.

--

___
Python tracker 

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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +17737
pull_request: https://github.com/python/cpython/pull/18362

___
Python tracker 

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



[issue39127] _Py_HashPointer's void * argument should be const

2020-02-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
type:  -> enhancement
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



[issue35799] fix or remove smtpd.PureProxy

2020-02-05 Thread Carl Harris


Change by Carl Harris :


--
nosy: +hitbox

___
Python tracker 

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



[issue39543] Py_DECREF(): use inlined _Py_Dealloc()

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f16433a73138f279642e581074135694ddcfe965 by Victor Stinner in 
branch 'master':
bpo-39543: Remove unused _Py_Dealloc() macro (GH-18361)
https://github.com/python/cpython/commit/f16433a73138f279642e581074135694ddcfe965


--

___
Python tracker 

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



[issue39543] Remove unused _Py_Dealloc() macro

2020-02-05 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: Py_DECREF(): use inlined _Py_Dealloc() -> Remove unused _Py_Dealloc() 
macro
versions:  -Python 3.8

___
Python tracker 

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



[issue39558] Implement __len__() for itertools.combinations

2020-02-05 Thread Борис Верховский

New submission from Борис Верховский :

and the other objects that have a straightforward formula for the number of 
elements they will generate.

--
components: Library (Lib)
messages: 361421
nosy: boris
priority: normal
severity: normal
status: open
title: Implement __len__() for itertools.combinations
type: enhancement
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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0fa4f43db086ac3459811cca4ec5201ffbee694a by Victor Stinner in 
branch 'master':
bpo-39542: Exclude trashcan from the limited C API (GH-18362)
https://github.com/python/cpython/commit/0fa4f43db086ac3459811cca4ec5201ffbee694a


--

___
Python tracker 

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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +17738
pull_request: https://github.com/python/cpython/pull/18363

___
Python tracker 

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Sebastian Rittau


New submission from Sebastian Rittau :

uuid.getnode() has an undocumented, keyword-only "getters" argument that gets 
discarded immediately. This is confusing when using code inspection tools and 
can give the wrong impression that you can somehow override the node getters 
when you can't. I recommend removing this argument.

--
components: Library (Lib)
messages: 361423
nosy: srittau
priority: normal
severity: normal
status: open
title: uuid.getnode() has unused argument
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Shantanu points out in https://github.com/python/typeshed/pull/3715 that the 
argument was made useless due to bpo-28009.

--

___
Python tracker 

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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f58bd7c1693fe041f7296a5778d0a11287895648 by Victor Stinner in 
branch 'master':
bpo-39542: Make PyObject_INIT() opaque in limited C API (GH-18363)
https://github.com/python/cpython/commit/f58bd7c1693fe041f7296a5778d0a11287895648


--

___
Python tracker 

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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +17739
pull_request: https://github.com/python/cpython/pull/18364

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-02-05 Thread hai shi


Change by hai shi :


--
pull_requests: +17740
pull_request: https://github.com/python/cpython/pull/18365

___
Python tracker 

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



[issue39560] PyUnicode_FromKindAndData kind transformation is not documented

2020-02-05 Thread Santiago M. Mola


New submission from Santiago M. Mola :

PyUnicode_FromKindAndData copies input data and transforms it to the most 
compact representation. This behavior is not documented.

Proposed wording:

> The input buffer is copied and transformed into the canonical representation, 
> if necessary. For example, if the buffer is a UCS4 string 
> (PyUnicode_4BYTE_KIND) and it consists only of codepoints in the UCS1 range, 
> it will be transformed into UCS1 (PyUnicode_1BYTE_KIND).

--
assignee: docs@python
components: Documentation
messages: 361426
nosy: docs@python, smola
priority: normal
severity: normal
status: open
title: PyUnicode_FromKindAndData kind transformation is not documented
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue39558] Implement __len__() for itertools.combinations

2020-02-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-02-05 Thread hai shi


hai shi  added the comment:

i thinkt that not checking `PyModule_AddObject()`'s result may cause this 
probleam too.

1) python-ast.c have one question, i fix it in PR18358.
2) most of the questions in extension module, for example: 
https://github.com/python/cpython/blob/master/Modules/gcmodule.c#L2019-L2022

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-02-05 Thread hai shi


hai shi  added the comment:

update the above info:
1) python-ast.c have one question, i fix it in PR18365.

--

___
Python tracker 

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



[issue39558] Implement __len__() for itertools.combinations

2020-02-05 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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 509dd90f4684e40af3105dd3e754fa4b9c1530c1 by Victor Stinner in 
branch 'master':
bpo-39542: Convert PyType_Check() to static inline function (GH-18364)
https://github.com/python/cpython/commit/509dd90f4684e40af3105dd3e754fa4b9c1530c1


--

___
Python tracker 

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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +17741
pull_request: https://github.com/python/cpython/pull/18366

___
Python tracker 

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



[issue39558] Implement __len__() for itertools.combinations

2020-02-05 Thread Mark Dickinson


Mark Dickinson  added the comment:

This is essentially a duplicate of #27678 and #24849 (and there may be others).

Note that the math module now has `prod`, `comb` and `perm`, which match the 
lengths of the full `product`, `combinations` and `permutations` itertools 
functions.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0e4e735d06967145b49fd00693627f3624991dbc by Victor Stinner in 
branch 'master':
bpo-39542: Define PyTypeObject earlier in object.h (GH-18366)
https://github.com/python/cpython/commit/0e4e735d06967145b49fd00693627f3624991dbc


--

___
Python tracker 

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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, object.h looks much better now! I close the 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



[issue39558] Implement __len__() for itertools.combinations

2020-02-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> duplicate
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



[issue38628] Issue with ctypes in AIX

2020-02-05 Thread David Edelsohn


David Edelsohn  added the comment:

The bug report implies a different bug than what is being reported.  The bug is 
not related to calling a LIBC function with an argument list that does not 
match the function signature.

The true issue is that a Python ctypes structure definition on AIX that 
contains an array as in the example does not create an argument list that 
matches the AIX ABI for argument passing.  An example that directly uses libffi 
seems to work, but invoking libffi via Python ctypes does not.

In other words, Python ctypes structures created with _fields_ equivalent to

struct {
  const char *s;
  unsigned long d;
  size_t n;
}

should produce the same argument list as

struct {
  const char *s;
  unsigned long c_n[2];
}

but the version with the array does not.

libffi passes arrays as pointers, so Python ctypes converts arrays passed by 
value as libffi structs.  This occurs in cpython/Modules/_ctypes/stgdict.c .  
It is likely that ctypes is not generating the correct libffi descriptor.

The memchr example visually demonstrates the incorrect argument list, but is 
not intended to be correct, safe use of ctypes.

--

___
Python tracker 

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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +17742
pull_request: https://github.com/python/cpython/pull/18368

___
Python tracker 

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



[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.6 doesn't accept bugfixes anymore:
https://devguide.python.org/#status-of-python-branches

The bugfix can go into 3.7 and 3.8.

--
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:

The test fails on Windows. Example on AMD64 Windows8.1 Refleaks 3.x:
https://buildbot.python.org/all/#/builders/157/builds/76

==
FAIL: test_unicode_module_names 
(distutils.tests.test_build_ext.BuildExtTestCase)
--
Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release.refleak\build\lib\distutils\tests\test_build_ext.py",
 line 315, in test_unicode_module_names
self.assertRegex(cmd.get_ext_filename(modules[0].name), r'foo\..*')
AssertionError: Regex didn't match: 'foo\\..*' not found in 
'foo_d.cp39-win_amd64.pyd'

==
FAIL: test_unicode_module_names 
(distutils.tests.test_build_ext.ParallelBuildExtTestCase)
--
Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release.refleak\build\lib\distutils\tests\test_build_ext.py",
 line 315, in test_unicode_module_names
self.assertRegex(cmd.get_ext_filename(modules[0].name), r'foo\..*')
AssertionError: Regex didn't match: 'foo\\..*' not found in 
'foo_d.cp39-win_amd64.pyd'

--
nosy: +vstinner

___
Python tracker 

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



[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-02-05 Thread STINNER Victor

STINNER Victor  added the comment:

I put a breakpoint before the error:

test_unicode_module_names (distutils.tests.test_build_ext.BuildExtTestCase) ... 
> c:\vstinner\python\master\lib\distutils\tests
\test_build_ext.py(316)test_unicode_module_names()
-> self.assertRegex(cmd.get_ext_filename(modules[0].name), r'foo\..*')
(Pdb) p modules
[, 
]
(Pdb) p modules[0].name
'foo'
(Pdb) p modules[1].name 
'föö'

--

___
Python tracker 

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



[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:

On Windows, names get a "_d" suffix for debug. Extract of build_ext.py:

def get_libraries(self, ext):
"""Return the list of libraries to link against when building a
shared extension.  On most platforms, this is just 'ext.libraries';
on Windows, we add the Python library (eg. python20.dll).
"""
# The python library is always needed on Windows.  For MSVC, this
# is redundant, since the library is mentioned in a pragma in
# pyconfig.h that MSVC groks.  The other Windows compilers all seem
# to need it mentioned explicitly, though, so that's what we do.
# Append '_d' to the python import library on debug builds.
if sys.platform == "win32":
from distutils._msvccompiler import MSVCCompiler
if not isinstance(self.compiler, MSVCCompiler):
template = "python%d%d"
if self.debug:
template = template + '_d'
(...)

--

___
Python tracker 

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



[issue39561] AMD64 Fedora Rawhide LTO + PGO 3.x: "checking for getaddrinfo... no"

2020-02-05 Thread STINNER Victor


New submission from STINNER Victor :

On AMD64 Fedora Rawhide LTO + PGO 3.x buildbot, "checking for getaddrinfo... 
no" failed:

https://buildbot.python.org/all/#/builders/154/builds/243

checking for getaddrinfo... no
Fatal: You must get working getaddrinfo() function.
   or you can specify "--disable-ipv6".

It sounds like a regression in Fedora Rawhide libc.

--
components: Build
messages: 361438
nosy: vstinner
priority: normal
severity: normal
status: open
title: AMD64 Fedora Rawhide LTO + PGO 3.x: "checking for getaddrinfo... no"
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



[issue39561] AMD64 Fedora Rawhide LTO + PGO 3.x: "checking for getaddrinfo... no"

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:

Oh strange, it's back to green on the follow build:
https://buildbot.python.org/all/#/builders/154/builds/244

I close the issue.

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



[issue39488] test_largefile: TestSocketSendfile.test_it() uses too much disk space

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b39fb8e847ac59b539ad7e93df91c1709815180e by Giampaolo Rodola in 
branch 'master':
bpo-39488: Skip test_largefile tests if not enough disk space (GH-18261)
https://github.com/python/cpython/commit/b39fb8e847ac59b539ad7e93df91c1709815180e


--

___
Python tracker 

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



[issue39488] test_largefile: TestSocketSendfile.test_it() uses too much disk space

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:

Giampaolo Rodola modified the tests to skip them if there is not enough disk 
space. Let's see if it's enough to fix these buildbots. Since the issue was 
random, I close the issue and just hope that it's now fixed :-)

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



[issue39542] Cleanup object.h header

2020-02-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 58f4e1a6ee4c6ea82f3f5075d9d9d344ce6b8a56 by Victor Stinner in 
branch 'master':
bpo-39542: Declare _Py_AddToAllObjects() in pycore_object.h (GH-18368)
https://github.com/python/cpython/commit/58f4e1a6ee4c6ea82f3f5075d9d9d344ce6b8a56


--

___
Python tracker 

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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-02-05 Thread jack1142


New submission from jack1142 :

asyncio REPL doesn't allow using asynchronous comprehensions outside of async 
func. Same behavior can also be observed when using 
`ast.PyCF_ALLOW_TOP_LEVEL_AWAIT` flag in `compile()`

Example with `async for`:
>>> async def async_gen():
... for x in range(5):
... yield await asyncio.sleep(1, x)
... 
>>> [x async for x in async_gen()]
  File "", line 0
SyntaxError: asynchronous comprehension outside of an asynchronous function


Example with `await`:
>>> [await asyncio.sleep(1, x) for x in range(5)]
  File "", line 0
SyntaxError: asynchronous comprehension outside of an asynchronous function

--
components: asyncio
messages: 361443
nosy: asvetlov, jack1142, yselivanov
priority: normal
severity: normal
status: open
title: Asynchronous comprehensions don't work in asyncio REPL
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



[issue39563] asyncio.Protocol on windows 10 x64

2020-02-05 Thread Hector E. Socarras


New submission from Hector E. Socarras :

I test de sample Echo Tcp Server on 
https://docs.python.org/3.8/library/asyncio-protocol.html. When I run de server 
i got the following error from python interpreter
Traceback (most recent call last):
  File "server_test.py", line 1, in 
import asyncio
  File 
"C:\Users\Hector\AppData\Local\Programs\Python\Python37\lib\asyncio\__init__.py",
 line 8, in 
from .base_events import *
  File 
"C:\Users\Hector\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py",
 line 23, in 
import socket
  File "C:\Users\Hector\pynode\net\socket.py", line 7, in 
class NetBaseProtocol(asyncio.Protocol, EventEmitter):
AttributeError: module 'asyncio' has no attribute 'Protocol'

the problem was that i have a module named socket in the same folder. But I 
think that base_events.py should import the apropiate socket module using 
relative import or supplying full path for his socket import.

--
components: asyncio
messages: 361444
nosy: asvetlov, hsocarras, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.Protocol on windows 10 x64
type: compile error
versions: Python 3.7

___
Python tracker 

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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-02-05 Thread jack1142


jack1142  added the comment:

I also noticed that putting `await` before the async comprehension will make 
the code inside the comprehension run (though after it runs, it will fail on 
awaiting list):

>>> await [await asyncio.sleep(1, print(x)) for x in range(5)] 
0
1
2
3
4
Traceback (most recent call last):
  File "C:\Python38\lib\concurrent\futures\_base.py", line 439, in result
return self.__get_result()
  File "C:\Python38\lib\concurrent\futures\_base.py", line 388, in __get_result
raise self._exception
  File "", line 1, in 
TypeError: object list can't be used in 'await' expression

--

___
Python tracker 

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



[issue39563] asyncio.Protocol on windows 10 x64

2020-02-05 Thread Hector E. Socarras


Change by Hector E. Socarras :


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



[issue10572] Move test sub-packages to Lib/test

2020-02-05 Thread Brett Cannon


Brett Cannon  added the comment:

distutils might get pulled out at some point to it's at the bottom of the 
priority list for now.

Basically move the tests for a package to under Lib/test under the proper 
subpackage name and make sure the tests didn't break due to the move. That's 
pretty much the extent of this work.

--

___
Python tracker 

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Shantanu


Change by Shantanu :


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

___
Python tracker 

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



[issue28009] Fix uuid.uuid1() core logic of uuid.getnode() needs refresh

2020-02-05 Thread Shantanu


Change by Shantanu :


--
pull_requests: +17744
pull_request: https://github.com/python/cpython/pull/18369

___
Python tracker 

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Tal Einat


Tal Einat  added the comment:

Simply removing the argument would be backwards-incompatible.

Unless someone can show via a code search that this is never used in practice, 
we may want to consider deprecating this argument before removing it.

--
nosy: +taleinat
versions: +Python 3.9 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue38823] Improve stdlib module initialization error handling.

2020-02-05 Thread hai shi


Change by hai shi :


--
pull_requests: +17745
pull_request: https://github.com/python/cpython/pull/18365

___
Python tracker 

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Shantanu


Shantanu  added the comment:

Github code search isn't great, but I was unable to find any usage of 
`uuid.getnode(getters=`, whereas I was able to find usage of `uuid.uuid1(node=` 
(even though `node` is optional and can be passed positionally). I'd be 
surprised if it was used in practice, given that it's undocumented and only 
present on 3.7+ (I discovered it while running `inspect.signature` on large 
parts of stdlib). I think that, and the fact that this never did anything (even 
before bpo-28009 it looks like `getters` gets immediately overwritten), 
mitigate the risk here.

Let me know what you think should be done; happy to submit a PR that issues a 
deprecation warning.

--
nosy: +hauntsaninja

___
Python tracker 

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

Code using this argument is in all likelihood already subtly broken, because it 
depends on non-existing functionality. I believe that a "hard" break would be 
better (for Python 3.9).

--

___
Python tracker 

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



[issue39026] pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2020-02-05 Thread Matej Cepl


Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue39558] Implement __len__() for itertools.combinations

2020-02-05 Thread Mark Dickinson


Change by Mark Dickinson :


--
superseder:  -> Add __len__ to map, everything in itertools

___
Python tracker 

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



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2020-02-05 Thread Dan Arad


Dan Arad  added the comment:

Hi everyone!

I thought to take this issue up by updating the documentation. Is this still 
relevant?

If so I think the best place to add the documentation is in the "name or flags" 
section, where people will go looking first. I think to add both the metavar 
and the vars solutions discussed below.

--
nosy: +Dan Arad

___
Python tracker 

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



[issue39556] Different objects of the same class references the same dictionary

2020-02-05 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Ammar: it is definitely a feature that default values are created only once, 
when the function is created, not over and over again every time the function 
is called. (These are sometimes called "early binding" and "late binding" 
respectively.)

With early binding, you know what the default value is: it is the object at the 
time the function was created.

(But note that *mutable* objects may be mutated from one call to the next: they 
are not "reset" to their initial value each time. This is occasionally useful, 
to implement static storage across function calls, but also often a Gotcha that 
trips people up.)

With late binding, a default value like this:

def function(value=a+b+c):

could change from one call to the next, if the values a, b or c change.

Both early and late binding have advantages and disadvantages, but if a 
language only has one, it is better to have early binding (as Python has) and 
let the coder do the late binding inside the function:

def function(value=None):
if value is None:
value = a+b+c

--
nosy: +steven.daprano

___
Python tracker 

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8b6f6526f857bb7523b0fcff09b45bc6471289e9 by Shantanu in branch 
'master':
bpo-39559: Remove unused, undocumented argument from uuid.getnode (GH-18369)
https://github.com/python/cpython/commit/8b6f6526f857bb7523b0fcff09b45bc6471289e9


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39559] uuid.getnode() has unused argument

2020-02-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I agree. It was added in issue32502, but was never documented and used.

Thank you Sebastian and Shantanu.

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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-02-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue18213] py-bt errors on backtrace with PyRun_SimpleString and friends

2020-02-05 Thread Enji Cooper


Enji Cooper  added the comment:

This particular issue has been resolved in python 3.x.

--
nosy: +ngie

___
Python tracker 

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



[issue39127] _Py_HashPointer's void * argument should be const

2020-02-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3d06953c34fd6421dd1dfdb615578cde676ee0eb by Andy Lester in branch 
'master':
bpo-39127: Make _Py_HashPointer's argument be const (GH-17690)
https://github.com/python/cpython/commit/3d06953c34fd6421dd1dfdb615578cde676ee0eb


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
title: Parsed expression has wrong line/col info when concatenating f-strings 
-> Parsed expression has wrong col_offset when concatenating f-strings

___
Python tracker 

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



[issue39564] Parsed expression has wrong line/col info when concatenating f-strings

2020-02-05 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

When concatenating f-strings, if there is an expression in any STRING node 
other than the first, col_offset of the parsed expression has a wrong value.

For example, parsing f"hello" f"{world}" outputs the following AST:

Module(
body=[
Expr(
value=JoinedStr(
values=[
Constant(
value="hello",
kind=None,
lineno=1,
col_offset=0,
end_lineno=1,
end_col_offset=19,
),
FormattedValue(
value=Name(
id="world",
ctx=Load(),
lineno=1,
*col_offset=1,*
end_lineno=1,
*end_col_offset=6,*
),
conversion=-1,
format_spec=None,
lineno=1,
col_offset=0,
end_lineno=1,
end_col_offset=19,
),
],
lineno=1,
col_offset=0,
end_lineno=1,
end_col_offset=19,
),
lineno=1,
col_offset=0,
end_lineno=1,
end_col_offset=19,
)
],
type_ignores=[],
)

Here, col_offset and end_col_offset are wrong in the parsed NAME 'world'.

--
components: Interpreter Core
messages: 361456
nosy: gvanrossum, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Parsed expression has wrong line/col info when concatenating f-strings
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



[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

There are a number of bugs about this. See issue 35212 and issue 34364, at 
least.

I have a stale patch that tried to fix this, but I was never able to get it 
completely correct.

I have another approach that I hope to discuss at the language summit at PyCon. 
Hopefully progress after that will be quick.

I'm going to close this as a duplicate. When I decide on a course of action, 
I'll either use issue 34364 or create a new issue.

--
nosy: +eric.smith
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> problem with traceback for syntax error in f-string
type:  -> behavior

___
Python tracker 

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



[issue39565] Modules/signalmodule.c only works with `NSIG` signals; requires fudging to support realtime signals, etc

2020-02-05 Thread Enji Cooper


New submission from Enji Cooper :

The code in Modules/signalmodule.c makes a number of assumptions of what 
signals are considered valid, as well as what handlers need to be setup as part 
of the core interpreter.

For example: much of the initialization of signal handlers, etc, is actually 
keyed off of NSIG, as defined (and guessed on) here: 
https://github.com/python/cpython/blob/master/Modules/signalmodule.c#L50 . The 
problem with this is that it makes it impossible for end-users to use 
`signal.signal`, et al with signal numbers outside of `NSIG`, which includes 
realtime signals.

Furthermore, if one is to extend the size of `NSIG`, it results in an increased 
O(n) iteration over all of the signals if/when a handler needs to be handled 
(set or cleared).

Proposal:
The best way to handle this, in my opinion, is to use a dict-like container to 
iterate over all of the handlers and rely on the OS to trickle up errors in the 
signal(3) libcall, as opposed to thinking that the definitions/assumptions in 
signalmodule.c are absolutely correct.

This may or may not be possible, however, depending on code needing to be 
reentrant, but it would be nice to leverage a middle ground solution of some 
kind *shrug*.

--
components: Interpreter Core
messages: 361458
nosy: ngie
priority: normal
severity: normal
status: open
title: Modules/signalmodule.c only works with `NSIG` signals; requires fudging 
to support realtime signals, etc
versions: Python 3.8

___
Python tracker 

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



[issue28859] os.path.ismount sometimes raises FileNotFoundError on Windows

2020-02-05 Thread Dan Arad


Change by Dan Arad :


--
nosy: +Dan Arad

___
Python tracker 

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



[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Note that this is somewhat urgent for oefen, since we strive to match the
produced AST exactly.
-- 
--Guido (mobile)

--

___
Python tracker 

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



[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-02-05 Thread Steve Dower


Steve Dower  added the comment:

issue39555 and PR 18357 have the fix for the buildbot.

--

___
Python tracker 

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



[issue39566] inspect.Signature.__init__ asks for parameters as dict but treats as list

2020-02-05 Thread Nicholas Matthews


New submission from Nicholas Matthews :

The class inspect.Signature asks for parameters of type dict in python 3.8+ 
(and OrderedDict in earlier versions); however the __init__ function iterates 
over parameters as if it were a list, specifically:

for param in parameters:
name = param.name
kind = param.kind
...

Either the docstring should be changed to specify Sequence / List, or the 
implementation should be changed to iterate over the values of parameters:

for param in parameters.values():
...

(https://github.com/python/cpython/blob/2cca8efe46935c39c445f585bce54954fad2485b/Lib/inspect.py#L2734)

--
messages: 361461
nosy: Nicholas Matthews
priority: normal
severity: normal
status: open
title: inspect.Signature.__init__ asks for parameters as dict but treats as list
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

This is indeed a duplicate of issue35212 (the second message there also shows a 
problem with implicit f-string concatenation). There's not much information in 
issue34364 (just a merged PR, and a mention of a PR of yours from 2 years ago 
that apparently never materialized).

FWIW I meant "pegen" (https://github.com/gvanrossum/pegen/) -- not sure why my 
mobile spell corrector turned that into "oefen" (maybe it's becoming 
multilingual :-).

And the reason I think called this "urgent" is that until this is fixed in 
CPython 3.8 we have to disable the part of our tests that compares the AST 
generated by pegen to the one generated by ast.parse. (We've found several 
other issues with incorrect column offsets in ast.parse this way, and always 
managed to fix them upstream. :-)

If we came up with a hacky fix, would you oppose incorporating it?

I'm guessing your alternate approach is modifying the tokenizer to treat 
f"x{y}z{a}b" as several tokens:

- f"x{
- y (or multiple tokens if there's a complex expression here)
- }z{
- a (same)
- }b"

(This has been proposed before by a few others, and IIRC we did it this way in 
ABC, in the early '80s.)

--

___
Python tracker 

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



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2020-02-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I think this one should have been closed long ago.

--
nosy: +rhettinger
resolution:  -> out of date
stage: needs patch -> 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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2020-02-05 Thread Stefano Rivera


Stefano Rivera  added the comment:

A bisect points at https://github.com/python/cpython/pull/11488 being the 
change that introduced this hang (bpo-35493)

--
nosy: +stefanor

___
Python tracker 

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



[issue35493] multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit

2020-02-05 Thread Stefano Rivera


Stefano Rivera  added the comment:

This change seems to be causing a deadlock in multiprocessing shut-down: 
bpo-38501

--
nosy: +stefanor

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-02-05 Thread hai shi

hai shi  added the comment:

> 1) python-ast.c have one question, i fix it in PR18365.
> 2) most of the questions in extension module, for example: 
> https://github.com/python/cpython/blob/master/Modules/gcmodule.c#L2019-L2022

brandt does relevant work already in PR17276、PR38823.

--

___
Python tracker 

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



[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

Yes, my approach is to use the tokenizer to produce the parts of the f-string, 
instead of treating it as a normal string and making a second pass to parse out 
the pieces. I've been discussing this for a few years, and at last PyCon I 
talked to many tool vendors (editors, type checkers, etc.) to gather opinions, 
and no one was opposed. I've also had a few discussions since then, which were 
also positive. So I think I'll try to move ahead on it.

I'm not sure this is the best place to discuss it, but let me give a little 
example on why it's complicated.

Consider: f"x{y:.2f}z{a!s:10}b"

What type of token is ".2f", and how does the tokenizer recognize it? Or maybe 
the token is ":.2f". It can be an arbitrary sequence of characters (with a few 
restrictions, like no newlines), ending before a right brace. And there's the 
issue of backslash escapes there.

And the f"{z = :20}" thing we added doesn't make this any easier, since 
whitespace is significant after the "=" and before the ":", if it exists. And I 
need the entire text of the expression, before it's parsed, to make it work. I 
don't think that "unparsing" could ever be made to work in this case, or at 
least not so as to be compatible with 3.8 and preserving whitespace.

I really haven't looked at what's involved in the implementation in any greater 
depth: my first goal was (and will be) to get buy-off on the change, then to 
look at implementation issues. PEP 536 has some discussion of this, but if I go 
forward I would want to start from scratch (and reject PEP 536).

As far as the patch I was working on: the general problem is that you have to 
"prime" the compiler with a line number and column to start on, instead of it 
assuming line 1 column 1. Despite spending the better part of a week on it at 
the core sprints 1.5 years ago, I never got it to work (although I did delete 
and simplify a few functions, so it was a net win anyway). I wouldn't be 
opposed to a patch to fix this.

--

___
Python tracker 

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



[issue37749] ipaddress - is_global method all multicast addresses and networks return true

2020-02-05 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +pmoody
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



[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Wow. Do you still have a branch with that non-working patch? Maybe there are 
some ideas that can be salvaged.

I'm wondering if maybe we're better leaving f-strings alone? The current code 
is quite voluminous, but it looks as if by the time you've addressed everything 
you mention using additional tokenizer state, you might end up with just as 
much or more convoluted code... F-strings totally rule, despite the current 
limitations!

--

___
Python tracker 

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



[issue39384] Email parser creates a message object that can't be flattened as bytes.

2020-02-05 Thread Mark Sapiro


Mark Sapiro  added the comment:

I've researched this further, and I know how this happens. The original message 
contains a text/html part (in my case, the only part) which contains a base64 
or quoted-printable body which when decoded contains non-ascii. It is parsed 
correctly by email.message_from_bytes.

It is then processed by Mailman's content filtering which retrieves html 
payload via

part.get_payload(decode=True).decode(ctype, errors='replace'))

where part is the text/html part and ctype is 'utf-8' in this case. It then 
uses elinks, lynx or some other configured command to convert the html payload 
to plain text and that plain text still contains non-ascii.

It then replaces the payload and sets the content type via

del part['content-transfer-encoding']
part.set_payload(plain_text)
part.set_type('text/plain')

And this results in a message which can't be flattened as_bytes.

The issue is set_payload() should encode the payload appropriately and in fact, 
it does if an appropriate charset is given, so this is our error in not 
providing a charset= argument to set_payload.

Closing this and the corresponding PR.

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



[issue39555] test_distutils fails for Windows debug build

2020-02-05 Thread Steve Dower


Steve Dower  added the comment:


New changeset ab0d892288f3058856a821e8c3e4ed8a562b by Steve Dower in branch 
'master':
bpo-39555: Fix distutils test to handle _d suffix on Windows debug build 
(GH-18357)
https://github.com/python/cpython/commit/ab0d892288f3058856a821e8c3e4ed8a562b


--

___
Python tracker 

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



[issue39555] test_distutils fails for Windows debug build

2020-02-05 Thread Steve Dower


Change by Steve Dower :


--
assignee:  -> steve.dower
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



[issue38967] Improve error message in enum for member name surrounded by underscore.

2020-02-05 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue33351] Support compiling with clang-cl on Windows

2020-02-05 Thread Isuru Fernando


Change by Isuru Fernando :


--
pull_requests: +17747
pull_request: https://github.com/python/cpython/pull/18371

___
Python tracker 

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



[issue36792] [Windows] time: crash on formatting time with de_DE locale

2020-02-05 Thread Eryk Sun


Eryk Sun  added the comment:

> Perhaps it would be easy to do the replacement of underscores with 
> hyphens on Windows in this function? I think that's safe enough, yes?

Recent releases of ucrt implement this translation from underscore to hyphen 
for us, so this suggestion is no longer always necessary. However, I don't know 
what the PEP-11 stance is regarding the modern lifecycle policy of Windows 10. 
Will Python support a release for as long as it's supported by the enterprise 
version? For example, support for 1709 enterprise ends on 2020-04-14, so if we 
followed that, then Python 3.9 would require Windows 10 1803 or higher. That 
seems wrong while we're still supporting Windows 8.1, but what will the stance 
be when Python supports only Windows versions that use the modern lifecycle?

--

___
Python tracker 

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