[issue40464] functools.singledispatch doesn't verify annotation is on FIRST parameter

2020-05-01 Thread Dutcho


New submission from Dutcho :

>From Python 3.7, `functools.singledispatch` makes the `register()` attribute 
>of the generic function infer the type of the first argument automatically for 
>functions annotated with types. That's great for DRY.
However, in 3.7 and 3.8, no check is made that the *first* parameter of the 
registered function is actually annotated; *any* annotation suffices, even the 
*return* one.

Example:
```
>>> @functools.singledispatch
... def func(arg):...
>>> @func.register
... def _int(arg) -> int:...
>>> @func.register
... def _str(arg) -> str:...
```
No errors happen, although the return type, *not* `arg`, is annotated.
This results in:
```
>>> func.registry
mappingproxy({: , : , : })

```
Obviously, that doesn't dispatch correctly.

Note that un-annotated functions *are* caught:
```
>>> @func.register
... def _no_annotation(arg): ...
Traceback (most recent call last):
...
TypeError: Invalid first argument to `register()`: . Use either `@register(some_class)` or plain `@register` 
on an annotated function.
```

--
components: Library (Lib)
messages: 367824
nosy: Dutcho
priority: normal
severity: normal
status: open
title: functools.singledispatch doesn't verify annotation is on FIRST parameter
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



[issue40463] csv.reader split error

2020-05-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

You should tell us what you're seeing, and what you're expecting.

I'm adding the rest of this not because it solves your problem, but because it 
might help you or someone else troubleshoot this further.

Here's a simpler reproducer:

import csv
lst = ['"A,"h"e, ","E","DC"']

csv_list = csv.reader(lst)
for idx, col in enumerate(next(csv_list)):
print(idx, repr(col))

Which produces:
0 'A,h"e'
1 ' "'
2 'E'
3 'DC'

Although true to its word, this is using the default dialect='excel', and my 
version of Excel gives these same 4 columns, including the space starting the 
second column.

Dropping the space after the "e," gives 3 columns:

lst = ['"A,"h"e,","E","DC"']

Produces:
0 'A,h"e'
1 ',E"'
2 'DC'

Again, this is exactly what Excel gives, as odd as it seems.

It might be worth playing around with the dialect parameters to see if you can 
achieve what you want. In your example:
delimiter=',', quotechar='"'
are the default values for the "excel" dialect, which is why I dropped them 
above.

--
nosy: +eric.smith

___
Python tracker 

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



[issue40465] Deprecate the optional *random* argument to random.shuffle()

2020-05-01 Thread Raymond Hettinger

New submission from Raymond Hettinger :

shuffle(x, random=None)⟼shuffle(x)

AFAICT, no one ever uses the optional parameter, nor would they have a valid 
reason to do so.  It is an ancient API oddity and is inconsistent with the 
other methods in the module.  I've long been annoyed by it and would like to 
see it cleaned-up before I retire ;-)

https://docs.python.org/3/library/random.html#random.shuffle

--
components: Library (Lib)
messages: 367826
nosy: rhettinger, tim.peters
priority: normal
severity: normal
status: open
title: Deprecate the optional *random* argument to random.shuffle()
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad

2020-05-01 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

Okay, I was able to get the tests passing on the other platforms.

I'm still not sure why Mac and Fedora behaved differently with my original PR. 
I was able to come up with a simple script that isolated the behavior 
difference (posted in the PR comments). It's very strange. Maybe it signals an 
issue elsewhere in the Python code base.

--

___
Python tracker 

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



[issue40462] [easy] undefined name in Lib/test/mock_socket.py

2020-05-01 Thread Furkan Onder


Change by Furkan Onder :


--
keywords: +patch
nosy: +furkanonder
nosy_count: 1.0 -> 2.0
pull_requests: +19151
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19832

___
Python tracker 

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



[issue40465] Deprecate the optional *random* argument to random.shuffle()

2020-05-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

+1

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40462] [easy] undefined name in Lib/test/mock_socket.py

2020-05-01 Thread Furkan Onder


Furkan Onder  added the comment:

Hello,
I sent a PR that corrects variable and function names.
I'm not sure how to fix it for Lib/test/test_json/test_recursion.py:55:24 so I 
didn't make any changes.

--

___
Python tracker 

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



[issue40453] Add PyConfig._isolated_interpreter: isolated subinterpreters

2020-05-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 252346acd937ddba4845331994b8ff4f90349625 by Victor Stinner in 
branch 'master':
bpo-40453: Add PyConfig._isolated_subinterpreter (GH-19820)
https://github.com/python/cpython/commit/252346acd937ddba4845331994b8ff4f90349625


--

___
Python tracker 

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



[issue40453] Add PyConfig._isolated_interpreter: isolated subinterpreters

2020-05-01 Thread STINNER Victor


STINNER Victor  added the comment:

TODO

* check that spawning a thread is blocked in isolated subinterpreter
* block loading C extensions which don't implement PEP 489 in isolated 
subinterpreter

