[issue38216] Fix for issue30458 prevents crafting invalid requests

2019-09-20 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

For reference this is how urllib handled the same issue in their test suite : 
https://github.com/urllib3/urllib3/pull/1673.

golang also received similar regression report as the change landed in 1.11.6 
and discussion : https://github.com/golang/go/issues/30903

--

___
Python tracker 

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



[issue16684] Unicode property value abbreviated names and long names

2019-09-20 Thread Greg Price


Greg Price  added the comment:

I've gone and implemented a version of this that's integrated into 
Tools/unicode/makeunicodedata.py , and into the unicodedata module.  Patch 
attached.  Demo:

>>> import unicodedata, pprint
>>> pprint.pprint(unicodedata.property_value_aliases)
{'bidirectional': {'AL': ['Arabic_Letter'],
# ...
   'WS': ['White_Space']},
 'category': {'C': ['Other'],
# ...
 'east_asian_width': {'A': ['Ambiguous'],
# ...
  'W': ['Wide']}}


Note that the values are lists.  That's because a value can have multiple 
aliases in addition to its "short name":

>>> unicodedata.property_value_aliases['category'][unicodedata.category('4')]
['Decimal_Number', 'digit']


This implementation also provides the reverse mapping, from an alias to the 
"short name":

>>> pprint.pprint(unicodedata.property_value_by_alias)
{'bidirectional': {'Arabic_Letter': 'AL',
# ...


This draft doesn't have tests or docs, but it's otherwise complete. I've posted 
it at this stage for feedback on a few open questions:

* This version is in C; at import time some C code builds up the dicts, from 
static tables in the header generated by makeunicodedata.py .  It's not *that* 
much code... but it sure would be more convenient to do in Python instead.

  Should the unicodedata module perhaps have a Python part?  I'd be happy to go 
about that -- rename the existing C module to _unicodedata and add a small 
unicodedata.py wrapper -- if there's a feeling that it'd be a good idea.  Then 
this could go there instead of using the C code I've just written.


* Is this API the right one?
  * This version has e.g. 
unicodedata.property_value_by_alias['category']['Decimal_Number'] == 'Nd' .

  * Perhaps make category/bidirectional/east_asian_width into attributes rather 
than keys? So e.g. 
unicodedata.property_value_by_alias.category['Decimal_Number'] == 'Nd' .

  * Or: the standard says "loose matching" should be applied to these names, so 
e.g. 'decimal number' or 'is-decimal-number' is equivalent to 'Decimal_Number'. 
To accomplish that, perhaps make it not dicts at all but functions?

So e.g. unicodedata.property_value_by_alias('decimal number') == 
unicodedata.property_value_by_alias('Decimal_Number') == 'Nd' .

  * There's also room for bikeshedding on the names.


* How shall we handle ucd_3_2_0 for this feature?

  This implementation doesn't attempt to record the older version of the data.  
My reasoning is that because the applications of the old data are quite 
specific and they haven't needed this information yet, it seems unlikely anyone 
will ever really want to know from this module just which aliases existed 
already in 3.2.0 and which didn't yet.

  OTOH, as a convenience I've caused e.g. 
unicodedata.ucd_3_2_0.property_value_by_alias to exist, just pointing to the 
same object as unicodedata.property_value_by_alias . This allows 
unicodedata.ucd_3_2_0 to remain a near drop-in substitute for the unicodedata 
module itself, while minimizing the complexity it adds to the implementation.

  Might be cleanest to just leave these off of ucd_3_2_0 entirely, though. It's 
still easy to get at them -- just get them from the module itself -- and it 
makes it explicit that you're getting current rather than old data.

--
keywords: +patch
nosy: +Greg Price
versions: +Python 3.9 -Python 3.8
Added file: https://bugs.python.org/file48616/prop-val-aliases.patch

___
Python tracker 

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



[issue38154] test__xxsubinterpreters: random failures on AMD64 FreeBSD CURRENT Shared 3.x

2019-09-20 Thread Kyle Stanley


Change by Kyle Stanley :


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

___
Python tracker 

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



[issue38154] test__xxsubinterpreters: random failures on AMD64 FreeBSD CURRENT Shared 3.x

2019-09-20 Thread Kyle Stanley


Kyle Stanley  added the comment:

For an updated explanation of the PR, see https://bugs.python.org/msg352835 or 
the comments in the PR itself.

--
stage: patch review -> 

___
Python tracker 

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



[issue37812] Make implicit returns explicit in longobject.c (in CHECK_SMALL_INT)

2019-09-20 Thread Greg Price


Greg Price  added the comment:

> labeling long-stable code as "evil".

Let me apologize about this bit -- I was thinking of the term in quotes 
(referring to the earlier comment), but I didn't write it clearly that way.  I 
don't think any of this code is evil, past or present, and I regret that I 
carelessly gave that impression.

I think there isn't currently any problem to be solved here, and I hope we can 
all put our energy elsewhere.  (For my part, I just spent the balance of the 
evening implementing an old feature request on unicodedata.)


Victor, I'd still be quite interested in better understanding your thinking (as 
this example relates to macros in general) if you'd like to reply, though this 
thread may not be the right place to continue.  You can find my email in Git, 
and I'm on Zulip and Discourse; and I'd be happy to start or follow a thread in 
a forum you think appropriate.  Or if you'd rather drop it entirely, that's 
fine too.

--

___
Python tracker 

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



[issue38225] iscoroutinefunction broken with cython - allow tagging of functions as async?

2019-09-20 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I think `func.__awaitable__ = True` can serve all possible situations.

We need it for async mocks (now the library use flawless `_is_coroutine` 
approach. 

`__awaitable__` can also cover cases where a regular function returns awaitable 
object or there is a class with `def __await__(self)` method, 
`functools.partial` -- all of them are awaitable.

Async functions can be modified to provide the property out of the box.

Regarding the question "is a check for awaitableness a good design or not"?
I agree that a check for awaitableness is useless *just before* calling the 
function.
There is another very useful case where the check is important: registering a 
callback for later usage.
For example, we have a web server framework. It is built around a mapping of 
URL paths to async functions, e.g. path('/hello', say_hello) in Django style. 
It's crucial to check if say_hello() is an async function *on the application 
configuration stage*, not on viewing the particular http://localhost/hello page 
in a browser.

So, I think an official protocol makes a lot of sense, let's implement it in 3.9

--

___
Python tracker 

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



[issue38216] Fix for issue30458 prevents crafting invalid requests

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



[issue38230] A Path Traversal vulnerability in ssl_servers.py

2019-09-20 Thread longwenzhang

New submission from longwenzhang :

There is a Path Traversal vulnerability in 
https://github.com/python/cpython/blob/master/Lib/test/ssl_servers.py (on 
windows platform),  Steps to reproduce:
1.Run the script 
https://github.com/python/cpython/blob/master/Lib/test/ssl_servers.py
2.If you visit the https://127.0.0.1:4433/ , you will see the files in the 
current directory, 
But if you visit the https://127.0.0.1:4433/c:../,you will jump to parent 
directory, and if you visit https://127.0.0.1:4433/d:../ , you will see the 
files of D:\ 
3.I'm sure it’s a Path Traversal and I think the problem is at 
https://github.com/python/cpython/blob/master/Lib/test/ssl_servers.py#L71 , 
there is no check about “word”.

--
components: Tests
messages: 352844
nosy: longwenzhang
priority: normal
severity: normal
status: open
title: A Path Traversal vulnerability in ssl_servers.py
type: security
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



[issue38230] A Path Traversal vulnerability in ssl_servers.py

2019-09-20 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Is this only about the test/ssl_servers.py ? I am not sure they are meant to be 
used by users and might have path access for tests.

--
nosy: +xtreak

___
Python tracker 

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



[issue38230] A Path Traversal vulnerability in test/ssl_servers.py

2019-09-20 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
title: A Path Traversal vulnerability in ssl_servers.py -> A Path Traversal 
vulnerability in test/ssl_servers.py

___
Python tracker 

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



[issue38225] iscoroutinefunction broken with cython - allow tagging of functions as async?

2019-09-20 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue38231] Documentation search results focus on tutorials and not language specifications

2019-09-20 Thread Matt


New submission from Matt :

* Problem: 
Documentation search results favor tutorials and over language specifications

* How to reproduce:
I often forget simple syntax.  For example, say I want to raise an exception.  
Clearly, I need to search for "raise".  

1. Go to https://docs.python.org/3.6/search.html
2. Type in "raise"

* Expected result:
A clearly understandable link to the "raise" documentation or something closely 
related, such as link to the "Built-in Exceptions" documentation 

* Actual result:
The documentation for the "raise" keyword is given in search result number... 
at first, second, and third glance, I don't even know if a page describing the 
"raise" command is returned.

The first result is a 2to3 conversion tutorial.
The second result is for urllib.error.
The third result is a unittest.mock tutorial
The fourth result is an optparse tutorial
The fifth result is a tutorial for "simple statements"
The sixth result is a tutorial for "Errors and exceptions".
The seventh result is a for "exception handling"

After much poking around, it turns out that the documentation for "raise" is in 
the "Simple statements" tutorial.  Knowing to select the correct link requires 
knowing that "raise" is a statement, as the only indication that this is the 
correct link is that "raise_stmt" occurs in its preview snippet.

Searching for related terms, such as "exceptions" or "errors", returns 
similarly indirect results, such as tutorials for "Extending Python with C or 
C++" and "API Reference".

The experience is the same, regardless of the Python version searched.

* Proposed solution:
I'm not sure how I can help with this, but I would like to.  For example, is 
there some kind of tagging I could do while meandering through the morass of 
Python documentation?

--
assignee: docs@python
components: Documentation
messages: 352846
nosy: docs@python, excalamus
priority: normal
severity: normal
status: open
title: Documentation search results focus on tutorials and not language 
specifications
type: behavior
versions: 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



[issue38216] Fix for issue30458 prevents crafting invalid requests

2019-09-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

All bug fixes are behavior changes.  Any broken behavior can be relied upon by 
someone.

So far the only ones who have popped up with this change as being a problem is 
one project's test suite where the behavior was used by a test because it was a 
convenient hack.  Not by application code.  Reverting mitigations due to the 
undesired behavior being convenient for someones protocol-abuse tests seems 
over cautious.  Those can be updated to not use our client library for their 
abuse scenarios.

--

___
Python tracker 

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



[issue37353] Source code has not always been forward-compatible

2019-09-20 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset 062cfe3b11c61d03ccc2915e360f9b0d80e23642 by Zachary Ware (Prateek 
Nayak) in branch 'master':
bpo-37353: Updated parser note about source code compatibility(GH-14277)
https://github.com/python/cpython/commit/062cfe3b11c61d03ccc2915e360f9b0d80e23642


--

___
Python tracker 

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



[issue37353] Source code has not always been forward-compatible

2019-09-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15880
pull_request: https://github.com/python/cpython/pull/16294

___
Python tracker 

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



[issue37353] Source code has not always been forward-compatible

2019-09-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15881
pull_request: https://github.com/python/cpython/pull/16295

___
Python tracker 

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



[issue37353] Source code has not always been forward-compatible

2019-09-20 Thread Zachary Ware


Change by Zachary Ware :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue37353] Source code has not always been forward-compatible

