[issue1294959] Problems with /usr/lib64 builds.

2020-02-11 Thread Carlos Velasco


Change by Carlos Velasco :


--
nosy: +carlos.velasco

___
Python tracker 

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



[issue39599] ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure

2020-02-11 Thread Inada Naoki


Inada Naoki  added the comment:

https://github.com/python/cpython/blob/95905ce0f41fd42eb1ef60ddb83f057401c3d52f/Include/cpython/objimpl.h#L89

_Py_AS_GC and all APIs to get PyGC_Head from PyObject* are not only unstable, 
but also private.

I thought PyGC_Head must not be used directly from extensions, so we changed 
its layout.

Since Julien said "my code does not access PyGC_Head at all", I still think it 
was not real ABI breakage.

I suppose other serious bug (e.g. dungling pointer, missing refcount increment, 
etc) caused the segfault.

--

___
Python tracker 

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



[issue39474] col_offset for parenthesized expressions looks weird

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



[issue39599] ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure

2020-02-11 Thread Mark Dickinson


Mark Dickinson  added the comment:

[Julien Danjou]

> As you said, if it's not part of the stable ABI it makes sense.

I think this is a misunderstanding of what the stable ABI is for. I'm not sure 
whether this is spelled out explicitly anywhere, but my understanding was that 
ABI breakage shouldn't happen *at all* in bugfix releases, whether stable ABI 
or not.

The stable ABI is about feature releases within the Python 3.x series, not 
bugfix releases: that is, if your extension module limits itself to using the 
stable ABI, then a version of that module compiled for Python 3.7.x should 
still work for Python 3.8.x.

But lots of extension modules don't or can't restrict themselves to the stable 
ABI. For those modules, it should still be reasonable to expect that bugfix 
releases don't break the ABI: you should always be able to upgrade from Python 
3.7.5 to Python 3.7.6 (for example) without having to recompile your extension 
modules.

Or am I misunderstanding?

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-02-11 Thread Amir Mohamadi


Amir Mohamadi  added the comment:

@vstinner sorry to bother you, I have a quick question.

the request(...) method is like this:

def request(self, method, url, body=None, headers={}, *,  
encode_chunked=False):
"""Send a complete request to the server."""  
self._send_request(method, url, body, headers, encode_chunked)

'request' calls '_send_request' method and '_send_request' calls 'putrequest' 
inside itself.

So is it good if I encode 'method' parameter to ASCII inside 'putrequest'??!

--

___
Python tracker 

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