(see https://github.com/python/cpython/pull/19820 comments)

--

___
Python tracker 

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



[issue40466] asyncio.ensure_future() breaks implicit exception chaining

2020-05-01 Thread Chris Jerdonek


New submission from Chris Jerdonek :

This issue is about how if a coroutine is wrapped in a Task with 
asyncio.ensure_future(), then portions of the exception chain can be lost.

Specifically, if you run the following code, then ValueError will be raised 
with exc.__context__ equal to the KeyError:

import asyncio

async def raise_error():
raise ValueError

async def main():
try:
raise KeyError
except Exception as exc:
future = raise_error()
# Uncommenting the next line makes exc.__context__ None below.
# future = asyncio.ensure_future(future)

try:
await future
except Exception as exc:
print(f'error: {exc!r}, context: {exc.__context__!r}')
raise

asyncio.get_event_loop().run_until_complete(main())

However, if you uncomment the `asyncio.ensure_future()` line, then the 
ValueError will be raised with no __context__.

I originally raised this issue a couple years ago here:
https://mail.python.org/pipermail/async-sig/2017-November/000403.html

There it was suggested that this was a special case of this issue:
https://bugs.python.org/issue29587

However, after writing code to fix that, this issue still exists.

--
components: asyncio
messages: 367832
nosy: asvetlov, chris.jerdonek, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.ensure_future() breaks implicit exception chaining
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



[issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad

2020-05-01 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

By the way, I just posted a new issue about exception chaining getting 
suppressed, but this time in an asyncio setting with ensure_future():
https://bugs.python.org/issue40466

I first noticed this issue two or three years ago and raised it on the 
async-sig list. It was suggested there that this was a special case of the 
current issue. Having written code to fix the current issue, though, the 
ensure_future() issue still exists. So I filed a separate issue.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Warnings found by pyflakes:

Hu, "Lib/test/test_tools/test_c_analyzer/test_parser" has nothing to do 
with this PR. This looks like Eric Snow's c analyzer for avoiding globals and 
other stuff for sub interpreters.

--

___
Python tracker 

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



[issue40460] [easy] undefined name in Lib/idlelib/zzdummy.py

2020-05-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Yes, simple typo.  I need to look at test_Zzdummy.py to see if it should have 
been failing with the typo.  If this is executed, the end index must be 1 so 
that the loop never executes.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +19152
pull_request: https://github.com/python/cpython/pull/19833

___
Python tracker 

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



[issue40453] Add PyConfig._isolated_interpreter: isolated subinterpreters

2020-05-01 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset b796b3fb48283412d3caf52323c69690e5818d3d by Pablo Galindo in 
branch 'master':
bpo-40334: Simplify type handling in the PEG c_generator (GH-19818)
https://github.com/python/cpython/commit/b796b3fb48283412d3caf52323c69690e5818d3d


--

___
Python tracker 

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



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

2020-05-01 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +19153
pull_request: https://github.com/python/cpython/pull/19835

___
Python tracker 

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



[issue32494] Use gdbm_count if possible

2020-05-01 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue32494] Use gdbm_count if possible

2020-05-01 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 8727664557cd44dcd00612ccba816942e8f885ab by Dong-hee Na in branch 
'master':
bpo-32494: Use gdbm_count for dbm_length if possible (GH-19814)
https://github.com/python/cpython/commit/8727664557cd44dcd00612ccba816942e8f885ab


--
nosy: +pitrou

___
Python tracker 

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



[issue40434] Update of reasoning why there is no case statement

2020-05-01 Thread Ama Aje My Fren


Ama Aje My Fren  added the comment:

the statement initially said that there was _no consensus yet on how to do 
range tests_. This is not true because there is now a decision to not do range 
tests - that decision is only in PEP 3103 and not in PEP 275 (PEP 275 actually 
links to PEP 3103 to explain why it is rejected). My feeling is that putting 
two references complicates the goal of explaining it.

--

___
Python tracker 

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



[issue40408] GenericAlias does not support nested type variables

2020-05-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

While PR 19786 makes the PEG generator working on 3.6, it fails on 3.7. Seems 
there are more dependencies on wrong tokenizer. Please don't forget to fix this.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread STINNER Victor


STINNER Victor  added the comment:

>  Hu, "Lib/test/test_tools/test_c_analyzer/test_parser" has nothing to do 
> with this PR. This looks like Eric Snow's c analyzer for avoiding globals and 
> other stuff for sub interpreters.

Oh sorry. I analyzed dozens of pyflakes warning. When I saw "parser", I 
expected the issue to be new and so introduced by this bpo. Sorry about that ;-)

--

___
Python tracker 

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



[issue40462] [easy] undefined name in Lib/test/mock_socket.py

2020-05-01 Thread miss-islington

miss-islington  added the comment:


New changeset 719e14d2837520c18398a3e22a36f20c1fe76edf by Furkan Önder in 
branch 'master':
bpo-40462: fix variable and function names (GH-19832)
https://github.com/python/cpython/commit/719e14d2837520c18398a3e22a36f20c1fe76edf


--
nosy: +miss-islington

___
Python tracker 

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



[issue40462] [easy] undefined name in Lib/test/mock_socket.py

2020-05-01 Thread Dong-hee Na