2019-09-20 Thread miss-islington


miss-islington  added the comment:


New changeset 2552e27b752f449b1d7046b384b14db0a69f46ad by Miss Islington (bot) 
in branch '3.7':
bpo-37353: Updated parser note about source code compatibility(GH-14277)
https://github.com/python/cpython/commit/2552e27b752f449b1d7046b384b14db0a69f46ad


--
nosy: +miss-islington

___
Python tracker 

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



[issue38216] Fix for issue30458 prevents crafting invalid requests

2019-09-20 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Thanks for all the comments. I agree the current (secure by default) 
implementation is desirable.  I also agree that such usage was never explicitly 
supported, so the "regression" here is perhaps over-stated. What I seek is to 
avoid the Go recommendation of "fork the implementation" when a lightweight 
hook could be provided as a means to achieve a reasonable, if unusual and 
discouraged, behavior. In particular, I'd like to support:

Sending a single request with invalid bytes for the path.
Allowing all requests for a client to support invalid bytes on the path.

Ideally, the solution should allow sending other non-control bytes as well, 
supporting the use case reported in issue36274 also.

I'll draft a patch. I'll try to get to it this weekend, but if I don't, don't 
feel like this needs to block releases.

--

___
Python tracker 

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



[issue37353] Source code has not always been forward-compatible