[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2020-02-11 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +zach.ware

___
Python tracker 

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



[issue39605] Fix some casts to not cast away const

2020-02-11 Thread miss-islington


miss-islington  added the comment:


New changeset 0b8f738eb3ee0110461e7da28c0b6b452f91999d by Miss Islington (bot) 
in branch '3.8':
bpo-39605: Remove a cast that causes a warning. (GH-18473)
https://github.com/python/cpython/commit/0b8f738eb3ee0110461e7da28c0b6b452f91999d


--

___
Python tracker 

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



[issue39605] Fix some casts to not cast away const

2020-02-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17842
pull_request: https://github.com/python/cpython/pull/18474

___
Python tracker 

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



[issue39605] Fix some casts to not cast away const

2020-02-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 95905ce0f41fd42eb1ef60ddb83f057401c3d52f by Benjamin Peterson in 
branch 'master':
bpo-39605: Remove a cast that causes a warning. (GH-18473)
https://github.com/python/cpython/commit/95905ce0f41fd42eb1ef60ddb83f057401c3d52f


--

___
Python tracker 

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



[issue39595] Improve performance of importlib.metadata and zipfile.Path

2020-02-11 Thread Jason R. Coombs


Change by Jason R. Coombs :


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



[issue39595] Improve performance of importlib.metadata and zipfile.Path

2020-02-11 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset ed4d263e8767b0e4c47df99141b500d36ce0275d by Miss Islington (bot) 
in branch '3.8':
bpo-39595: Improve zipfile.Path performance (GH-18406) (GH-18472)
https://github.com/python/cpython/commit/ed4d263e8767b0e4c47df99141b500d36ce0275d


--

___
Python tracker 

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



[issue39605] Fix some casts to not cast away const

2020-02-11 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
pull_requests: +17841
pull_request: https://github.com/python/cpython/pull/18473

___
Python tracker 

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



[issue39595] Improve performance of importlib.metadata and zipfile.Path

2020-02-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17840
pull_request: https://github.com/python/cpython/pull/18472

___
Python tracker 

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



[issue39595] Improve performance of importlib.metadata and zipfile.Path

2020-02-11 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset e5bd73632e77dc5ab0cab77e48e94ca5e354be8a by Jason R. Coombs in 
branch 'master':
bpo-39595: Improve zipfile.Path performance (#18406)
https://github.com/python/cpython/commit/e5bd73632e77dc5ab0cab77e48e94ca5e354be8a


--

___
Python tracker 

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



[issue39605] Fix some casts to not cast away const

2020-02-11 Thread miss-islington


miss-islington  added the comment:


New changeset 190433d8150bf719fa0ba972dbacf2214942f54e by Miss Islington (bot) 
in branch '3.8':
closes bpo-39605: Fix some casts to not cast away const. (GH-18453)
https://github.com/python/cpython/commit/190433d8150bf719fa0ba972dbacf2214942f54e


--
nosy: +miss-islington

___
Python tracker 

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



[issue39605] Fix some casts to not cast away const

2020-02-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17839
pull_request: https://github.com/python/cpython/pull/18471

___
Python tracker 

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



[issue39605] Fix some casts to not cast away const

2020-02-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset e6be9b59a911626d6597fe148c32f0342bd2bd24 by Andy Lester in branch 
'master':
closes bpo-39605: Fix some casts to not cast away const. (GH-18453)
https://github.com/python/cpython/commit/e6be9b59a911626d6597fe148c32f0342bd2bd24


--
nosy: +benjamin.peterson
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



[issue15976] Inconsistent behavior of search_for_exec_prefix() results in startup failure in certain cases

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

This issue was reported on Python 2.7 eight years ago. getpath.c has been 
deeply reworked, especially by the PEP 587 (PyConfig) implementation. I 
consider that the issue is now fixed. If it's not the case, feel free to reopen 
it.

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



[issue38180] Test pyexpat fails on Fedora 30

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

I'm unable to reproduce the issue on Fedora 31. We now have multiple Fedora 
buildbots (Stable and Rawhide flavors): test_pyexpat pass on all of them.

Maybe you didn't use "./configure --with-system-expat".

Reopen the issue if you can still reproduce it.

--
nosy: +vstinner
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue19482] _pickle build warnings on Fedora 19

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

I don't get these warnings on Fedora anymore. I close the issue.

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



[issue32897] test_gdb failed on Fedora 27

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

test_gdb got multiple bugfixes since 2018. Please test Python 3.8.1 on Fedora 
31. Your issue should be fixed.

--
nosy: +vstinner
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-21016: "trace: $prefix and $exec_prefix improperly replaced on 
Fedora".

--

___
Python tracker 

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



[issue18092] Python 2.7.5 installation broken on OpenSuse 12.2

2020-02-11 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Problems with /usr/lib64 builds.

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-18092 ("Python 2.7.5 installation broken on OpenSuse 12.2") as a 
duplicate of this issue.

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-14791: "setup.py only adds /prefix/lib, not /prefix/lib64".

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2020-02-11 Thread STINNER Victor

STINNER Victor  added the comment:

I marked bpo-34032 as a duplicate of this issue. It has an open PR written by 
Matěj Cepl (OpenSUSE): PR 8068. It looks similar to PR 3698.

--

___
Python tracker 

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



[issue16529] Compiler error when trying to compile ceval.c on OpenSUSE 11.3

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

That's a GCC bug which has likely been fixed since 2014.

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



[issue34032] Add platlibdir to allow distinction between /usr/lib and /usr/lib64 for Linux

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

I mark this issue as a duplicate of bpo-1294959.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Problems with /usr/lib64 builds.

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-34058 "Default Python 3.7 install broken on openSUSE Leap 42.3: 
$PYTHONHOME/lib64/python3.7/lib-dynload/ not linked to 
$PYTHONHOME/lib/python3.7/lib-dynload/": OpenSUSE and Centos are mentioned as 
being impacted.

--

___
Python tracker 

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



[issue39011] ElementTree attributes replace "\r" with "\n"

2020-02-11 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +17838
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18468

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-15631 as a duplicate of this issue.

--

___
Python tracker 

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



[issue39474] col_offset for parenthesized expressions looks weird

2020-02-11 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Are you going to work on a patch then, Batuhan?

--

___
Python tracker 

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



[issue15631] Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

I mark this issue as a duplicate of bpo-1294959.

--
nosy: +vstinner
resolution: out of date -> duplicate
superseder:  -> Problems with /usr/lib64 builds.

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

I closed bpo-858809 as a duplicate of this issue.

--

___
Python tracker 

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



[issue858809] Use directories from configure rather than hardcoded

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

Start of this issue:

"Current Makefile.pre.in contains paths like $(exec_prefix)/lib, which bad 
especially for mixed 32-bit and 64-bit systems, where 64-bit things should go 
to /lib64."

That's a duplicate of bpo-1294959. This issue discuss also modifying distutils 
but there is no clear plan on how it should behave or not. My PR 18381 of 
bpo-1294959 updates sysconfig and distutils to support $prefix/$python_libdir/ 
path.

--
nosy: +vstinner
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Problems with /usr/lib64 builds.

___
Python tracker 

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



[issue39474] col_offset for parenthesized expressions looks weird

2020-02-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

This is also a 3.8 issue. We discovered this with pegen, and would love to see 
it fixed.

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



[issue39474] col_offset for parenthesized expressions looks weird

2020-02-11 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue39483] Proposial add loop parametr to run in asyncio

2020-02-11 Thread Yury Selivanov

Yury Selivanov  added the comment:

Андрей,

Here's how you can fix your example:


import asyncio


class Singleton:
_LOCK = None
_LOOP = None

@classmethod
async def create(cls):
if cls._LOOP is None:
cls._LOOP = asyncio.get_running_loop()
cls._LOCK = asyncio.Lock()
loop = cls._LOOP
if loop is not asyncio.get_running_loop():
raise RuntimeError()

if not hasattr(cls, '_Singleton__instance'):
async with cls._LOCK:
if not hasattr(cls, '_Singleton__instance'):
await asyncio.sleep(1)
cls.__instance = cls()
return cls.__instance

--

___
Python tracker 

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



[issue39610] memoryview.__len__ should raise an exception for 0d buffers