Dong-hee Na  added the comment:

@vstinner
IMHO we should create backport patch for 3.8 and 3.7
3.8 and 3.7 has same codes for this.

https://github.com/python/cpython/blob/3.8/Lib/test/mock_socket.py#L95

--
nosy: +corona10

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 76c1b4d5c5a610c09943e1ee7ae18f1957804730 by Batuhan Taskaya in 
branch 'master':
bpo-40334: Improve column offsets for thrown syntax errors by Pegen (GH-19782)
https://github.com/python/cpython/commit/76c1b4d5c5a610c09943e1ee7ae18f1957804730


--

___
Python tracker 

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



[issue40467] subprocess: replacement shell on windows with executable="..." arg

2020-05-01 Thread Anish Athalye


New submission from Anish Athalye :

On Windows, using subprocess.call() and specifying both shell=True and the
executable='...' keyword arguments produces an undesirable result when the
specified shell is a POSIX-like shell rather than the standard cmd.exe.

I think the documentation is unclear on the semantics of Popen() when both
shell=True and executable= are specified on Windows. It does say the following
about POSIX systems:

> If shell=True, on POSIX the executable argument specifies a replacement shell
> for the default /bin/sh.

But the documentation doesn't say anything about Windows in this scenario, so
I'm not sure if this is a bug, or if it's undefined behavior.

Concretely, here's an example program that fails due to this:

import subprocess
bash = 'C:\\Program Files\\Git\\usr\\bin\\bash.exe'
subprocess.call('f() { echo test; }; f', shell=True, executable=bash)

It prints out this mysterious-looking error:

/c: /c: Is a directory

Tracing this into subprocess.py, it looks like it's because the executable bash
(as specified) is being called with the argv that's approximately ['cmd.exe',
'/c', 'f() { echo test; }; f'] (and the program being launched is indeed bash).

Bash doesn't expect a '/c' argument, it wants a '-c' there.

The problematic code in subprocess.py is here:
https://github.com/python/cpython/blob/1def7754b7a41fe57efafaf5eff24cfa15353444/Lib/subprocess.py#L1407
If the '/c' is replaced with a '-c', the example program above works (bash
doesn't seem to care that it's called with an argv[0] that doesn't make sense,
though presumably that should be fixed too).

I'm not sure how this could be fixed. It's unclear when '/c' should be used, as
opposed to '-c'. Doing it based on the contents of the executable= argument or
the SHELL environment variable or COMSPEC might be fragile? I couldn't find
much about this online, but I did find one project (in Ruby) that seems to have
run into a similar problem. See
https://github.com/kimmobrunfeldt/chokidar-cli/issues/15 and
https://github.com/kimmobrunfeldt/chokidar-cli/pull/16.

At the very least, even if this isn't fixed / can't be fixed, it might be nice
if it's possible to give some sort of useful warning/error when this happens --
perhaps say that specifying both shell=True and executable="..." isn't
supported on Windows?

I ran into this issue while while debugging an issue in a project of mine. In
case the additional context is useful, here is the discussion:
https://github.com/anishathalye/dotbot/issues/219

--
components: Library (Lib), Windows
messages: 367844
nosy: anishathalye, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: subprocess: replacement shell on windows with executable="..." arg
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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Seems there are more dependencies on wrong tokenizer. Please don't forget to 
> fix this.

Thanks, Serhiy, will submit a PR soon!

--

___
Python tracker 

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



[issue40468] IDLE split "general" into two tabs

2020-05-01 Thread E. Paine

New submission from E. Paine :

The proposed change to move some of the content in the "General" tab to a new 
tab. The need for this has been emphasised 
As a proof-of-concept, I moved the "Window Preferences" LabelFrame to a new tab 
titled "Window" (and did the minimum required to get the window to show).
The result can be seen in the "general_page.png" & "window_page.png" files.
Looking at the new general page, I felt that the "Editor Preferences" & "Shell 
Preferences" LabelFrames should not expand to fill the newly created space, and 
this should instead be taken up in the "Additional Help Sources" LabelFrame. 
The result can be seen in the “general_page_pady.png” file.
Finally, I felt that we could now reduce the height of the window further by 
decreasing the font page Listbox height to 10 (from 15). The result can be seen 
in “font_page_short.png”, “general_page_short.png” & 
“general_page_pady_short.png”.
As I said originally, this is just a proof-of-concept and we could easily move 
other options into a new tab (such as a “Editor/Shell” tab – though I think 
this is too long for a tab title).

--
assignee: terry.reedy
components: IDLE
messages: 367846
nosy: epaine, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE split "general" into two tabs
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



[issue40468] IDLE split "general" into two tabs

2020-05-01 Thread E. Paine


Change by E. Paine :


Added file: https://bugs.python.org/file49105/font_page_short.png

___
Python tracker 

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



[issue40468] IDLE split "general" into two tabs

2020-05-01 Thread E. Paine


Change by E. Paine :


Added file: https://bugs.python.org/file49106/general_page.png

___
Python tracker 

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



[issue40468] IDLE split "general" into two tabs

2020-05-01 Thread E. Paine


Change by E. Paine :