2019-09-20 Thread miss-islington


miss-islington  added the comment:


New changeset 0ab6b01820afef44beea8158ba08b6469bf264a0 by Miss Islington (bot) 
in branch '3.8':
bpo-37353: Updated parser note about source code compatibility(GH-14277)
https://github.com/python/cpython/commit/0ab6b01820afef44beea8158ba08b6469bf264a0


--

___
Python tracker 

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



[issue38232] empty local-part in addr_spec displayed incorrectly

2019-09-20 Thread Andrei Troie


New submission from Andrei Troie :

Given an (RFC-legal) email address with the local part consisting of a quoted 
empty string (e.g. 'Nobody <""@example.org>'), when I call the 'addr_spec' 
property, the result no longer includes the quoted empty string (so, in this 
case, addr_spec would return '@example.org').

--
components: email
files: example_parser.py
messages: 352852
nosy: andreitroiebbc, barry, r.david.murray
priority: normal
severity: normal
status: open
title: empty local-part in addr_spec displayed incorrectly
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48617/example_parser.py

___
Python tracker 

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



[issue38233] datetime.datetime.fromtimestamp have different behaviour on windows and mac

2019-09-20 Thread Alexandre Ouellet


New submission from Alexandre Ouellet :

in a python console on a windows machine:

import datetime
d = datetime.datetime.fromtimestamp(0)
d
>datetime.datetime(1969, 12, 31, 19, 0)
d.timestamp()
>OSError: [Errno 22] Invalid argument

on a macOS machine : 

d = datetime.datetime.fromtimestamp(-1)
d
>datetime.datetime(1969, 12, 31, 19, 0)
d.timestamp()
>-1.0

both machines running 3.6.9

I would expect them have the same behaviour.

--
components: Windows, macOS
messages: 352853
nosy: Alexandre Ouellet, ned.deily, paul.moore, ronaldoussoren, steve.dower, 
tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: datetime.datetime.fromtimestamp have different behaviour on windows and 
mac
type: crash
versions: Python 3.6

___
Python tracker 

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



[issue30129] functools.partialmethod should look more like what it's impersonating.

2019-09-20 Thread Sylvain Marie


Sylvain Marie  added the comment:

For future reference if this topic re-opens, there is now an alternative here:

https://smarie.github.io/python-makefun/#removing-parameters-easily

Note: it relies on a dynamic `compile` statement so of course it is less 
optimal than the one in functools. But at least it can serve as a reference...

--
nosy: +smarie

___
Python tracker 

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



[issue37937] Mention ``frame.f_trace`` in :func:`sys.settrace` docs.

2019-09-20 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset 9c2682efc69568e1b42a0c1759489d6f2e3b30ea by Nick Coghlan (Ram 
Rachum) in branch 'master':
bpo-37937: Mention frame.f_trace in sys.settrace docs (GH-15439)
https://github.com/python/cpython/commit/9c2682efc69568e1b42a0c1759489d6f2e3b30ea


--
nosy: +ncoghlan

___
Python tracker 

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