2020-02-11 Thread Stefan Krah


Stefan Krah  added the comment:

The change looks reasonable, but unfortunately this is a long-standing
behavior that originates from before the Python-3.3 memoryview rewrite.

It is also present in 2.7 (the previous implementation) and documented
in 3.3:

https://docs.python.org/3/library/stdtypes.html#memoryview


I think I documented it because it looked strange back then, too.
So I've to think a bit what will be affected and how this behavior
came into place.

--

___
Python tracker 

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



[issue37088] Add a way to schedule a function to be called from the main thread

2020-02-11 Thread Yury Selivanov


Yury Selivanov  added the comment:

> I'm not strongly against the feature. I first proposed to expose it, but make 
> it private. Almost one year later, the PR was not updated. So I just closed 
> the PR and the issue.

All clear, Victor. Let's keep this closed. The reason I didn't reply is because 
we are no longer need it and this is a very low-level piece of functionality 
that I myself feel uneasy about. It can have potential problems to implement in 
PyPy/other interpreters in a compatible with CPython fashion.

I'll reopen if there's a need for this in asyncio. But even then, we can make 
this a "private" and undocumented function in the sys module (of course that 
would mean that we only use it to issue warnings / add extra debug 
functionality).

--

___
Python tracker 

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



[issue37088] Add a way to schedule a function to be called from the main thread

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

> NP, here, but, hm, can you unilaterally reject features now? :)

Eric Snow and me are basically against the idea of exposing the "pending calls" 
mechanism in Python, since it's fragile and dangerous. Andrew Sveltov wrote 
"@vstinner had objections, perhaps this PR should be rejected." So I don't 
think that it's an unilaterally decision :)

There are multiple unanswered questions which have been asked here. For 
example, the ratione to add this feature seems to be based on a wrong 
assumption (signal handling using the pending call mechanism).

I'm not strongly against the feature. I first proposed to expose it, but make 
it private. Almost one year later, the PR was not updated. So I just closed the 
PR and the issue.

The problem is not only asynico, it's how this feature can be abused in 
general, and users who may have wrong expectations on how it works.


> Yeah, with the new threaded watcher being the default we don't need this 
> anymore.

Handling subprocesses in asyncio also seem to be a can of worms. bpo-38323 is a 
good example :-(

--

___
Python tracker 

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



[issue39614] Documentation of attribute reference is unclear

2020-02-11 Thread Dirk Herrmann


New submission from Dirk Herrmann :

Trying to understand attribute reference in Python, I was lost:

* In the "Python Language Reference" (I will refer to this as PLR, sorry if 
that is uncommon, did not find an abbreviation in the glossary): Chapter 6.3.1 
is about attribute reference.  How the attribute reference actually works is 
not explained in detail, only with the sentence "This object is then asked to 
produce the attribute whose name is the identifier." which I find vague.  
Moreover, in PLR 6.3.1 it is said that it can be customized overriding 
"__getattr__()", but again, details are unclear.  And, when following the link 
to "__getattr__()" it turns out that "__getattr__()" is not called for 
attribute access, but only in certain circumstances:

* PLR 3.3.1 section "object.__getattr__(self, name)" explains that this is only 
called when "default attribute access" fails.  There is nowhere an explanation 
of "default attribute access", it is also not mentioned in the index.  There is 
some explanation in parentheses what it means if "default attribute access" 
fails, but the actual procedure of the "default attribute access" is still not 
clear.  A bit further down in this section it is also mentioned that if an 
attribute is found using the "normal mechanism" then "__getattr__()" is not 
called - again not explaining what the "normal mechanism" is.  There is some 
reference to "__getattribute__()" here, saying that with "__getattribute__()" 
there would be "total control over attribute access", but this leads again to 
confusion:

* PLR 3.3.1 section "object.__getattribute__(self, name)" indicates that this 
"may still be bypassed" in certain circumstances, referring to PLR 3.3.10, 
special method lookup, which refers to the "conventional lookup process", to 
which this is an exception.  The basis why this is an exception remains unclear 
- is it that certain method names are detected during attribute reference?

Summary: There is not (or I was too stupid to find) a concise description of 
how attribute reference works.  There are several terms used to refer to 
certain aspects of it: "default attribute access", "normal mechanism [of 
attribute access]", "conventional lookup process", which may or may not refer 
to the same thing, which seems not to be documented anyway.

--
assignee: docs@python
components: Documentation
messages: 361837
nosy: Dirk Herrmann, docs@python
priority: normal
severity: normal
status: open
title: Documentation of attribute reference is unclear
type: enhancement
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



[issue37088] Add a way to schedule a function to be called from the main thread

2020-02-11 Thread Yury Selivanov


Yury Selivanov  added the comment:

> There is not clear rationale to justify the addition of the function

Yeah, with the new threaded watcher being the default we don't need this 
anymore.


> so I reject the feature

NP, here, but, hm, can you unilaterally reject features now? :)

--

___
Python tracker 

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