Added file: https://bugs.python.org/file49107/general_page_pady.png

___
Python tracker 

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



[issue40468] IDLE split "general" into two tabs

2020-05-01 Thread E. Paine


Change by E. Paine :


Added file: https://bugs.python.org/file49108/general_page_pady_short.png

___
Python tracker 

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



[issue40468] IDLE split "general" into two tabs

2020-05-01 Thread E. Paine


Change by E. Paine :


Added file: https://bugs.python.org/file49109/general_page_short.png

___
Python tracker 

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



[issue40468] IDLE split "general" into two tabs

2020-05-01 Thread E. Paine


Change by E. Paine :


Added file: https://bugs.python.org/file49110/window_page.png

___
Python tracker 

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



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

2020-05-01 Thread miss-islington


miss-islington  added the comment:


New changeset 5055c274c6e4f2bb8025910dedf0ff89f4bdd170 by Pablo Galindo in 
branch '3.8':
[3.8] bpo-39562: Prevent collision of future and compiler flags (GH-19230) 
(GH-19835)
https://github.com/python/cpython/commit/5055c274c6e4f2bb8025910dedf0ff89f4bdd170


--

___
Python tracker 

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



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

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



[issue36825] Make TestCase aware of the command line arguments given to TestProgram

2020-05-01 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Bumping this issue as issue 37873 that wants to add a new -j argument to 
unittest got some attention lately.

This PR makes the Test Cases aware of the command line arguments given to 
unittest.main() and is needed to add the --pdb argument proposed in issue 18765 
to run pdb.post_mortem() when an exception occurs during a test.

Both this issue and #18765 would be very useful to augment unittest.

--
nosy: +gregory.p.smith, terry.reedy
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +19155
pull_request: https://github.com/python/cpython/pull/19837

___
Python tracker 

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



[issue40453] Add PyConfig._isolated_interpreter: isolated subinterpreters

2020-05-01 Thread Eric Snow


Change by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue40469] TimedRotatingFileHandler rotating on use not time

2020-05-01 Thread Mark Hallett


New submission from Mark Hallett :

Using the attached confing ymal file, the log file only rolls if the log file 
is not written to for over a minute, logging regulary (eg every 30s)  prevents 
the correct rolling of the log.

--
files: logging_config.ymal
messages: 367849
nosy: markhallett
priority: normal
severity: normal
status: open
title: TimedRotatingFileHandler rotating on use not time
versions: Python 3.8
Added file: https://bugs.python.org/file49111/logging_config.ymal

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset ea7297cf8f1aad4df8921a3d81a75118511afe77 by Pablo Galindo in 
branch 'master':
bpo-40334: unskip test_function_type in test_unparse with the new parser 
(GH-19837)
https://github.com/python/cpython/commit/ea7297cf8f1aad4df8921a3d81a75118511afe77


--

___
Python tracker 

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



[issue40470] Make inspect.signature able to parse format strings.

2020-05-01 Thread Antony Lee


New submission from Antony Lee :

It would be nice if inspect.signature was able to understand bound str.format 
methods, e.g. `inspect.signature("{a} {b}".format) == inspect.signature(lambda 
*args, a, b, **kwargs: None)` (`*args, **kwargs` are there because str.format 
ignores additional arguments).  Right now I believe the only way to parse 
format strings is string.Formatter, which is slightly less discoverable and 
harder to use (although it certainly also provides more info, e.g. 
inspect.signature wouldn't be able to tell about format specifiers, but that's 
fine).

--
messages: 367852
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Make inspect.signature able to parse format strings.
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



[issue40417] PyImport_ReloadModule emits deprecation warning

2020-05-01 Thread Eric Snow


Eric Snow  added the comment:

Yeah, that looks like an oversight.  I've approved your PR.  Thanks!

--
nosy: +eric.snow

___
Python tracker 

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



[issue40417] PyImport_ReloadModule emits deprecation warning

2020-05-01 Thread Eric Snow


Eric Snow  added the comment:

Did you have a need for this to be fixed in 3.8 or earlier?  This seems 
reasonably and simple enough to backport.  I suppose someone could be relying 
on an implicit import of the "imp" module, but that seems highly unlikely and 
suspect anyway. :)

--
nosy: +brett.cannon, ncoghlan

___
Python tracker 

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



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

2020-05-01 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +19156
pull_request: https://github.com/python/cpython/pull/19838

___
Python tracker 

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



[issue40470] Make inspect.signature able to parse format strings.

2020-05-01 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset d955241469c18c946924dba79c18a9ef200391ad by Pablo Galindo in 
branch 'master':
bpo-40334: Correct return value of func_type_comment (GH-19833)
https://github.com/python/cpython/commit/d955241469c18c946924dba79c18a9ef200391ad


--

___
Python tracker 

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



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

2020-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 71e6122b4428ae43e868e34db4f072635f58a555 by Pablo Galindo in 
branch '3.8':
bpo-39562: Correctly updated the version section in the what's new document 
(GH-19838)
https://github.com/python/cpython/commit/71e6122b4428ae43e868e34db4f072635f58a555


--

___
Python tracker 

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