[issue37937] Mention ``frame.f_trace`` in :func:`sys.settrace` docs.

2019-09-20 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue37937] Mention ``frame.f_trace`` in :func:`sys.settrace` docs.

2019-09-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15883
pull_request: https://github.com/python/cpython/pull/16297

___
Python tracker 

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



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

2019-09-20 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

When calling Py_SetPath(), the value that is passed in is ignored.

--
components: Interpreter Core
keywords: 3.8regression
messages: 352856
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: The value of Py_SetPath is not used to populate the configuration
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



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

2019-09-20 Thread STINNER Victor


STINNER Victor  added the comment:

It's a 3.8 regression: I set the priority to release blocker.

--
nosy: +lukasz.langa
priority: normal -> release blocker

___
Python tracker 

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



[issue37937] Mention ``frame.f_trace`` in :func:`sys.settrace` docs.

2019-09-20 Thread Nick Coghlan


Nick Coghlan  added the comment:

Thanks for the PR, Ram, and the initial review, Serhiy.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



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

2019-09-20 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

A very simple way to reproduce the bug:

Using pyInstaller, after applying these patches (to fix other Python3.8 issues)

https://github.com/pyinstaller/pyinstaller/pull/4441
https://github.com/pyinstaller/pyinstaller/pull/4440

you will get

Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

This is because Python will use the default value for sys.path, including the 
"lib" subdirectory:

/dist/hello/lib/python3.8
^> This should not be here

Instead, that value should be the one that pyinstaller passes when calling 
Py_SetPath() here: 

https://github.com/pyinstaller/pyinstaller/blob/develop/bootloader/src/pyi_pythonlib.c#L495

So it should be:

/dist/hello/python3.8

--

___
Python tracker 

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



[issue37937] Mention ``frame.f_trace`` in :func:`sys.settrace` docs.

2019-09-20 Thread miss-islington


miss-islington  added the comment:


New changeset fd4f28d894ee55d7ee1625c726c1859fcd1e2249 by Miss Islington (bot) 
in branch '3.7':
bpo-37937: Mention frame.f_trace in sys.settrace docs (GH-15439)
https://github.com/python/cpython/commit/fd4f28d894ee55d7ee1625c726c1859fcd1e2249


--
nosy: +miss-islington

___
Python tracker 

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



[issue37937] Mention ``frame.f_trace`` in :func:`sys.settrace` docs.

2019-09-20 Thread miss-islington


miss-islington  added the comment:


New changeset c410390e89071c4a4c2a437a227c14274add4116 by Miss Islington (bot) 
in branch '3.8':
bpo-37937: Mention frame.f_trace in sys.settrace docs (GH-15439)
https://github.com/python/cpython/commit/c410390e89071c4a4c2a437a227c14274add4116


--

___
Python tracker 

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



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

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38232] empty local-part in addr_spec displayed incorrectly

2019-09-20 Thread Andrei Troie


Change by Andrei Troie :


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



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

2019-09-20 Thread STINNER Victor


STINNER Victor  added the comment:

That's a regression that I introduced between Python 3.7 and 3.8 when 
refactoring _PyCoreConfig/_PyPathConfig code into PyConfig/_PyPathConfig. 

Previously, if Py_SetPath() was called, the specified string was used to fill 
config->module_search_paths. Now, this string is basically ignored.

PR 16298 fix this regression.

--

___
Python tracker 

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



[issue38233] datetime.datetime.fromtimestamp have different behaviour on windows and mac

2019-09-20 Thread Ammar Askar


Ammar Askar  added the comment:

Thanks for the report Alexandre, this has to do with issues with negative 
numbers in Window's time APIs. There's already a bug open for this, so I've 
marked it as a duplicate.

--
nosy: +ammar2
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Timestamp conversion on windows fails with timestamps close to 
EPOCH
type: crash -> behavior

___
Python tracker 

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



[issue38231] Documentation search results focus on tutorials and not language specifications

2019-09-20 Thread Ammar Askar


Ammar Askar  added the comment:

This is a great point Matt, the documentation search is a bit lacking and we're 
kind of using https://bugs.python.org/issue34398 and 
https://github.com/python/cpython/pull/8773 to track it.

The current idea that Julien, the docs expert, had is to add some sort of 
Sphinx directive in the docs that boosts and entry's search result. Would you 
like to close this issue in favor of that one...or post your comment there so 
we can track these in one place?

--
nosy: +ammar2

___
Python tracker 

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



[issue34398] Docs search should prominently show definitions and glossary items

2019-09-20 Thread Ammar Askar


Ammar Askar  added the comment:

Changing the title a little to represent that this is now a general improvement 
of the docs search. Julien is working to upstream a solution into Sphinx that 
will allow any items to be featured prominently on search.

--
title: Docs search does not index glossary items -> Docs search should 
prominently show definitions and glossary items

___
Python tracker 

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



[issue38235] Docs of logging module says argument is named "lvl". TypeError.

2019-09-20 Thread Daniel Andersson


New submission from Daniel Andersson :

How to reproduce:

>>> import logging
>>> logging.disable(lvl=logging.ERROR)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: disable() got an unexpected keyword argument 'lvl'

The correct keyword argument name is `level` as can be seen in the Python code 
Lib/logging/__init__.py:
---> def disable(level=CRITICAL):

