[issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default

2019-12-02 Thread Micky Yun Chan


Micky Yun Chan  added the comment:

Hi I created a new pull request on Github

--

___
Python tracker 

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



[issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default

2019-12-02 Thread Micky Yun Chan


Change by Micky Yun Chan :


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

___
Python tracker 

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



[issue38959] Parboil -- OpenMP CUTCP performance regression when upgrade from python 2.7.15 to 2.7.17

2019-12-02 Thread Jiebin


Change by Jiebin :


Added file: https://bugs.python.org/file48752/test-definition.xml

___
Python tracker 

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



[issue38959] Parboil -- OpenMP CUTCP performance regression when upgrade from python 2.7.15 to 2.7.17

2019-12-02 Thread Jiebin


Change by Jiebin :


Added file: https://bugs.python.org/file48751/downloads.xml

___
Python tracker 

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



[issue38959] Parboil -- OpenMP CUTCP performance regression when upgrade from python 2.7.15 to 2.7.17

2019-12-02 Thread Jiebin


Jiebin  added the comment:

In Clear Linux, You can produce by the following steps.

1, sudo swupd bundle-add os-testsuite-phoronix
2, phoronix-test-suite run parboil-1.2.1
3, select the option OpenMP CUTCP

Or download it from the source code. Refer the file attached.

--
Added file: https://bugs.python.org/file48750/install.sh

___
Python tracker 

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



[issue38959] Parboil -- OpenMP CUTCP performance regression when upgrade from python 2.7.15 to 2.7.17

2019-12-02 Thread Jiebin

New submission from Jiebin :

When we replace the rpm package from 2.7.15 to 2.7.17. The benchmark Parboil -- 
OpenMP CUTCP shows regression.
Steps to reproduce the regression. You can reproduce the issue by phoronix test 
suite or run it from the source code.




Benchmarks  indicators  unitHIB/LIB Legacy version  
New version Regression status   OS  HW platform 
comments
component version   value   RSD 
component version   value   RSD 
 parboil OpenMP CUTCP   Seconds  LIB 2.7.15  1.20    0.5%    2.7.17 
 1.37    0.5%    12% Clear Linux CLX server

--
components: Library (Lib)
files: image-2019-12-03-13-55-06-020.png
messages: 357744
nosy: jiebinsu
priority: normal
severity: normal
status: open
title: Parboil -- OpenMP CUTCP performance regression when upgrade from python 
2.7.15 to 2.7.17
type: performance
versions: Python 2.7
Added file: https://bugs.python.org/file48749/image-2019-12-03-13-55-06-020.png

___
Python tracker 

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



[issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default

2019-12-02 Thread Micky Yun Chan


Micky Yun Chan  added the comment:

Hi, if it's possible can I take this issue?

--
nosy: +Micky Yun Chan

___
Python tracker 

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



[issue38950] argparse uses "optional arguments" for "keyword arguments"

2019-12-02 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue38950] argparse uses "optional arguments" for "keyword arguments"

2019-12-02 Thread paul j3


paul j3  added the comment:

This related to an old issue

https://bugs.python.org/issue9694
argparse required arguments displayed under "optional arguments"

argparse defines two initial argument groups, titled 'positional arguments' and 
'optional arguments'.   Alternatives have been suggested, such as 'flagged 
arguments' and/or 'required arguments'.  But nothing was settled.

Users can define their own argument groups. 

I'd suggest closing this a duplicate, though we can certainly revisit the 
earlier discussion.

--
nosy: +paul.j3

___
Python tracker 

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



[issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default

2019-12-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +paul.j3, rhettinger

___
Python tracker 

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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread Ned Deily


Change by Ned Deily :


--
versions: +Python 3.5

___
Python tracker 

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



[issue38270] Tests: Avoid MD5 or check for MD5 availablity

2019-12-02 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


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

___
Python tracker 

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



[issue38957] Cannot compile with libffi from source on Windows

2019-12-02 Thread Ashley Whetter


Ashley Whetter  added the comment:

Ah you're right. I was trying to install in the same way as previous versions. 
I didn't realise that calling prepare_*.bat was a separate step now.
Sorry about that.

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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +16926
pull_request: https://github.com/python/cpython/pull/17445

___
Python tracker 

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



[issue38270] Tests: Avoid MD5 or check for MD5 availablity

2019-12-02 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
nosy: +cstratak

___
Python tracker 

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



[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-12-02 Thread Guido van Rossum


Guido van Rossum  added the comment:

I doubt effbot will respond. :-)

I think the first order of business is to add the same FutureWarning to the C 
version of the code, and to reset the clock on the deprecation. 

In terms of the final stages, why wouldn't we want it to just always raise? 
Just because there's so much code that might break?

It shouldn't be a SyntaxWarning, since this is most definitely not a syntax 
issue. I'd be okay with RuntimeError (or RuntimeWarning if we decide to keep 
the old outcome with a warning forever).

(Huh, does FutureWarning count as a deprecation?)

--

___
Python tracker 

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



[issue38957] Cannot compile with libffi from source on Windows

2019-12-02 Thread Steve Dower


Steve Dower  added the comment:

The intent is that you'd build from source and then copy the binaries into the 
libffi directory (the *real* intent is that very few people should have to 
build libffi from source).

Can you tell us a bit more about what you were trying to achieve when you ran 
into this?

--

___
Python tracker 

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



[issue38958] asyncio REPL swallows KeyboardInterrupt while editing

2019-12-02 Thread Io Mintz


New submission from Io Mintz :

"python3 -m asyncio" swallows KeyboardInterrupt while editing a line.

Problem steps:
==

- run python -m asyncio
- press ^C

Expected behavior (normal CPython REPL, as well as python -m code):
==

The current input line is abandoned and "\nKeyboardInterrupt" is printed.

Sample for "spam^C" with the normal REPL:
-

Python 3.8.0 (default, Oct 23 2019, 18:51:26) 
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> spam
KeyboardInterrupt

Python 3.9.0a1+ (heads/master:a62ad4730c, Dec  2 2019, 17:38:37) 
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> spam
KeyboardInterrupt


Sample for "spam^C" in the InteractiveConsole REPL, as invoked by `python -m 
code`:
---

Python 3.8.0 (default, Oct 23 2019, 18:51:26) 
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> spam
KeyboardInterrupt

Python 3.9.0a1+ (heads/master:a62ad4730c, Dec  2 2019, 17:38:37) 
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> spam
KeyboardInterrupt


Actual behavior:


The KeyboardInterrupt is ignored, the current input line remains on screen, and 
a new line is not started:

asyncio REPL 3.8.0 (default, Oct 23 2019, 18:51:26) 
[GCC 9.2.0] on linux
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> spam

asyncio REPL 3.9.0a1+ (heads/master:a62ad4730c, Dec  2 2019, 17:38:37) 
[GCC 9.2.0] on linux
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> spam


Workaround
==

If editing a continued block (ie a line prefixed by sys.ps2 / "..."), enter any 
invalid syntax (such as unindented code) to cancel the current block. If 
editing a single line, press ^U to clear the line.

OS Details
==

Arch Linux, python extra/python 3.8.0-1.

--
components: asyncio
messages: 357738
nosy: asvetlov, iomintz, yselivanov
priority: normal
severity: normal
status: open
title: asyncio REPL swallows KeyboardInterrupt while editing
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



[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-12-02 Thread Philip Rowlands


Philip Rowlands  added the comment:

I went digging through the archives, made more interesting as elementtree was 
imported into the standard library.

AFAICT, the FutureWarning for __bool__ (or __nonzero__ in py2) appeared circa 
2007-06 in version 1.3a2:
http://svn.effbot.org/public/tags/elementtree-1.3a3-20070912/CHANGES

- Added future warnings for "if e" (use explicit len(e) or is None
  test) and "e.getchildren()" (use list(e) or iteration).

The docs are still there, warning about the pitfalls and suggesting "This 
behaviour is likely to change somewhat in ElementTree 1.3."
https://effbot.org/zone/element.htm#truth-testing

12 years on, it has not, but what was the intended change (+effbot for possible 
context)??

I assumed on first reading that the plan was to switch bool(Element) to return 
True, but others have pointed out the inconsistency with len(), or having 
__bool__() raise an exception.

My 2c would be to steer devs away from using bool(Element) as a final step, 
i.e. keep the existing True/False definition, warts and all, but raise a 
SyntaxWarning (RuntimeWarning?) with a similar message to the current 
FutureWarning.

--
nosy: +effbot

___
Python tracker 

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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread Ned Deily


Change by Ned Deily :


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



[issue38957] Cannot compile with libffi from source on Windows

2019-12-02 Thread Ashley Whetter


New submission from Ashley Whetter :

get_externals.bat downloads and extracts libffi to a versioned directory (much 
like the other external libraries). See 
https://github.com/python/cpython/blob/v3.8.0/PCbuild/get_externals.bat#L55
However the binary release is downloaded to an unversioned directory. See 
https://github.com/python/cpython/blob/v3.8.0/PCbuild/get_externals.bat#L79
The visual studio project looks for the unversioned directory 
(https://github.com/python/cpython/blob/v3.8.0/PCbuild/python.props#L62), and 
so the binaries are always used.

So it is possible to build from source, but you have to move libffi yourself 
after running `get_externals_bat --libffi-src`. I think the fix here is to make 
get_externals.bat and visual studio always use a versioned directory.

--
components: Build, Windows
messages: 357736
nosy: AWhetter, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Cannot compile with libffi from source on Windows
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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread Guido van Rossum


Guido van Rossum  added the comment:

(Now waiting for 2.7 backport by stealthcopter.)

--

___
Python tracker 

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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread Ned Deily


Ned Deily  added the comment:


New changeset 30afc91f5e70cf4748ffac77a419ba69ebca6f6a by Ned Deily (Miss 
Islington (bot)) in branch '3.6':
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format 
(GH-17418) (GH-17444)
https://github.com/python/cpython/commit/30afc91f5e70cf4748ffac77a419ba69ebca6f6a


--
nosy: +ned.deily

___
Python tracker 

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



[issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default

2019-12-02 Thread Antony Lee


New submission from Antony Lee :

https://bugs.python.org/issue8538 recently added to Py3.9 a much welcome 
addition to argparse, namely the capability to generate --foo/--no-foo flag 
pairs.  A small issue with the implementation is that it *always* appends the 
default value to the help string (if any):

if help is not None and default is not None:
help += f" (default: {default})"

This is inconsistent with other action classes, and results in the defaults 
being printed twice if using ArgumentsDefaultHelpFormatter (which is the 
documented way to include the defaults in the help text):

from argparse import *
parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter)
parser.add_argument("--foo", action=BooleanOptionalAction, help="Whether to 
foo it", default=True)
parser.add_argument("--quux", help="Set the quux", default=42)
print(parser.parse_args())

yields

usage: foo.py [-h] [--foo | --no-foo] [--quux QUUX]

optional arguments:
  -h, --help   show this help message and exit
  --foo, --no-foo  Whether to foo it (default: True) (default: True)  # 
<--- HERE
  --quux QUUX  Set the quux (default: 42)

I think the fix is just a matter of not adding the default value to the help 
string.

--
components: Library (Lib)
messages: 357733
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: argparse.BooleanOptionalAction should not add the default value to the 
help string by default
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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread miss-islington


miss-islington  added the comment:


New changeset 8859fc629474ab1ca7eb2e67aec538097c327e58 by Miss Islington (bot) 
in branch '3.8':
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format 
(GH-17418)
https://github.com/python/cpython/commit/8859fc629474ab1ca7eb2e67aec538097c327e58


--

___
Python tracker 

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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread miss-islington


miss-islington  added the comment:


New changeset 87f2d261ee1c63ed39517355833d087c5a78b4bf by Miss Islington (bot) 
in branch '3.7':
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format 
(GH-17418)
https://github.com/python/cpython/commit/87f2d261ee1c63ed39517355833d087c5a78b4bf


--
nosy: +miss-islington

___
Python tracker 

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



[issue1875] "if 0: return" not raising SyntaxError

2019-12-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16924
pull_request: https://github.com/python/cpython/pull/17443

___
Python tracker 

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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16925
pull_request: https://github.com/python/cpython/pull/17444

___
Python tracker 

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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue38945] Remove newline characters from uu encoding methods

2019-12-02 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset a62ad4730c9b575f140f24074656c0257c86a09a by Guido van Rossum 
(Matthew Rollings) in branch 'master':
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format 
(#17418)
https://github.com/python/cpython/commit/a62ad4730c9b575f140f24074656c0257c86a09a


--
nosy: +gvanrossum

___
Python tracker 

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



[issue15273] Remove unnecessarily random behavior from test_unparse.py

2019-12-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> @pablogsal should we add Lib/test/test_grammar by default to every test? Also 
> if this is still needed @Daniel.Cioata do you still want to prepare another 
> patch for current version?

I think is a good idea, let me check how complete is the current version first.

--

___
Python tracker 

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



[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2019-12-02 Thread Vinay Sajip


Vinay Sajip  added the comment:

> You can't. Tools like `pipenv shell` and `conda shell` end up with a new 
> shell running instead of changing the current shell in-place.

Indeed. I raised it because of what you said earlier:

> and so maybe proposing a simple `venv --activate ` that does nothing 
> more than set those key environment variables and prints out a message about 
> what is happening is enough to do the trick

So not that simple, then, if it has to handle multiple shells cross-platform. 
Especially as if tools like pew, pipenv, conda already do this. Are you 
proposing to bring that functionality, which these third-party tools perform 
currently, into the stdlib?

--

___
Python tracker 

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



[issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided.

2019-12-02 Thread PCManticore


Change by PCManticore :


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

___
Python tracker 

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



[issue38920] Audit events for unhandled exceptions

2019-12-02 Thread Steve Dower


Change by Steve Dower :


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



[issue38955] Non indemnpotent behavior of asyncio.get_event_loop and asyncio.run sequence.

2019-12-02 Thread Matthias Bussonnier


New submission from Matthias Bussonnier :

Hi, Not sure if this a bug, or an intended feature. 
I got surprise by the following behavior. 


from asyncio import run, sleep, get_event_loop

print(get_event_loop()) # return the current eventloop
run(sleep(0))
print(get_event_loop()) # raise a RuntimeError


I would expect `get_event_loop` to get back to it's initial default value. 

This comes from the fact that `run()` call `set_event_loop()` to `None`. with
both sets `_set_called` to `True`, but `get_event_loop` seem to assume if
_set_called is True, then loop cannot be none. 

I'm tempted to think that if `set_loop()` is called with `None`, it should 
reset the `_set_called` to False. Or Am I supposed to call 
`set_event_loop(new_event_loop())` myself ? 

I'm likely missing  something so any insight would be appreciated; if you
believe this is an actual issue I'm happy to send a PR.

--
components: asyncio
messages: 357727
nosy: asvetlov, mbussonn, yselivanov
priority: normal
severity: normal
status: open
title: Non indemnpotent behavior of asyncio.get_event_loop and asyncio.run 
sequence.
type: behavior
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



[issue15273] Remove unnecessarily random behavior from test_unparse.py

2019-12-02 Thread Batuhan


Batuhan  added the comment:

@pablogsal should we add Lib/test/test_grammar by default to every test? Also 
if this is still needed @Daniel.Cioata do you still want to prepare another 
patch for current version?

--
nosy: +BTaskaya, pablogsal

___
Python tracker 

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



[issue31842] pathlib: "Incorrect function" during resolve()

2019-12-02 Thread Eryk Sun


Eryk Sun  added the comment:

> When strict is "false", pathlib should not fail if the network 
> share is inaccessible.

A redirected filesystem (i.e. a share, whether local or remote) that's 
physically inaccessible should fail with a FileNotFoundError -- due to 
underlying errors such as ERROR_BAD_NETPATH (53) or ERROR_BAD_NET_NAME (67). 
This case is already handled by resolve() in non-strict mode. But error 
handling for other cases does need to be expanded.

A PermissionError should be ignored, from OS errors such as ERROR_ACCESS_DENIED 
(5), ERROR_SHARING_VIOLATION (32), and ERROR_NOT_READY (21). 

It should ignore errors due to bad reparse points (e.g. filesystem symlinks and 
mount points), such as ERROR_INVALID_REPARSE_DATA (4392) and 
ERROR_REPARSE_TAG_INVALID (4393). 

The resolve() method is supposed to raise a RuntimeError for a symlink loop 
(i.e. reparse loop). In Windows, the system detects this case as 
ERROR_CANT_RESOLVE_FILENAME (1921). It's not necessarily due to a reparse loop, 
but in practice it usually is. (It's actually due to the upper limit for the 
number of reparse attempts, which as of Windows 10 is no more than 63 
attempts.) Maybe this error should be re-raised as a RuntimeError for the sake 
of compatibility with the POSIX implementation.

The above-mentioned cases are all due to WINAPI CreateFileW failing. 
Additionally, the GetFinalPathNameByHandleW call in nt._getfinalpathname relies 
on several low-level system calls, any one of which can fail with 
ERROR_INVALID_FUNCTION (1) or ERROR_INVALID_PARAMETER (87) -- and possibly 
ERROR_NOT_SUPPORTED (50). These errors should be ignored in non-strict mode. 

At a lower level, the reliability of nt._getfinalpathname could be improved for 
non-strict operation. It could fall back on other forms of the final name that 
may be supported. It could try FILE_NAME_OPENED instead of FILE_NAME_NORMALIZED 
to handle a filesystem that does not support normalizing 8.3 short names as 
long names. Try VOLUME_NAME_GUID instead of VOLUME_NAME_DOS to handle a volume 
that only has a GUID name (i.e. a volume device that's registered with the 
mount-point manager but lacks a DOS drive name or even a mountpoint on a volume 
that has a DOS drive name). Try VOLUME_NAME_NT to handle legacy 
volume/filesystem devices ('legacy' because they do not support the mount-point 
manager interface that was introduced almost 20 years ago in NT 5). For the 
sake of simplicity and performance, the latter case could be limited to 
well-known DOS device names such as r"\\?\PIPE" -> r"\Device\NamedPipe". The NT 
device path for the comparison should be queried instead of hard coded, e.g. 
 via QueryDosDeviceW(L"PIPE", ...).

--

___
Python tracker 

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



[issue38924] pathlib paths .normalize()

2019-12-02 Thread Ionuț Ciocîrlan

Ionuț Ciocîrlan  added the comment:

Brett and Serhiy, you do realise there are no symlinks to resolve on PurePaths, 
right?


> os.path.normpath() is broken by design.

Why don't you deprecate it then? Sounds like the reasonable thing to do, no? So 
many innocent souls endangered by this evil function...

It's broken by design if you use it to shoot yourself in the foot. If you want 
however to normalize an abstract path, an absolutely reasonable thing to do, it 
does the right and very useful thing. Because, well, the filesystem isn't the 
only thing that has paths and other things don't have symlinks. Also, this lib 
is called pathlib, not fspathlib, *and* someone had the foresight of separating 
filesystem paths from abstract paths. Quite a strange series of coincidences, 
no?

Let me quote the initial comment for this issue, which apparently noone read:

> On `PurePath` its usefulness is obvious, but it's debatable for `Path`, as it 
> would yield different results from `.resolve()` in case of symlinks (which 
> resolves them before normalizing).

--

___
Python tracker 

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



[issue38948] os.path.ismount() returns False for current working drive

2019-12-02 Thread Steve Dower


Steve Dower  added the comment:

ntpath.ismount() is using a name-only check here, it never tries to resolve the 
path if splitdrive() returns (anything, one_of("", "/", "\\"))

Now it's not clear whether handling "" is intended there, but that's certainly 
the difference (Python 2 required exactly one character in that part). And it 
appears to be consistent back to 3.4, so I'm not sure we can or should fix 
anything. The only thing 'F:' can ever be is a mount point.

However, we should probably fix the fact that C: returns False. This is because 
we call abspath(path), and "x:" is a relative path. When the drive does not 
match the current working drive, you get "x:\\". But when it _does_ match, you 
get the current working directory, which (unless it's the root directory) is no 
longer a mount point.

Perhaps the best fix for that is to just say that "x:" is a relative path and 
hence never a mount point? Which would be the same as switching back to the 
Python 2 behaviour, but would be a much better reason.

--
nosy: +eryksun
title: os.path.ismount() returns true in python 3.7.4 and false in 2.7.14 -> 
os.path.ismount() returns False for current working drive
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



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

2019-12-02 Thread Steve Dower


Steve Dower  added the comment:

Traditionally we handle exceptions in os.path.is* functions and return False.

--
keywords: +easy, newcomer friendly
stage:  -> test needed
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



[issue38924] pathlib paths .normalize()

2019-12-02 Thread Brett Cannon

Brett Cannon  added the comment:

I'm going with Serhiy's recommendation and closing this. Sorry, Ionuț.

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



[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2019-12-02 Thread Brett Cannon


Brett Cannon  added the comment:

> If venv is run in a child process of the shell, how does it set those 
> variables in the parent shell?

You can't. Tools like `pipenv shell` and `conda shell` end up with a new shell 
running instead of changing the current shell in-place.

--

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

All Fedora tests are successful, so I will de-escalate the priority of the 
issue. Thank you very much Christian and Tomas Orsava!

--
priority: critical -> normal

___
Python tracker 

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



[issue22640] Add silent mode for py_compile

2019-12-02 Thread Gregory Shevchenko


Change by Gregory Shevchenko :


--
pull_requests: +16921
pull_request: https://github.com/python/cpython/pull/17134

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread miss-islington


miss-islington  added the comment:


New changeset 1f4f28cbf3ca4c7f85b41b1f7b9455a375415cc0 by Miss Islington (bot) 
in branch '3.7':
bpo-38815: Accept TLSv3 default in min max test (GH-) (GH-17437)
https://github.com/python/cpython/commit/1f4f28cbf3ca4c7f85b41b1f7b9455a375415cc0


--

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread miss-islington


miss-islington  added the comment:


New changeset 9e728806d03fff8fa9e75159e567b2b4e040971b by Miss Islington (bot) 
in branch '3.8':
bpo-38815: Accept TLSv3 default in min max test (GH-) (GH-17437)
https://github.com/python/cpython/commit/9e728806d03fff8fa9e75159e567b2b4e040971b


--

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Testing for the latest PR happening here:

https://buildbot.python.org/all/#/builders?tags=%2Bstable=%2Bcustom

--

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16920
pull_request: https://github.com/python/cpython/pull/17439

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16919
pull_request: https://github.com/python/cpython/pull/17438

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread miss-islington


miss-islington  added the comment:


New changeset 34864d1cffdbfc620f8517dab9a68ae9a37b8c53 by Miss Islington (bot) 
(torsava) in branch 'master':
bpo-38815: Accept TLSv3 default in min max test (GH-) (GH-17437)
https://github.com/python/cpython/commit/34864d1cffdbfc620f8517dab9a68ae9a37b8c53


--
nosy: +miss-islington

___
Python tracker 

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



[issue38952] asyncio cannot handle Python3 IPv4Address

2019-12-02 Thread Max Coplan

Max Coplan  added the comment:

Well I’ve submitted a fix for it.  It isn’t perfect.  Well, while it doesn’t 
look perfect, it actually worked with everything I’ve thrown at it, and seems 
to be a very robust and sufficient fix.

--

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread Tomas Orsava


Change by Tomas Orsava :


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

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread Christian Heimes


Christian Heimes  added the comment:

Tomas Orsava is going to provide a PR within the next hour.

--

___
Python tracker 

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



[issue27873] multiprocessing.pool.Pool.map should take more than one iterable

2019-12-02 Thread AnLong


Change by AnLong :


--
pull_requests: +16916
pull_request: https://github.com/python/cpython/pull/17436

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Raising the priority to 'critical' as this is masking all other problems on a 
significant number of buildbots.

Christian, could you take a look?

--
nosy: +pablogsal
priority: normal -> critical

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-02 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-38954 as duplicate of this issue. Copy of its message:
---
 This issue is probably duplicate of some other, but I decided to make one new 
one due to the fact that this affect all Fedora build bots.


test test_ssl failed
test_timeout_connect_ex (test.test_ssl.NetworkedTests) ... ok
==
FAIL: test_min_max_version (test.test_ssl.ContextTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-x86_64.lto-pgo/build/Lib/test/test_ssl.py",
 line 1207, in test_min_max_version
self.assertEqual(
AssertionError:  != 
--
Ran 161 tests in 2.681s
FAILED (failures=1, skipped=11)
1 test failed again:
test_ssl

Example failure:

https://buildbot.python.org/all/#/builders/222
---

--
title: test_ssl: test_min_max_version() fails on AMD64 FreeBSD Shared 3.x -> 
test_ssl: test_min_max_version() fails on FreeBSD and Fedora

___
Python tracker 

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



[issue38954] test_ssl fails in all Fedora buildbots

2019-12-02 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to reuse bpo-38815.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> test_ssl: test_min_max_version() fails on AMD64 FreeBSD Shared 
3.x

___
Python tracker 

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



[issue38954] test_ssl fails in all Fedora buildbots

2019-12-02 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

This issue is probably duplicate of some other, but I decided to make one new 
one due to the fact that this affect all Fedora build bots.


test test_ssl failed
test_timeout_connect_ex (test.test_ssl.NetworkedTests) ... ok
==
FAIL: test_min_max_version (test.test_ssl.ContextTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-x86_64.lto-pgo/build/Lib/test/test_ssl.py",
 line 1207, in test_min_max_version
self.assertEqual(
AssertionError:  != 
--
Ran 161 tests in 2.681s
FAILED (failures=1, skipped=11)
1 test failed again:
test_ssl

Example failure:

https://buildbot.python.org/all/#/builders/222

--
components: Tests
messages: 357708
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: test_ssl  fails in all Fedora buildbots
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



[issue38815] test_ssl: test_min_max_version() fails on AMD64 FreeBSD Shared 3.x

2019-12-02 Thread STINNER Victor


STINNER Victor  added the comment:

Previous attempt:
https://github.com/python/cpython/pull/11508#issuecomment-453186969

Old Fedora issue, worked around in the Fedora buildbot configuration: bpo-35045.

--

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on AMD64 FreeBSD Shared 3.x

2019-12-02 Thread STINNER Victor


STINNER Victor  added the comment:

Debian and Fedora are already using OPENSSL_CONF=/non-existing-file workaround.

IMHO test_ssl should be fixed instead. test_ssl should not make assumptions on 
min/max TLS version.

--

___
Python tracker 

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



[issue38815] test_ssl: test_min_max_version() fails on AMD64 FreeBSD Shared 3.x

2019-12-02 Thread STINNER Victor


STINNER Victor  added the comment:

Similar issue in Fedora: 
https://src.fedoraproject.org/rpms/python3/pull-request/155

--

___
Python tracker 

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



[issue38953] Untokenize and retokenize does not round-trip

2019-12-02 Thread Zac Hatfield-Dodds


New submission from Zac Hatfield-Dodds :

I've been working on a tool called Hypothesmith - 
https://github.com/Zac-HD/hypothesmith - to generate arbitrary Python source 
code, inspired by CSmith's success in finding C compiler bugs.  It's based on 
the grammar but ultimately only generates strings which `compile` accepts; this 
is the only way I know to answer the question "is the string valid Python"!

I should be clear that I don't think the minimal examples are representative of 
real problems that users may encounter!  However, fuzzing is very effective at 
finding important bugs if we can get these apparently-trivial ones out of the 
way by changing either the code or the test :-)

```python
@example("#")
@example("\n\\\n")
@example("#\n\x0cpass#\n")
@given(source_code=hypothesmith.from_grammar().map(fixup).filter(str.strip))
def test_tokenize_round_trip_string(source_code):
tokens = list(tokenize.generate_tokens(io.StringIO(source_code).readline))
outstring = tokenize.untokenize(tokens)  # may have changed whitespace from 
source
output = tokenize.generate_tokens(io.StringIO(outstring).readline)
assert [(t.type, t.string) for t in tokens] == [(t.type, t.string) for t in 
output]
```

Each of the `@example` cases are accepted by `compile` but fail the test; the 
`@given` case describes how to generate more such strings.  You can read more 
details in the Hypothesmith repo if interested.

I think these are real and probably unimportant bugs, but I'd love to start a 
conversation about what properties should *always* hold for functions dealing 
with Python source code - and how best to report research results if I can 
demonstrate that they don't!

(for example, lib2to3 has many similar failures but I don't want to open a long 
list of low-value issues)

--
components: Library (Lib)
messages: 357704
nosy: Zac Hatfield-Dodds, meador.inge
priority: normal
severity: normal
status: open
title: Untokenize and retokenize does not round-trip
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue31807] unitest.mock: Using autospec=True conflicts with 'wraps'

2019-12-02 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