[issue40350] modulefinder chokes on numpy - dereferencing None in spec.loader

2020-05-01 Thread Eric Snow


Change by Eric Snow :


--
stage:  -> test needed
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



[issue40350] modulefinder chokes on numpy - dereferencing None in spec.loader

2020-05-01 Thread Eric Snow


Eric Snow  added the comment:

Ah, namespace packages. :)  Yeah, the code is not taking the "spec.loader is 
None" case into account.  I expect the fix would be to add handling of that 
case a few lines up in the code, right after handling BuiltinImporter and 
FrozenImporter.  Offhand I'm not sure if the "type" should be _PKG_DIRECTORY or 
some new one just for namespace packages.  How does imp.find_module() (on which 
modulefinder._find_module() is based) respond to namespace packages?

[1] 
https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec.loader

--
nosy: +barry, brett.cannon, eric.smith, eric.snow

___
Python tracker 

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



[issue40455] GCC 10 compiler warnings

2020-05-01 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue40455] GCC 10 compiler warnings

2020-05-01 Thread Mark Dickinson


Mark Dickinson  added the comment:

I'm fairly sure that that's a false positive for `longobject.c`. Do you know of 
a non-intrusive way to silence the warning?

--

___
Python tracker 

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



[issue40455] GCC 10 compiler warnings

2020-05-01 Thread Mark Dickinson


Mark Dickinson  added the comment:

As to _why_ it's a false positive: at that point in the code, assuming 30-bit 
limbs and an IEEE 754 binary64 "double", we have (using Python notation for 
floor division)

a_size == 1 + (a_bits - 1) // 30

and

shift_digits == (a_bits - 55) // 30

from which it's clear that

shift_digits <= (a_bits - 1) // 30 < a_size

so a_size - shift_digits is always strictly positive.

The above doesn't depend on the precise values 55 and 30 - any other positive 
values would have worked, so even with 15-bit digits and some other double 
format with fewer bits, we still have "shift_digits < a_size".

And now since the v_rshift call writes "a_size - shift_digits" digits to x, 
we're guaranteed that at least one digit is written, so `x[0]` is not 
uninitialised.

--

___
Python tracker 

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



[issue40390] Implement _xxsubinterpreters.channel_send_wait().

2020-05-01 Thread Eric Snow


Eric Snow  added the comment:

Thanks for working on this, Ben!  FWIW, I've put up a separate PR to 
demonstrate how I was thinking we would solve this:  
https://github.com/python/cpython/pull/19829.

--

___
Python tracker 

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



[issue38880] Subinterpreters: List interpreters associated with a channel end

2020-05-01 Thread Eric Snow


Eric Snow  added the comment:

Thanks again, Lewis!

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



[issue40464] functools.singledispatch doesn't verify annotation is on FIRST parameter

2020-05-01 Thread Vismantas


Change by Vismantas :


--
nosy: +bim_bam

___
Python tracker 

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



[issue40470] Make inspect.signature able to parse format strings.

2020-05-01 Thread Brett Cannon


Change by Brett Cannon :


--
type:  -> enhancement

___
Python tracker 

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



[issue40470] Make inspect.signature able to parse format strings.

2020-05-01 Thread Brett Cannon


Change by Brett Cannon :


--
components: +Library (Lib)

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +19157
pull_request: https://github.com/python/cpython/pull/19839

___
Python tracker 

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



[issue39837] Make Azure Pipelines optional on GitHub PRs

2020-05-01 Thread Brett Cannon


Brett Cannon  added the comment:

> Can't we be more flexible depending on the stability on CIs over the last 
> weeks?

No because I'm tired of flipping CI on and off as mandatory based on the whims 
of CI systems and their stability. Either people need to accept CI is flaky or 
everyone needs to be careful in how they merge PRs by checking failures are 
legit.

And that's why I flipped off Azure Pipelines: I am not changing any more branch 
protections until a full discussion is had somewhere and there's consensus on 
what should be mandatory and stay mandatory for several months barring 
emergencies.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 3941d9700b2a272689cb8a8435b5c60a1466ef79 by Guido van Rossum in 
branch 'master':
bpo-40334: Refactor lambda_parameters similar to parameters (GH-19830)
https://github.com/python/cpython/commit/3941d9700b2a272689cb8a8435b5c60a1466ef79


--

___
Python tracker 

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



[issue40417] PyImport_ReloadModule emits deprecation warning

2020-05-01 Thread Robert Rouhani


Robert Rouhani  added the comment:

We have a fairly straightforward workaround of using the "warnings" module
to redirect to stdout, so we personally don't have a need.

Unreal, however, follows the VFX Reference Platform (
https://vfxplatform.com/) which is migrating from 2.7 to 3.7.x this year.
They will likely run into this during their migration, so backporting to
3.7 would be useful.

On Fri, May 1, 2020 at 8:22 AM Eric Snow  wrote:

>
> Eric Snow  added the comment:
>
> Did you have a need for this to be fixed in 3.8 or earlier?  This seems
> reasonably and simple enough to backport.  I suppose someone could be
> relying on an implicit import of the "imp" module, but that seems highly
> unlikely and suspect anyway. :)
>
> --
> nosy: +brett.cannon, ncoghlan
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40455] GCC 10 compiler warnings