The documentation uses `lvl`, see Doc/library/logging.rst:
---> .. function:: disable(lvl=CRITICAL)

The solution would be to rename the argument from `lvl` to `level` in the 
documentation.

I also noticed some more cases in the logging module docs where `lvl` is used 
(and `level` is used in the Python code):

* logging.Logger.isEnabledFor(lvl)
* logging.Logger.log(lvl, msg, *args, **kwargs)
* logging.Logger.makeRecord(name, lvl, fn, lno, msg, args, exc_info, func=None, 
extra=None, sinfo=None)
* logging.addLevelName(lvl, levelName)
* logging.getLevelName(lvl)

Maybe there are some historical reasons for this that I'm not aware about.

I also found an inconsistency. In the `Handler` class the docs does use `level`:
* logging.Handler.setLevel(level)

I can understand that the English in the documentation might be clearer when 
written as:
"Associates level `lvl` with text `levelName`"
instead of,
"Associates level `level` with text `levelName`"
- avoids the double-"level".

But at the same time, I usually trust the documentation blindly and was 
surprised by this error.

In the five listed examples above, `lvl` is only used as a positional argument. 
Maybe it is more OK to deviate from the actual name in the code in this case 
compared to keyword arguments, as in logging.disable.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 352866
nosy: docs@python, penlect, vinay.sajip
priority: normal
severity: normal
status: open
title: Docs of logging module says argument is named "lvl". TypeError.
versions: Python 2.7, 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



[issue38231] Documentation search results focus on tutorials and not language specifications

2019-09-20 Thread Matt


Matt  added the comment:

I will close this issue and post in one of the two places you linked.

Thank you for your prompt reply and affirmation of my observations.  I feel my 
language was colored by frustration, yet you focused instead on my willingness 
to help.  I appreciate that and find your response encouraging.

Somewhat related, I am responding to this through the bugs.python.org 
interface.  If I reply directly to the email the tracker sent me, will my reply 
be properly routed to this thread?  It's not clear from the send address what 
would happen if I replied via email.

--

___
Python tracker 

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



[issue38231] Documentation search results focus on tutorials and not language specifications

2019-09-20 Thread Ammar Askar


Ammar Askar  added the comment:

> Somewhat related, I am responding to this through the bugs.python.org 
> interface.  If I reply directly to the email the tracker sent me, will my 
> reply be properly routed to this thread? 

Yes, it will :)

The bug tracker allows replies by email.

--

___
Python tracker 

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



[issue38236] Dump the Python path configuration at the first import error

2019-09-20 Thread STINNER Victor


New submission from STINNER Victor :

When Python path configuration is not properly configured, Python fails with an 
error looking like:
---
Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x7ff0065b2740 (most recent call first):

---

This error is very common and hard to debug. It can happen in various cases for 
various reasons:

* Python is embedded in an application
* PYTHONPATH and/or PYTHONHOME environment variable is set
* pyenv.cfg configuration for virtual environment
* Local .py files which override the standard library

A few examples:

* bpo-38234: Py_SetPath() regression in Python 3.8 which impacts PyInstaller
* https://bugs.python.org/issue35978#msg335363 virtual env
* https://bugs.python.org/issue35969#msg335249 "encodings.py" file in the 
current directory
* 
https://stackoverflow.com/questions/55657593/python-3-8-0a3-failed-to-get-the-python-codec-of-the-filesystem-encoding
 embedded Python
* 
https://askubuntu.com/questions/640010/fatal-python-error-py-initialize-unable-to-get-the-locale-encoding-syntaxe
 Python 3 installed by Anaconda which uses Python 2.7 stdlib because of 
PYTHONPATH
* https://github.com/GNS3/gns3-gui/issues/2267 Python embedded in "gns3"
* https://github.com/JuliaPy/PyCall.jl/issues/410 venv
* https://techglimpse.com/error-executing-python3-5-command-solution/ another 
random error

Attached PR dumps the Python path configuration if importing the Python codec 
of the filesystem encoding fails. In the Python initialization, it's the first 
import which is done.

--
components: Interpreter Core
messages: 352869
nosy: inada.naoki, ncoghlan, pablogsal, steve.dower, vstinner
priority: normal
severity: normal
status: open
title: Dump the Python path configuration at the first import error
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



[issue38093] Update MagicMock __aenter__ and __aexit__ to return AsyncMock's

2019-09-20 Thread Lisa Roach


Change by Lisa Roach :


--
pull_requests: +15885
pull_request: https://github.com/python/cpython/pull/16299

___
Python tracker 

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



[issue38216] Fix for issue30458 prevents crafting invalid requests

2019-09-20 Thread Tim Burke


Tim Burke  added the comment:

> Since at least one project is known to have been impacted, it's not 
> unreasonable to expect that more will be.

I can confirm at least one other: OpenStack Swift's stable jobs have been 
broken by https://github.com/python/cpython/commit/bb8071a since 11 Sep; see 
https://bugs.launchpad.net/swift/+bug/1843816 . (*Why* we're testing against an 
untagged version of py27, I still need to investigate...)

Now, the broken tests *do* represent something of a long-standing bug in 
application code: our front-end server was lenient in what it accepted but not 
strict in what it emitted -- it would forward on whatever crazy query params 
the client sent, directly to the back-end servers. Of course, as long as the 
back-end servers are *also* lenient in what they accept, it doesn't actually 
present a problem. Still, I'm happy to fix the issue.