[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-11 Thread JitterMan


JitterMan  added the comment:

Okay, I get it. Someone might be using two braces in the format specifier 
because they found that it is a way to both evaluate a sub-expression and get 
braces in the formatted result. I was thinking that they would just use three 
braces, but that does not appear to work, though I cannot understand the 
resulting error message.

>>> x = 42
>>> import datetime
>>> now = datetime.datetime.now()

>>> f'{now:x{x}x}'
'x42x'

>>> f'{now:x{{x}}x}'
'x{42}x'

>>> f'{now:x{{{x}}}x}'
Traceback (most recent call last):
...
TypeError: unhashable type: 'set'

I think you are right. This particular ship may have already sailed away.

--

___
Python tracker 

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



[issue39612] Python UnicodeDecodeError while using modulefinder

2020-02-11 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-11 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

But you can't just change it without breaking the code of anyone who's relying 
on the current behavior. If we could say "no one relies on that", that's would 
let us move forward with such a breaking change. But I don't think we can make 
that determination. And we're generally conservative with such breaking changes.

I think the current behavior doesn't make much sense, although I haven't 
completely analyzed the issue.

--

___
Python tracker 

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



[issue39521] reversed(mylist) much slower on Python 3.8 32-bit for Windows

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Just FYI, there is no PGO run on the official 32-bit builds. I only run it on 
> the 64-bit build.

Aaaah :-) That's good to know ;-) It can explain the performance difference.

--

___
Python tracker 

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