2020-05-01 Thread Dong-hee Na


Dong-hee Na  added the comment:

@mark.dickinson @vstinner

I'd like to suggest this change.
There was no performance impact on my local machine.

--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -2852,7 +2852,8 @@ _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e)
 {
 Py_ssize_t a_size, a_bits, shift_digits, shift_bits, x_size;
 /* See below for why x_digits is always large enough. */
-digit rem, x_digits[2 + (DBL_MANT_DIG + 1) / PyLong_SHIFT];
+digit rem;
+digit x_digits[2 + (DBL_MANT_DIG + 1) / PyLong_SHIFT] = {0,};
 double dx;
 /* Correction term for round-half-to-even rounding.  For a digit x,
"x + half_even_correction[x & 7]" gives x rounded to the nearest
@@ -2903,8 +2904,6 @@ _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e)
 shift_digits = (DBL_MANT_DIG + 2 - a_bits) / PyLong_SHIFT;
 shift_bits = (DBL_MANT_DIG + 2 - a_bits) % PyLong_SHIFT;
 x_size = 0;
-while (x_size < shift_digits)
-x_digits[x_size++] = 0;
 rem = v_lshift(x_digits + x_size, a->ob_digit, a_size,
(int)shift_bits);
 x_size += a_size;

--
nosy: +corona10

___
Python tracker 

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



[issue40434] Update of reasoning why there is no case statement

2020-05-01 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

> PEP 275 actually links to PEP 3103 to explain why it is rejected

Well, am not very convinced if consensus was reached on range tests so I will 
refrain for someone else's opinion as it is not as apparent to me yet.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 03b7642265e65f198682f22648dbe6cf4fff9835 by Lysandros Nikolaou in 
branch 'master':
bpo-40334: Make the PyPegen* and PyParser* APIs more consistent (GH-19839)
https://github.com/python/cpython/commit/03b7642265e65f198682f22648dbe6cf4fff9835


--

___
Python tracker 

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



[issue39691] Allow passing Pathlike objects to io.open_code

2020-05-01 Thread Steve Dower


Steve Dower  added the comment:


New changeset 831d58d7865cb98fa09227dc614f4f3ce6af968b by Shantanu in branch 
'master':
bpo-39691: Clarify io.open_code behavior (GH-19824)
https://github.com/python/cpython/commit/831d58d7865cb98fa09227dc614f4f3ce6af968b


--

___
Python tracker 

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



[issue39691] Allow passing Pathlike objects to io.open_code

2020-05-01 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +19158
pull_request: https://github.com/python/cpython/pull/19840

___
Python tracker 

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



[issue39691] Allow passing Pathlike objects to io.open_code

2020-05-01 Thread miss-islington


miss-islington  added the comment:


New changeset c9d7d32b6dc6140f7fcbf1ae1120df6d59fc28d0 by Miss Islington (bot) 
in branch '3.8':
bpo-39691: Clarify io.open_code behavior (GH-19824)
https://github.com/python/cpython/commit/c9d7d32b6dc6140f7fcbf1ae1120df6d59fc28d0


--

___
Python tracker 

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



[issue40412] inittab_copy not set to NULL after free, can lead to crashes when running multiple interpreters in a single process

2020-05-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19159
pull_request: https://github.com/python/cpython/pull/19841

___
Python tracker 

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



[issue40412] inittab_copy not set to NULL after free, can lead to crashes when running multiple interpreters in a single process

2020-05-01 Thread miss-islington


miss-islington  added the comment:


New changeset 64224a4727321a8dd33e6f769edda401193ebef0 by Gregory Szorc in 
branch 'master':
bpo-40412: Nullify inittab_copy during finalization (GH-19746)
https://github.com/python/cpython/commit/64224a4727321a8dd33e6f769edda401193ebef0


--
nosy: +miss-islington

___
Python tracker 

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



[issue40412] inittab_copy not set to NULL after free, can lead to crashes when running multiple interpreters in a single process

2020-05-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19160
pull_request: https://github.com/python/cpython/pull/19842

___
Python tracker 

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



[issue40468] IDLE split "general" into two tabs

2020-05-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

'Windows', not 'Window'.

The indentation width should be moved to the Window page after being converted 
and reduced to a single line with a spinbox or maybe just an entry box.

Indent spaces (standard 4) [ 4] # or
Convert tab indents to [4] spaces (standard 4)

I cannot imagine that anyone would ever want more than 8, certainly not 16.  
Note that there is another issue that will result in no longer using tabs 
instead of spaces in Shell, so that this will really be for both (all, 
including Output).

There is at least one issue where this has been discussed, with the thought 
that something that most people should and will never change is now way too 
prominent.  (My python development system with my list of issues is now being 
repaired.  There has also been discussion about converting size to a spinbox.  
There is no particular reason for the particular presets.)

The problem with General is that the items left other than Help are specific to 
either editor or shell.  I think General with general window preferences and 
Help followed by Shell/Ed specifics might be a better division.

--

___
Python tracker 

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



[issue5996] abstract class instantiable when subclassing built-in types

2020-05-01 Thread Jim Fasarakis-Hilliard


Change by Jim Fasarakis-Hilliard :


--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue40471] Grammar typo in issubclass docstring

2020-05-01 Thread alexpovel


New submission from alexpovel :

Running `python -c "help(issubclass)"` will output:

  > Help on built-in function issubclass in module builtins:
  > 
  > issubclass(cls, class_or_tuple, /)
  > Return whether 'cls' is a derived from another class or is the same 
class.
  > 
  > A tuple, as in ``issubclass(x, (A, B, ...))``, may be given as the 
target to
  > check against. This is equivalent to ``issubclass(x, A) or 
issubclass(x, B)
  > or ...`` etc.

where it should probably read:

> Return whether 'cls' is derived from another class or is the same class.

over the current:

> Return whether 'cls' is a derived from another class or is the same class.

There are two occurrences of this string, one in `./Python/bltinmodule.c`, the 
other in `./Python/clinic/bltinmodule.c.h`.
I have to admit I cannot safely say which of these is the generated file 
through Argument Clinic and which is the source.
Is `./Python/bltinmodule.c` the source, aka where this would need to be changed?

Please let me know and I will create a PR.

Thanks!

--
assignee: docs@python
components: Documentation
messages: 367871
nosy: alexpovel, docs@python
priority: normal
severity: normal
status: open
title: Grammar typo in issubclass docstring
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



[issue39691] Allow passing Pathlike objects to io.open_code

2020-05-01 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue18765] unittest needs a way to launch pdb.post_mortem or other debug hooks

2020-05-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I would be more interested in being able to launch IDLE's visual debugger 
(likely after some revision) so I would want the hook to be general (as 
suggested by the current title) and not limited to only pdb.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue18765] unittest needs a way to launch pdb.post_mortem or other debug hooks

2020-05-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

See #36825 about making TextCase argument aware.

--

___
Python tracker 

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



[issue36825] Make TestCase aware of the command line arguments given to TestProgram

2020-05-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Since test modules can already be run in parallel, #37873 does not seem 
relevant here.  (And I agree with the intent of that.)

I would be reluctant to add a mechanism with no current use, so I would not 
apply absent a decision to add one.

--
nosy: +ezio.melotti, michael.foord, rbcollins

___
Python tracker 

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



[issue40472] IDLE Shell not allowing more than two line inputs

2020-05-01 Thread Raymond Hettinger


New submission from Raymond Hettinger :

In Python3.8 and prior, you can type this in a shell session


Python 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
>>> def square(x):
s = x ** 2
return s


In Python3.9, the input is terminated prematurely
-

Python 3.9.0a6 (v3.9.0a6:bc1c8af8ef, Apr 27 2020, 17:05:28) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
>>> def square(x):
s = x ** 2 # <-- On first return, the statement evaluates

>>> 

>>> square(5)
25

--
assignee: terry.reedy
components: IDLE
messages: 367875
nosy: rhettinger, terry.reedy
priority: high
severity: normal
status: open
title: IDLE Shell not allowing more than two line inputs
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



[issue18319] gettext() cannot find translations with plural forms

2020-05-01 Thread Gilles Bassière

Change by Gilles Bassière :


--
nosy: +Gilles Bassière
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



[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-05-01 Thread miss-islington


miss-islington  added the comment:


New changeset 289842ae820f99908d3a345f1f3b6d4e5b4b97fc by Shantanu in branch 
'master':
bpo-39435: Fix docs for pickle.loads (GH-18160)
https://github.com/python/cpython/commit/289842ae820f99908d3a345f1f3b6d4e5b4b97fc


--
nosy: +miss-islington

___
Python tracker 

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



[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-05-01 Thread Antoine Pitrou


Change by Antoine Pitrou :


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

___
Python tracker 

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



[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-05-01 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
pull_requests: +19162
pull_request: https://github.com/python/cpython/pull/19844

___
Python tracker 

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



[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-05-01 Thread miss-islington


miss-islington  added the comment:


New changeset 3859b1ac1d7014f8ff673962d94a01a408546e24 by Antoine Pitrou in 
branch '3.7':
[3.7] bpo-39435: Fix docs for pickle.loads (GH-18160). (GH-19844)
https://github.com/python/cpython/commit/3859b1ac1d7014f8ff673962d94a01a408546e24


--

___
Python tracker 

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



[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-05-01 Thread miss-islington


miss-islington  added the comment:


New changeset e05828055e5165cc7268ea3bea33adc502e054a1 by Antoine Pitrou in 
branch '3.8':
[3.8] bpo-39435: Fix docs for pickle.loads (GH-18160) (GH-19843)
https://github.com/python/cpython/commit/e05828055e5165cc7268ea3bea33adc502e054a1


--

___
Python tracker 

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



[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-05-01 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue40440] allow array.array construction from memoryview w/o copy

2020-05-01 Thread Davin Potts


Davin Potts  added the comment:

Being able to create an array.array without making a copy of a memoryview's 
contents does sound valuable.  We do not always want to modify the size of the 
array, as evidenced by array.array's existing functionality where its 
size-changing manipulations (like append) are suppressed when exporting a 
buffer.  So I think it is okay to not require a copy be made when constructing 
an array.array in this way.

Serhiy's example is a good one for demonstrating how different parts of an 
array.array can be treated as having different types as far as getting and 
setting items.  I have met a number of hardware groups in mostly larger 
companies that use array.array to expose raw data being read directly from 
devices.  They wastefully make copies of their often large array.array objects, 
each with a distinct type code, so that they can make use of array.array's 
index() and count() and other functions, which are not available on a 
memoryview.

Within the core of Python (that is, including the standard library but 
excluding 3rd party packages), we have a healthy number of examples of objects 
that expose a buffer via the Buffer Protocol but they lack the symmetry of 
going the other way to enable creation from an existing buffer.  My sense is it 
would be a welcome thing to see something like array.array, that is designed to 
work with low-level data types, support creation from an existing buffer 
without the need for a copy -- this is the explicit purpose of the Buffer 
Protocol after all but array.array only supports export, not creation, which 
currently makes array.array feel inconsistent.

--
nosy: +davin

___
Python tracker 

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



[issue40458] test_attribute_name_interning crashes on APPX test

2020-05-01 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue40458] test_attribute_name_interning crashes on APPX test

2020-05-01 Thread Steve Dower


Steve Dower  added the comment:

Turns out the stack reservation was different, which is why it was crashing.

As part of diagnosing it, I added the recursion count to faulthandler's output 
on Windows, but couldn't see if/where to do it for other platforms - Victor, 
any suggestions?

--
nosy: +vstinner
type:  -> crash

___
Python tracker 

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



[issue40471] Grammar typo in issubclass docstring

2020-05-01 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Alex, thanks for reporting this. A PR will be needed to fix those indeed.

Regarding argument clinic, the file you will need to change is 
Python/bltinmodule.c and you can run `make regen-all` to regenerate the other 
file. There is more information about this in the Python dev guide: 
https://devguide.python.org/

For the Pull Request to be accepted you will need to sign the Contributor 
License Agreement, the steps to follow are here: 
https://devguide.python.org/pullrequest/#cla, a bot will reemind you if you 
forget :)

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue40458] test_bad_getattr crashes on APPX test

2020-05-01 Thread Steve Dower


Steve Dower  added the comment:

Also, it was really test_bad_getattr that was crashing.

--
title: test_attribute_name_interning crashes on APPX test -> test_bad_getattr 
crashes on APPX test

___
Python tracker 

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



[issue40471] Grammar typo in issubclass docstring

2020-05-01 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue40440] allow array.array construction from memoryview w/o copy

2020-05-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> My sense is it would be a welcome thing to see something like array.array, 
> that is designed to work with low-level data types, support creation from an 
> existing buffer without the need for a copy

It is called memoryview.

--

___
Python tracker 

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



[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-05-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +19164
pull_request: https://github.com/python/cpython/pull/19846

___
Python tracker 

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



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-05-01 Thread Miro Hrončok

Miro Hrončok  added the comment:

Thanks for the explanation.

I plan to send a PR to add this to the What's new in 3.9 page early next week. 
Anyone, feel free to beat me to it.

--

___
Python tracker 

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



[issue40382] Make 'rt' the default for open in docs

2020-05-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The inconsistency might be a residue of the transition from 2.x.  But the 'r' 
versus 'rt' confusion originates in the code and signature.   The text 't' 
default is built into the code, while the read 'r' default is in the 'mode=r' 
part of the signature.

If text 't' were only a signature default, from 'mode=rt', then changing 
'read-text' to 'something_else-text' would require including the 't', as in 
'wt', etc.  But it is not.  On the other hand, passing mode as 'b' or using 
'mode=b' is a ValueError because one of 'r', 'w', or 'a', optionally followed 
by '+', is required.

I think the doc entry for open might stand a change to make this a bit clearer, 
but I don't have a specific proposal yet.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue40471] Grammar typo in issubclass docstring

2020-05-01 Thread alexpovel


Change by alexpovel :


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

___
Python tracker 

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



[issue40471] Grammar typo in issubclass docstring

2020-05-01 Thread alexpovel

alexpovel  added the comment:

Hi Rémi,

thank you very much for the hearty welcome.

Your explanations worked perfectly and the PR was created. `make regen-all` 
created new checksums as well, as intended.

I had already signed the CLA, and will now dive into the devguide!

Thanks again.

--

___
Python tracker 

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



[issue40393] Auto-response from Python Help points to Python 2 reference

2020-05-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thank you for noticing. As of this moment, http://www.python.org/about/help/ 
has 3 links to the https://github.com/python/pydotorg/issue repository and 
issue tracker, which contains the website.  Website issues (as opposed to 
docs.python.org) should be reported there.

As it happens, the page has been updated.  "First check the Python FAQs, with 
answers to many common, general Python questions." links to the url you 
suggest.  'FAQ' at the bottom of the page has a shorter link that also goes to 
the /3/ version.

--
nosy: +terry.reedy
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



  1   2   >