Actually *addressing* this has proven problematic, however, as we have numerous 
functional tests that send raw UTF-8 request paths -- to the point that I can 
only assume there exist clients sending such requests. Changing the tests to 
URL-encode the path would do a disservice to those clients, as my fix (or some 
future fix) may break them and we'd be none the wiser.

> We either "be strict in what we produce" or we ignore abuse of the APIs and 
> effectively close all CVEs filed against them as "not a bug, this library is 
> intended to allow abuse when given untrusted input."

I think this is a false dichotomy; in 
https://bugs.python.org/issue36274#msg351834 Jason proposed a few alternatives 
that allow for a secure and obvious default API while adding a new, explicitly 
unsafe API.

I'd like to add yet another option that may be useful specifically for 
maintenance releases: forbid only the problematic characters -- namely LF (and 
potentially CR and SP). This seems like a much more surgical fix for 
maintenance releases, allowing the null byte for CherryPy or the raw UTF-8 
bytes for Swift, while still mitigating the CVE.

3.8 and later can still have the more-robust check to ensure callers have done 
any requisite URL-escaping. Ideally, there would also be a reasonable hook in 
place to allow application developers to verify behavior in the presence of 
invalid requests; something short of writing raw bytes to a socket.

> For reference this is how urllib handled the same issue in their test suite : 
> https://github.com/urllib3/urllib3/pull/1673.

I think the test suites developed by clients (like urllib3) and servers (like 
CherryPy or Swift) inherently have very different goals -- where a client would 
want to ensure that it *produces valid bytes* on the wire, a server ought to 
check that it doesn't completely fall over when it *receives invalid bytes* on 
the wire.

> What I seek is to avoid the Go recommendation of "fork the implementation" ...

This is *exactly* the way we worked around https://bugs.python.org/issue36274 
in Swift: swap out putrequest() in our func tests. (See 
https://github.com/openstack/swift/commit/c0ae48b .) It looks like a similar 
change will be required to fix our stable branches.

I agree, I'd much rather *not* have to do that. :-/

--

___
Python tracker 

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



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

2019-09-20 Thread STINNER Victor


STINNER Victor  added the comment:

> Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
> filesystem encoding

I created bpo-38236 "Dump the Python path configuration at the first import 
error" which should ease to debug such issues.

--

___
Python tracker 

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



[issue6559] add pass_fds paramter to subprocess.Popen()

2019-09-20 Thread miss-islington


miss-islington  added the comment:


New changeset 77abf23c67c1a465a8899666c69f6bcd6930e003 by Miss Islington (bot) 
(Orivej Desh) in branch 'master':
bpo-6559: Update _posixsubprocess.fork_exec doc (GH-16283)
https://github.com/python/cpython/commit/77abf23c67c1a465a8899666c69f6bcd6930e003


--
nosy: +miss-islington

___
Python tracker 

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



[issue38236] Dump the Python path configuration at the first import error

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38236] Dump the Python path configuration at the first import error

2019-09-20 Thread STINNER Victor


STINNER Victor  added the comment:

Without my change:

---
vstinner@apu$ PYTHONHOME=/xxx ./python 
Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x7fa9c32d6740 (most recent call first):

---


With my PR 16300:

---
$ PYTHONHOME=/xxx ./python 
Python path configuration:
  PYTHONHOME = '/xxx'
  PYTHONPATH = '/usr/share/qa-tools/python-modules'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys.executable = '/home/vstinner/python/master/python'
  sys.prefix = '/xxx'
  sys.exec_prefix = '/xxx'
  sys.path = [
'/usr/share/qa-tools/python-modules',
'/xxx/lib/python39.zip',
'/xxx/lib/python3.9',
'/xxx/lib/python3.9/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x7f9cef949740 (most recent call first):

---

--

___
Python tracker 

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



[issue38236] Dump the Python path configuration at the first import error

2019-09-20 Thread STINNER Victor


STINNER Victor  added the comment:

>   user site = 1
>   import site = 1

I'm not sure that dumping these configuration variables are useful to debug 
this very specific error:

"Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding"

They only have an effect on sys.path later.

--

___
Python tracker 

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



[issue35696] remove unnecessary operation in long_compare()

2019-09-20 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue. The win32 job of Azure Pipelines now logs a compiler 
warning:

Objects\longobject.c(412,5): warning C4244:  'function': conversion from 
'unsigned long' to 'sdigit', possible loss of data
Objects\longobject.c(420,5): warning C4244:  'function': conversion from 
'unsigned __int64' to 'sdigit', possible loss of data

See also discussion on PR 16146:
https://github.com/python/cpython/pull/16146#issuecomment-533351728

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

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Current signature:

pow(x, y, z=None, /)


Proposed signature:

pow(base, exp, mod=None)


Benefits:

* Meaningful and self-explanatory parameters in tooltips

* Optionally clearer calls for the three argument form:

 pow(2, 5, mod=4)

* More usable with partial():

 squared = partial(pow, exp=2)

--
components: Library (Lib)
keywords: easy (C)
messages: 352876
nosy: mark.dickinson, rhettinger
priority: normal
severity: normal
status: open
title: Expose meaningful keyword arguments for pow()
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



[issue38235] Docs of logging module says argument is named "lvl". TypeError.

2019-09-20 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger
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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Ammar Askar


Ammar Askar  added the comment:

Looks like a solid proposal, I especially like the clarity for the 3-argument 
call. Often beginners ask about why there's a third argument in pow especially 
when teaching RSA and number-theoretic stuff.

Do you mind if I take this on Raymond?

--
nosy: +ammar2

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Ammar Askar


Ammar Askar  added the comment:

Actually quick question, should a similar change be made for `math.pow` for 
consistency's sake?

--

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Ammar Askar


Change by Ammar Askar :


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

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Ammar Askar


Ammar Askar  added the comment:

I've made a PR, feel free to close it if you'd rather implement this yourself 
or this proposal won't be accepted :)

--

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

You can use a lambda instead of partial:

squared = lambda x: pow(x, 2)

Proposed names look meaningful. But after adding support of keyword arguments 
please compare performance of the old and the new functions. I expect that the 
difference will be small, but we need to check.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Ammar Askar


Ammar Askar  added the comment:

Here's a little microbenchmark, let me know if there's anything specific you'd 
like to see:

Before
==

> python -m pyperf timeit "from test.test_builtin import BuiltinTest; tst = 
> BuiltinTest()" -- "tst.test_pow()"

Mean +- std dev: 3.80 us +- 0.23 us

> python -m pyperf timeit "pow(23, 19, 3)"

Mean +- std dev: 519 ns +- 12 ns


After
=

> python -m pyperf timeit "from test.test_builtin import BuiltinTest; tst = 
> BuiltinTest()" -- "tst.test_pow()"

Mean +- std dev: 3.80 us +- 0.26 us

> python -m pyperf timeit "pow(23, 19, 3)"

Mean +- std dev: 526 ns +- 18 ns

--

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2019-09-20 Thread Andre Herbst


Andre Herbst  added the comment:

+1 for the feature

Subtests make the test results of all asserts visible at test execution time 
but decrease the readability of a test:

@parameterized([2,4,6])
def test_method_whenCalled_returnsNone(self, a):
# 1) arrange
something = Something()

# 2) act
result = something.method(a)

# 3) assert
self.assertIsNone(result)

When using subtests the phases of 1) arrange, 2) act, 3) assert are not clearly 
separated, the unit test contains logic and two additional indentation levels 
that could be avoided with parameterized tests:

def test_method_whenCalled_returnsNone(self, a):
# 1) arrange
something = Something()

for a in [2,4,6]:
with self.subTest(a=a):
# 2) act
result = something.method(a)

# 3) assert
self.assertIsNone(result)

--
nosy: +moormaster

___
Python tracker 

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



[issue35696] remove unnecessary operation in long_compare()

2019-09-20 Thread Sergey Fedoseev

Sergey Fedoseev  added the comment:

These warnings are caused by 
https://github.com/python/cpython/commit/c6734ee7c55add5fdc2c821729ed5f67e237a096.

I'd fix them, but I'm not sure if we are going to restore CHECK_SMALL_INT() 
¯\_(ツ)_/¯

--
nosy: +sir-sigurd

___
Python tracker 

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



[issue38238] site.py reporting user site info even if ENABLE_USER_SITE=False

2019-09-20 Thread Barry Muldrey


New submission from Barry Muldrey :

site info is accessed externally via getusersitepackages() and getuserbase()... 
for example see "pip/_internal/locations.py"

If ENABLE_USER_SITE is set to "False," or otherwise disabled,
accesses to these methods should return '' or None (shouldn't they?).

Currently, I have ENABLE_USER_SITE globally disabled (by various means), but 
pip's call to getusersitepackages() is still returning "~/.local/lib/...".

This seems wrong.  An alternative would be for external tools to manually 
import site.ENABLE_USER_SITE, but this seems incorrect.

--
components: Library (Lib)
messages: 352884
nosy: bjmuld
priority: normal
severity: normal
status: open
title: site.py reporting user site info even if ENABLE_USER_SITE=False
type: behavior
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



[issue38238] site.py reporting user site info even if ENABLE_USER_SITE=False

2019-09-20 Thread Barry Muldrey


Change by Barry Muldrey :


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

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Mark Dickinson


Mark Dickinson  added the comment:

The proposal sounds reasonable to me.

> should a similar change be made for `math.pow` for consistency's sake?

I'd leave math.pow alone here.

--

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you. Could you please test simpler examples like pow(2, 3)? Please use 
the --duplicate option.

--

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

And pow(2.0, 3.0) please.

--

___
Python tracker 

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



[issue25244] Idle: refine right-click behavior

2019-09-20 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.9 -Python 2.7, Python 3.4, 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



[issue25488] IDLE: Remove '', user_dir, and idlelib from sys.path when added

2019-09-20 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.9 -Python 2.7, Python 3.5, 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



[issue1207613] Idle Editor: Bottom Scroll Bar

2019-09-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

A horizontal text bar is added to a text view as needed (recent patch) when one 
is used for the font sample.  The latter fits or not according to the font 
size.  The same could be used for editor, or better, editor windows could 
inherit from text views.

--
nosy:  -kbk, roger.serwy
versions: +Python 3.9 -Python 2.7, Python 3.4, 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



[issue26949] IDLE restarts when one debugs code raising SystemExit

2019-09-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

>>> raise SystemExit does not normally cause a restart.

--
nosy:  -kbk, roger.serwy
versions: +Python 3.9 -Python 2.7, 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



[issue38216] Fix for issue30458 (HTTP Header Injection) prevents crafting invalid requests

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
title: Fix for issue30458 prevents crafting invalid requests -> Fix for 
issue30458 (HTTP Header Injection) prevents crafting invalid requests

___
Python tracker 

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



[issue28840] IDLE: Document tk's long line display limitation

2019-09-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

IDLE Help's newish section "User Output in Shell" makes some mention of this 
but a bit more is still needed.

--
stage: test needed -> needs patch
versions: +Python 3.9 -Python 2.7, Python 3.5, 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



[issue38187] test.test_tools.test_c_analyzer fails in refleak mode

2019-09-20 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +15890
pull_request: https://github.com/python/cpython/pull/16304

___
Python tracker 

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



[issue21973] IDLE: catch user cfg file error, better error message, continue

2019-09-20 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy:  -kbk, roger.serwy
versions: +Python 3.9 -Python 2.7, Python 3.5, 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



[issue23218] Modernize the IDLE Find/Replace/Find in Files dialogs

2019-09-20 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.9 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue3559] IDLE: Pasted newline doesn't trigger execution when typed newline would