[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-11 Thread JitterMan

JitterMan  added the comment:

I believe it is worth fixing as it clears up some rather glaring 
inconsistencies␣
and enables a useful capability. Specifically,

1. Formatted string literals and the string format method are currently 
   inconsistent in the way that they handle double braces in the format 
   specifier.

>>> x = 42
>>> import datetime
>>> now = datetime.datetime.now()

>>> f'{now:x{{x}}x}'
'x{42}x'

>>> '{:x{{x}}x}'.format(now)
'x{x}x'

2. Formatted string literals currently seem inconsistent in the way they handle 
   handle doubled braces.

   In the base string doubling the braces escapes them.

>>> f'x{{x}}x'
'x{x}x'

   In the replacement expression doubling the braces escapes them.
>>> f'{f"x{{x}}x"}'
'x{x}x'

   In the format specifier doubling the braces does not escape them.
>>> f'{now:x{{x}}x}'
'x{42}x'

3. Currently there is no way I know of escape the braces in the format 
   specifier.

4. Allowing the braces to be escaped in the format specifier allows the user to 
   defer the interpretation of the of a format specifier so that it is 
evaluated 
   by a format function inside the object rather than being evaluated in the 
   current context.  That seems like a generally useful feature.

--

___
Python tracker 

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



[issue39613] IsolatedAsyncioTestCase closes default event loop

2020-02-11 Thread Artur Rodrigues


New submission from Artur Rodrigues :

This means that subsequent test cases executed within the same application that 
don't create the event loop will fail. This seems like a behaviour change that 
wasn't raised on the original PR.

$ cat test.py
from unittest import IsolatedAsyncioTestCase, TestCase, main
import asyncio

class Test1(IsolatedAsyncioTestCase):
async def test_one(self):
self.assertTrue(True)

class Test2(TestCase):
def test_two(self):
loop = asyncio.get_event_loop()
self.assertTrue(true)

if __name__ == "__main__":
main()
$ /usr/local/opt/python@3.8/bin/python3 test.py
.E
==
ERROR: test_two (__main__.Test2)
--
Traceback (most recent call last):
  File "test.py", line 13, in test_two
loop = asyncio.get_event_loop()
  File 
"/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/events.py",
 line 639, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'MainThread'.

--
Ran 2 tests in 0.006s

FAILED (errors=1)
$ uname -a
Darwin arturhoo-mbp 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec  1 18:59:03 
PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64

--
components: asyncio
messages: 361831
nosy: arturhoo, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: IsolatedAsyncioTestCase closes default event loop
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



[issue38324] [Windows] test_locale and test__locale failures on Windows

2020-02-11 Thread Eryk Sun


Eryk Sun  added the comment:

It is not a duplicate of bpo-37945. The tests in test/test__locale.py need to 
be fixed to work with Windows. 

In msg354021, I discussed the problem reported with test_lc_numeric_localeconv. 
The "ps_AF" (Pashto, Afghanistan) item in known_numerics has to be skipped in 
Windows because the system data does not agree with the test's assumed Arabic 
decimal and thousands separator, U+066B and U+066C, but instead uses "," and 
".".
  
Also, all tests need to swap the order of setting LC_NUMERIC and LC_CTYPE in 
order to avoid a UnicodeDecodeError with locales that use UTF-8, such as 
"ka_GE". _locale.localeconv should be using the wide-character_W_ prefixed 
string fields from the lconv structure in Windows [1], such as 
_W_decimal_point. Until that gets fixed, tests need to be mindful that ucrt in 
Windows uses the current LC_CTYPE to update the multibyte strings in the lconv 
structure when setting LC_NUMERIC. So they should be changed as a pair, with 
LC_CTYPE set first.

[1]: 
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/localeconv?view=vs-2019

--
resolution: duplicate -> 
stage: resolved -> needs patch
status: closed -> open
superseder: [Windows] locale.getdefaultlocale() issues on Windows: 
test_locale.test_getsetlocale_issue1813() -> 
type:  -> behavior

___
Python tracker 

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



[issue39612] Python UnicodeDecodeError while using modulefinder

2020-02-11 Thread ArtOfCode Studio

New submission from ArtOfCode Studio :

I want to find all imported modules in a python program. I am using the 
``modulefinder`` standard module for my job. I am trying to follow [this 
example](https://docs.python.org/3.8/library/modulefinder.html#example-usage-of-modulefinder)
 on docs, but I get this error even if I use the same code as the documents:

python
Traceback (most recent call last):
  File "C:\Users\Dinçel\Desktop\Deploy\zipperutils\find modules.py", line 4, in 

finder.run_script('bacon.py')
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 165, in run_script
self.load_module('__main__', fp, pathname, stuff)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 360, in load_module
self.scan_code(co, m)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 433, in scan_code
self._safe_import_hook(name, m, fromlist, level=0)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 378, in _safe_import_hook
self.import_hook(name, caller, level=level)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 177, in import_hook
q, tail = self.find_head_package(parent, name)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 233, in find_head_package
q = self.import_module(head, qname, parent)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 326, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 360, in load_module
self.scan_code(co, m)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 433, in scan_code
self._safe_import_hook(name, m, fromlist, level=0)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 378, in _safe_import_hook
self.import_hook(name, caller, level=level)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 177, in import_hook
q, tail = self.find_head_package(parent, name)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 233, in find_head_package
q = self.import_module(head, qname, parent)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 326, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 360, in load_module
self.scan_code(co, m)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 433, in scan_code
self._safe_import_hook(name, m, fromlist, level=0)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 378, in _safe_import_hook
self.import_hook(name, caller, level=level)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 177, in import_hook
q, tail = self.find_head_package(parent, name)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 233, in find_head_package
q = self.import_module(head, qname, parent)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 326, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 360, in load_module
self.scan_code(co, m)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 466, in scan_code
self.scan_code(c, m)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 433, in scan_code
self._safe_import_hook(name, m, fromlist, level=0)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 378, in _safe_import_hook
self.import_hook(name, caller, level=level)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 177, in import_hook
q, tail = self.find_head_package(parent, name)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 233, in find_head_package
q = self.import_module(head, qname, parent)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 326, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\modulefinder.py", 
line 343, in load_module
co = compile(fp.read()+'\n', pathname, 'exec')
  File 
"C:\Users\Dinçel\AppData\Local\Programs\Python\Python38\lib\encodings\cp1254.py",
 line 23, in decode
return 

[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-02-11 Thread Amir Mohamadi


Amir Mohamadi  added the comment:

can I work on it?!

--
nosy: +Amir

___
Python tracker 

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



[issue39521] reversed(mylist) much slower on Python 3.8 32-bit for Windows

2020-02-11 Thread Steve Dower


Steve Dower  added the comment:

Just FYI, there is no PGO run on the official 32-bit builds. I only run it on 
the 64-bit build.

It might be worth investigating differences between the 3.7 and 3.8 
implementations of reversed().

--

___
Python tracker 

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



[issue39601] brace escapes are not working in formatted string literal format specifications

2020-02-11 Thread Chris Wilcox


Chris Wilcox  added the comment:

Thanks Eric. That is very handy.

I had made a test case earlier on a branch. Attached as a patch here if helpful.

I haven't tried to fix this yet, but would be interested if it is something 
that makes sense to address.

--
keywords: +patch
Added file: https://bugs.python.org/file48891/test_case.patch

___
Python tracker 

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



[issue39611] PyVectorcall_NARGS(): change return type to Py_ssize_t

2020-02-11 Thread STINNER Victor


New submission from STINNER Victor :

I propose to change PyVectorcall_NARGS() return type from unsigned size_t to 
signed Py_ssize_t.

Currently, the function is defined as:

static inline Py_ssize_t
PyVectorcall_NARGS(size_t n)
{
return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET;
}

But in CPython code base, the result is always stored in a *signed* Py_ssize_t:

Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);

Sometimes, this nargs is passed to _PyObject_MakeTpCall() which expects nargs 
to be Py_ssize_t, so it's consistent.

In general in CPython, a size uses type Py_ssize_t, not size_t. Example: 
PyVarObject.ob_size type is Py_ssize_t.

--
components: C API
messages: 361824
nosy: jdemeyer, petr.viktorin, vstinner
priority: normal
severity: normal
status: open
title: PyVectorcall_NARGS(): change return type to Py_ssize_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



[issue38644] Pass explicitly tstate to function calls

2020-02-11 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset f3fda374685dffa31ebda9e681e00ef7032b8a1d by Victor Stinner in 
branch 'master':
bpo-38644: Rephrase What's New entry (GH-18461)
https://github.com/python/cpython/commit/f3fda374685dffa31ebda9e681e00ef7032b8a1d


--
nosy: +petr.viktorin

___
Python tracker 

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



[issue39245] Public API for Vectorcall (PEP 590)

2020-02-11 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset ffd9753a944916ced659b2c77aebe66a6c9fbab5 by Petr Viktorin in 
branch 'master':
bpo-39245: Switch to public API for Vectorcall (GH-18460)
https://github.com/python/cpython/commit/ffd9753a944916ced659b2c77aebe66a6c9fbab5


--

___
Python tracker 

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



[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2020-02-11 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +17837
pull_request: https://github.com/python/cpython/pull/18464

___
Python tracker 

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



[issue39417] Link to "Python Packaging User Guide: Creating and using virtual environments" is broken

2020-02-11 Thread Angel Cervera Claudio


Angel Cervera Claudio  added the comment:

Thanks for handling this. I'm sorry   I didn't have a chance to create the
pr. :(

On Mon 10 Feb 2020, 23:51 Carol Willing,  wrote:

>
> Carol Willing  added the comment:
>
>
> New changeset c4a65ed7fe342bd18b5a5b0eea3470dc4fc31160 by Ogi Moore in
> branch 'master':
> bpo-39417: Fix broken link to guide to building venvs (GH-18432)
>
> https://github.com/python/cpython/commit/c4a65ed7fe342bd18b5a5b0eea3470dc4fc31160
>
>
> --
> nosy: +willingc
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue39610] memoryview.__len__ should raise an exception for 0d buffers

2020-02-11 Thread Eric Wieser


Change by Eric Wieser :


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

___
Python tracker 

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



[issue39610] memoryview.__len__ should raise an exception for 0d buffers

2020-02-11 Thread Eric Wieser


New submission from Eric Wieser :

Right now, the behavior is:

>>> import numpy as np
>>> arr_0d = np.array(42)
>>> mem_0d = memoryview(arr_0d)
>>> len(mem_0d)
1
>>> mem_0d[0]
TypeError: invalid indexing of 0-dim memory

It seems bizarre to have this object pretend to be a sequence when you ask for 
its length, yet not behave like one when you actually try to use this length. 
I'd suggest cpython should behave like numpy here, and fail:

>>> len(arr_0d)
TypeError: len() of unsized object


Perhaps `TypeError: cannot get length of 0-dim memory` would be more 
appropriate as a message.

---

Wasn't sure how to classify this, feel free to reclassify

--
components: Interpreter Core
messages: 361821
nosy: Eric Wieser, skrah
priority: normal
severity: normal
status: open
title: memoryview.__len__ should raise an exception for 0d buffers
type: behavior
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



[issue39299] Improve test coverage for mimetypes module

2020-02-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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



[issue39299] Improve test coverage for mimetypes module

2020-02-11 Thread miss-islington


miss-islington  added the comment:


New changeset d3f9fb2d28ceedb0a17a703338424ff284a578c8 by Miss Islington (bot) 
in branch '3.8':
bpo-39299: Add more tests for mimetypes and its cli. (GH-17949)
https://github.com/python/cpython/commit/d3f9fb2d28ceedb0a17a703338424ff284a578c8


--
nosy: +miss-islington

___
Python tracker 

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



[issue38243] [security][CVE-2019-16935] A reflected XSS in python/Lib/DocXMLRPCServer.py

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

CVE-2019-16935 has been assigned to this vulnerability.

--
title: A reflected XSS in python/Lib/DocXMLRPCServer.py -> 
[security][CVE-2019-16935] A reflected XSS in python/Lib/DocXMLRPCServer.py

___
Python tracker 

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



[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-02-11 Thread Max


Max  added the comment:

I agree that the solution is quite restrictive.
Restricting to ASCII characters alone would certainly work.

--

___
Python tracker 

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



[issue39574] str.__doc__ is misleading

2020-02-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Sorry everyone, due to technology problems I am unable to comment on the 
github page, and due to ISP problems I've been off the internet for a 
few days.

> pull_request: https://github.com/python/cpython/pull/18401

[Serhiy]
> Is not "or both" redundant?

I don't think so. In regular English, "or" can imply exclusive-or:

"Shall we eat at the Thai or the Italian restaurant?"

There are four relevant cases:

- supply neither encoding nor errors;
- supply only encoding;
- supply only errors;
- supply both encoding and errors.

Using "or" may be, for some readers, ambiguous: is the last option 
included or not? For the sake of two extra words, let's make it clear 
and unambiguous.

[Serhiy]
> Use just 'utf-8' instead of sys.getdefaultencoding(). It is a 
> constant in Python 3.

I didn't know that. I'm okay with that change, thank you.

[Serhiy]
> - str(bytes_or_buffer[, encoding[, errors]]) -> str
> + str(bytes_or_buffer, encoding='utf-8', errors='strict') -> str

I'm happy with that.

Thank you everyone, and sorry again that I have trouble with the Github 
process. (I need a new computer with a newer OS.)

--

___
Python tracker 

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



[issue39500] Document PyUnicode_IsIdentifier() function

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



[issue39500] Document PyUnicode_IsIdentifier() function

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f3e7ea5b8c220cd63101e419d529c8563f9c6115 by Victor Stinner in 
branch 'master':
bpo-39500: Document PyUnicode_IsIdentifier() function (GH-18397)
https://github.com/python/cpython/commit/f3e7ea5b8c220cd63101e419d529c8563f9c6115


--

___
Python tracker 

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



[issue27657] urlparse fails if the path is numeric

2020-02-11 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Hi Lukaz / Ned:

I will like to revert the backports done in 3.8 and 3.7.

Preferably in 3.8.2 and 3.7.7, so that this undesirable behavior exists only 
for a single release. 

I have set this is a release blocker to catch your attention.

--
nosy: +benjamin.peterson, lukasz.langa, ned.deily
priority: deferred blocker -> release blocker

___
Python tracker 

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



[issue39599] ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

> The sad part if that my code does not access PyGC_Head at all. It's just a 
> side effect when loading the code that makes it crash. :(

Python stores pointers to PyObject*. If your code doesn't access PyGC_Head 
directly, maybe it does acess it indirectly? I don't understand why you get a 
crash. It would help if you can provide more information about the crash. In 
which function does it happen? Try to get a gdb trace.

--

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2020-02-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +17835
pull_request: https://github.com/python/cpython/pull/18461

___
Python tracker 

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



[issue39599] ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure

2020-02-11 Thread Julien Danjou


Julien Danjou  added the comment:

> If you want to ship wheel package, another compromise would be to require 
> Python 3.7.5 or newer, and check early the Python version.

Yes, this is what I do now to avoid getting a segmentation fault.

I'm fine with closing this as wontfix or reject, your call. As you said, if 
it's not part of the stable ABI it makes sense.

The sad part if that my code does not access PyGC_Head at all. It's just a side 
effect when loading the code that makes it crash. :(

--

___
Python tracker 

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



[issue39599] ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

> This happens on a custom C module (built via Cython) when using including 
>  with -DPy_BUILD_CORE. I'm not sure it'd happen otherwise.

By the way, I don't think that wheel packages are designed to C extensions 
accessing Python internals.

The internal C API is excluded from the stable ABI.

--

___
Python tracker 

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



[issue39599] ABI breakage between Python 3.7.4 and 3.7.5: change in PyGC_Head structure

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

The PyObject structure is part of the stable ABI, but PyGC_Head is not.
https://www.python.org/dev/peps/pep-0384/#structures

I can understand that it's annoying to not be able to use the same wheel 
package on Python 3.7 <= 3.7.4 and Python Python 3.7 >= 3.7.5, but I don't 
think that we can fix this issue.

I suggest to close it as "rejected".

One solution is to require to build your C extension on installation (don't 
ship wheel packages).

If you want to ship wheel package, another compromise would be to require 
Python 3.7.5 or newer, and check early the Python version.

--

___
Python tracker 

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



[issue39245] Public API for Vectorcall (PEP 590)

2020-02-11 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +17834
pull_request: https://github.com/python/cpython/pull/18460

___
Python tracker 

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



[issue39521] reversed(mylist) much slower on Python 3.8 32-bit for Windows

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

I close this issue. It's likely just a hiccup in the PGO compilation. It's not 
the thing that we can easily control. The good thing is that the common code 
path iter(list) is efficient ;-)


> The code for listiter_next() and listreviter_next() is almost the same. 

Right. It cannot explain a 2x slowdown.


> python -m timeit -s "a = list(range(1000))" "list(iter(a))"
> 5 loops, best of 5: 5.73 usec per loop

It means around 5.73 ns per iteration. This is almost "nothing": just a few CPU 
cycles. For such microbenchmark, you are very close to the bare metal. You have 
to take in account CPU low-level metrics like usage of the CPU caches.


> Another possible cause is that this is just a random build outcome due to PGO 
> or incidental branch mis-prediction from aliasing (as described in 
> https://stackoverflow.com/a/17906589/1001643 ).

If someone cares about such microbenchmark, I suggest to get access to a 
profiling tool and measure the CPU cache usage and other metrics like that. On 
Linux, I know the "perf" command which can be used. I don't know performance 
tooling on Windows. Maybe search in Intel developer tools.

I expect that list(iter(a)) better uses the CPU (cache? branch predictor?) than 
list(reversed(a)), because of how listiter_next() and listreviter_next() have 
been optimized.

Bad code placement has a high cost on performance on such microbenchmarks. See:

* 
https://llvmdevelopersmeetingbay2016.sched.org/event/8YzY/causes-of-performance-instability-due-to-code-placement-in-x86
* https://vstinner.github.io/analysis-python-performance-issue.html

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



[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-02-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue39545] await is not supported in f-string in 3.6

2020-02-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +17833
pull_request: https://github.com/python/cpython/pull/18459

___
Python tracker 

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



[issue39607] Add a parameter to strip, lstrip, and rstrip that treats the first parameter as a full string

2020-02-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This has been discussed not long ago, it seems like it will need a PEP. See 
Brett's comment:

https://mail.python.org/archives/list/python-...@python.org/message/BDK6BDBOG2462SJIIOC5QMYPAJ5A4523/

and various discussions:

https://mail.python.org/archives/list/python-...@python.org/message/ZWRGCGANHGVDPP44VQKRIYOYX7LNVDVG/

https://mail.python.org/archives/list/python-id...@python.org/thread/RJARZSUKCXRJIP42Z2YBBAEN5XA7KEC3/#WIRID57ESUFUAQQQ6ZUY2RK5PKQQYSJ3

--
nosy: +steven.daprano

___
Python tracker 

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



[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

> The recommended solution is to only allow the standard HTTP methods of GET, 
> HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, and PATCH.

I don't think that we have to be so strict. We can maybe restrict the HTTP 
method to ASCII letters, or just reject control characters (U+-U+001f).

Similar issues (fixed):

* https://python-security.readthedocs.io/vuln/http-header-injection2.html
* https://python-security.readthedocs.io/vuln/http-header-injection.html

--
nosy: +orsenthil, vstinner

___
Python tracker 

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



[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-02-11 Thread STINNER Victor


Change by STINNER Victor :


--
title: Injection in http.client -> [security] http.client: HTTP Header 
Injection in the HTTP method

___
Python tracker 

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



[issue34592] cdll.LoadLibrary allows None as an argument

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

In clear, it's a feature, not a bug.

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



[issue37945] [Windows] locale.getdefaultlocale() issues on Windows: test_locale.test_getsetlocale_issue1813()

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

For me, the locale.getlocale() function is broken. Python attempts to guess too 
many things about the current locale. For example, it relies on an hard coded 
locale.locale_encoding_alias dictionary which seems to come from X11!? In 2020, 
Wayland replaced X11 and locales are updated frequently. This dictionary makes 
no sense on Windows. For example, 'ka_ge' is mapped to 
'ka_GE.GEORGIAN-ACADEMY': "GEORGIAN-ACADEMY" is not an encoding, what is the 
purpose of this string?

I fixed dozens and dozens of locale issues and I never ever used 
locale.getlocale(). I never understood its purpose nor how it guess the 
encoding.

I always use locale.setlocale(category) or locale.setlocale(category, None) 
which returns a simply string which I can pass back to 
locale.setlocale(category, string) to restore the locale, when I need to 
temporarily change a locale.

--

___
Python tracker 

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



[issue39608] Bug in lots of 0s

2020-02-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Its not a bug, it's deliberately designed that way.  is not ambiguous: it's 
just zero, in any base. 0012 is ambiguous.

There's a recent thread about it here:

https://mail.python.org/archives/list/python-id...@python.org/message/7IKEXSMVVDOTLHA7CNI7MIOBK4EU2ZSG/


If you want to change the behaviour, your first step is to get a consensus on 
the mailing list that it should change.

--
nosy: +steven.daprano
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



[issue37945] [Windows] locale.getdefaultlocale() issues on Windows: test_locale.test_getsetlocale_issue1813()

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-38324 as a duplicate of this issue.

--
nosy: +vstinner

___
Python tracker 

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



[issue38324] [Windows] test_locale and test__locale failures on Windows

2020-02-11 Thread STINNER Victor


[issue39608] Bug in lots of 0s

2020-02-11 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +BTaskaya, serhiy.storchaka

___
Python tracker 

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



[issue39600] idle_test: test_fontlist_key() fails if two font families have the same name

2020-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks to everybody who was involved in this issue, it's nice to see a test 
fixed so quickly, especially when it enhances IDLE UI for end users ;-)

--

___
Python tracker 

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2020-02-11 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Victor, sorry.
I spent about 4 days in total trying to figure out what is the reason for 
hanging.
I see that the signal handler is installed; but, in a rare situation, it is not 
called when the process is killed.

If I reduce an amount of code executed in a signal handler by spawning a 
auxiliary thread, setting threading. Event in sighandler, and doing all dirty 
work in this secondary thread -- the problem goes away.
I'm not happy with this "patch" because it looks like reducing a change of the 
race without the elimination of the root cause.

I've mastered a quick hack to skip the problematic test on a hang, it may 
unblock other developers.
I want to spend more time on the issue detection. Unfortunately, it is not easy 
because of non-determenistic problem source.

--

___
Python tracker 

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



[issue39609] Set the thread_name_prefix for asyncio's default executor ThreadPoolExecutor

2020-02-11 Thread Markus Mohrhard


Change by Markus Mohrhard :


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

___
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-11 Thread Petr Viktorin


Petr Viktorin  added the comment:

I'm with Stefan on "Definitely 3.8". It's a bug fix (for a rarely used feature).

--

___
Python tracker 

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



[issue39609] Set the thread_name_prefix for asyncio's default executor ThreadPoolExecutor

2020-02-11 Thread Markus Mohrhard


New submission from Markus Mohrhard :

The ThreadPoolExecutor in BaseEventLoop.run_in_executor should set a 
thread_name_prefix to simplify debugging.

Might also be worth to limit the number of max threads. On our 256 core 
machines we sometimes get 1000+ threads due to the cpu_count() * 5 default 
limit.

--
components: asyncio
messages: 361799
nosy: Markus Mohrhard, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Set the thread_name_prefix for asyncio's default executor 
ThreadPoolExecutor
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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2020-02-11 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
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-11 Thread miss-islington


miss-islington  added the comment:


New changeset 1ea45ae257971ee7b648e3b031603a31fc059f81 by Hai Shi in branch 
'master':
bpo-1635741: Port _codecs extension module to multiphase initialization (PEP 
489) (GH-18065)
https://github.com/python/cpython/commit/1ea45ae257971ee7b648e3b031603a31fc059f81


--
nosy: +miss-islington

___
Python tracker 

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



[issue39608] Bug in lots of 0s

2020-02-11 Thread wyz23x2


wyz23x2  added the comment:

2 is not supported;
So 000 should not too.

--

___
Python tracker 

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



[issue39608] Bug in lots of 0s

2020-02-11 Thread wyz23x2


Change by wyz23x2 :


--
title: Bug in 0 -> Bug in lots of 0s

___
Python tracker 

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



[issue39608] Bug in 00000000000000000

2020-02-11 Thread wyz23x2


New submission from wyz23x2 :

Why is this?
>>> 000 # No error
0
>>> 002
SyntaxError: leading zeros in decimal integer literals are not permitted; use 
an 0o prefix for octal integers

--
components: Build
messages: 361796
nosy: wyz23x2
priority: normal
severity: normal
status: open
title: Bug in 0
type: behavior
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



[issue39011] ElementTree attributes replace "\r" with "\n"

2020-02-11 Thread mefistotelis


mefistotelis  added the comment:

I'm on it.

Test update attached.

--
Added file: 
https://bugs.python.org/file48890/0002-bpo-39011-Test-white-space-preservation-in-attribs.patch

___
Python tracker 

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



[issue39545] await is not supported in f-string in 3.6

2020-02-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +17830
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18456

___
Python tracker 

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



  1   2   >