2019-09-20 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.9 -Python 2.7, 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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bc2256ea177a653bcab15b06b5f5725b10c1fff3 by Victor Stinner in 
branch 'master':
bpo-33694: Remove test_asyncio ProactorDatagramTransportTests (GH-16288)
https://github.com/python/cpython/commit/bc2256ea177a653bcab15b06b5f5725b10c1fff3


--

___
Python tracker 

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



[issue25733] Code and IDLE should catch all compile errors.

2019-09-20 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.9 -Python 2.7, 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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15891
pull_request: https://github.com/python/cpython/pull/16305

___
Python tracker 

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



[issue38205] Py_UNREACHABLE() no longer behaves as a function call

2019-09-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b1542583bee204130934c2b90684041e29378250 by Victor Stinner in 
branch 'master':
bpo-38205: Py_UNREACHABLE() calls Py_FatalError() (GH-16290)
https://github.com/python/cpython/commit/b1542583bee204130934c2b90684041e29378250


--

___
Python tracker 

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



[issue37857] Setting logger.level directly has no effect due to caching in 3.7+

2019-09-20 Thread Zane Bitter


Zane Bitter  added the comment:

In turns out that setting the level directly is used in the standard library, 
so we definitely have a bug here that needs fixing in 3.7 & 3.8.

Obviously the fix could be just to stop doing that in the standard library, but 
I'd argue that this is even stronger evidence that it can happen to anyone, and 
that we should fix it for Python users in general.

> But it's not a priority to support situations where people don't follow 
> published APIs and still expect things to work the way they would like.

That's fair, of course. This isn't and shouldn't be anyone's number 1 priority, 
but that doesn't mean we can't do it.

> I would prefer people to use setLevel(), as it helps to have consistent usage.

Me too. I added a new patch to the PR that deprecates the setter so that anyone 
doing it wrong will get a warning. (In fact that's how I discovered it was 
being set directly in the standard library.)

> The philosophy is that of not breaking userspace code *which follows 
> published APIs*. If you use unpublished APIs or rely on implementation 
> details, you're generally on your own.

I was referring to stuff like 
https://devblogs.microsoft.com/oldnewthing/20031015-00/?p=42163 (I won't link 
to a famous equivalent in Linux because it involves Linus swearing at people), 
where the users are clearly wrong but they have a policy of not breaking them 
anyway.

--

___
Python tracker 

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



[issue38205] Py_UNREACHABLE() no longer behaves as a function call

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15892
pull_request: https://github.com/python/cpython/pull/16306

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -12891

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13220

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13649

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -14111

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13661

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13643

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13656

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13642

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13625

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13676

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -10267

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13627

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13654

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13663

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread miss-islington


miss-islington  added the comment:


New changeset b50edac42fd39d58ba51eb9cee2d3645a2e28ca4 by Miss Islington (bot) 
in branch '3.8':
bpo-33694: Remove test_asyncio ProactorDatagramTransportTests (GH-16288)
https://github.com/python/cpython/commit/b50edac42fd39d58ba51eb9cee2d3645a2e28ca4


--

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -13660

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -15156

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-09-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -14161

___
Python tracker 

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



[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Ammar Askar


Ammar Askar  added the comment:

Before
==

>python -m pyperf timeit "pow(2, 3)" --duplicate 10
Mean +- std dev: 242 ns +- 19 ns

> python -m pyperf timeit "pow(2.0, 3.0)" --duplicate 10
Mean +- std dev: 197 ns +- 16 ns

After
=

> python -m pyperf timeit "pow(2, 3)" --duplicate 10
Mean +- std dev: 243 ns +- 11 ns

> python -m pyperf timeit "pow(2.0, 3.0)" --duplicate 10
Mean +- std dev: 200 ns +- 14 ns

--

___
Python tracker 

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



  1   2   >