[issue40897] Inheriting from Generic causes inspect.signature to always return (*args, **kwargs) for constructor (and all subclasses)

2020-06-06 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue40594] urljoin since 3.5 incorrectly filters out double slashes

2020-06-06 Thread Ned Deily


Change by Ned Deily :


--
nosy: +orsenthil

___
Python tracker 

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



[issue40893] tkinter integrate TkDND support

2020-06-06 Thread Ned Deily


Change by Ned Deily :


--
nosy: +gpolo, serhiy.storchaka

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-06-06 Thread hai shi


Change by hai shi :


--
pull_requests: +19903
pull_request: https://github.com/python/cpython/pull/20689

___
Python tracker 

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



[issue40861] On Windows, liblzma is always built without optimization

2020-06-06 Thread Ma Lin


Ma Lin  added the comment:

Good catch.

You can submit a PR to fix this. If you start from zero and do it slowly, it 
will take about a week or two.

--
components: +Windows -Build
nosy: +Ma Lin, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue17506] Improve IDLE news handling

2020-06-06 Thread Ned Deily


Ned Deily  added the comment:

A suggestion: rather than trying to maintain a separate IDLE news file ("don't 
repeat yourself), it might be much easier to link to the IDLE section in each 
releases's formatted CHANGELOG now included in Python 3 docsets.  For example:

https://docs.python.org/3/whatsnew/changelog.html#idle
or
https://docs.python.org/3.8/whatsnew/changelog.html#idle

Yes, users would have to scroll down to each release's IDLE section but I 
suspect that wouldn't be a huge burden considering how infrequently change 
files are consulted.  To be even more useful, IDLE could first attempt to find 
the changelog in the Python installer's bundled copy of the docset like the F1 
key does.  For example, with the macOS installer, the corresponding file URL is:

file:///Library/Frameworks/Python.framework/Versions/3.8/Resources/English.lproj/Documentation/whatsnew/changelog.html#idle

--
nosy: +ned.deily

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-06 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue40743] [CMake] It's 2020, where is CMake?

2020-06-06 Thread Ned Deily


Ned Deily  added the comment:

Thanks for your suggestion but changing build systems is a *huge* undertaking 
for cPython thanks to the many different platforms that we have added support 
to over the years and the many, many customizations that have been made.  cmake 
would certainly be one option; starting from scratch with modern autotools 
another. And there are many such others. But this is way beyond the scope of a 
standard feature enhancement. In fact, there have been some discussions around 
the PSF funding one or more persons to reimplement our Unix-y build system 
(note there is a separate build system for Windows platforms). As Christian 
suggests, one concrete step towards getting a new build system would be to 
write a detailed PEP and then discussing in the ideas and/or core-workflow 
groups; another would be to help secure funding.  But without first steps like 
that, there won't be anything served by further discussions here. So I'm 
closing this issue. It could be re-opened in the future once there is consen
 sus on an approach and implementation resources are identified.

--
nosy: +ned.deily
resolution:  -> postponed
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



[issue40897] Inheriting from Generic causes inspect.signature to always return (*args, **kwargs) for constructor (and all subclasses)

2020-06-06 Thread Edward Yang


New submission from Edward Yang :

Consider the following program:

```
import inspect
from typing import Generic, TypeVar

T = TypeVar('T')

class A(Generic[T]):
def __init__(self) -> None:
pass

print(inspect.signature(A))
```

I expect inspect.signature to return () as the signature of the constructor of 
this function. However, I get this:

```
$ python3 foo.py
(*args, **kwds)
```

Although it is true that one cannot generally rely on inspect.signature to 
always give the most accurate signature (because there may always be decorator 
or metaclass shenanigans getting in the way), in this particular case it seems 
especially undesirable because Python type annotations are supposed to be 
erased at runtime, and yet here inheriting from Generic (simply to add type 
annotations) causes a very clear change in runtime behavior.

--
components: Library (Lib)
messages: 370870
nosy: ezyang
priority: normal
severity: normal
status: open
title: Inheriting from Generic causes inspect.signature to always return 
(*args, **kwargs) for constructor (and all subclasses)
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



[issue40879] Strange regex cycle

2020-06-06 Thread Tim Peters


Tim Peters  added the comment:

Closing this as "Won't Fix", since the possibility of exponential-time behavior 
with naively written nested quantifiers is well known, and there are no plans 
to "do something" about that.

--
resolution:  -> wont fix
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



[issue40894] asyncio.gather() cancelled() always False

2020-06-06 Thread Kyle Stanley


Kyle Stanley  added the comment:

> So, we can't rely on checking ``self.done() and self._cancel_requested`` for 
> future.cancelled() as this would mean that future.cancelled() would return 
> true for a future that fully completed if `future.cancel()` was called after 
> it finished (which is incorrect).

This should be "was called *as* it finished", not "was called *after* it was 
finished". If gather_future.cancel() is called after the future is `FINISHED`, 
it will immediately return false since it checks `self.done()` first 
(https://github.com/python/cpython/blob/b8f67c0923ac85468dfbfd43375e0bbfb6ca50ea/Lib/asyncio/tasks.py#L727).

--

___
Python tracker 

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



[issue40894] asyncio.gather() cancelled() always False

2020-06-06 Thread Kyle Stanley


Kyle Stanley  added the comment:

> Specifically a future can't be cancelled once it reaches the PENDING state, 
> this is indicated when future.cancel() returns false; see 
> https://github.com/python/cpython/blob/0e96c419d7287c3c7f155c9f2de3c61020386256/Lib/asyncio/futures.py#L152
>  for the source code

Actually, I was mistaken in my previous message; sorry about that. It can 
*only* be cancelled when the state is PENDING. So, I suspect there's a race 
condition where the state is `PENDING` when future.cancel() is called, but 
transitions to `FINISHED` before the future is actually cancelled. I'll insert 
some logging in `future.cancel()` to verify this locally.

The approach in PR-20686 has a fundamental problem though: simply because 
cancellation was requested does not mean the future was cancelled. So, we can't 
rely on checking ``self.done() and self._cancel_requested`` for 
future.cancelled() as this would mean that future.cancelled() would return true 
for a future that fully completed if `future.cancel()` was called after it 
finished (which is incorrect).

I'll have to do some further investigation to determine the cause and a 
potential fix of the race condition. Thanks again for reporting it, and my 
apologies for the earlier mixup.

--

___
Python tracker 

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



[issue40743] [CMake] It's 2020, where is CMake?

2020-06-06 Thread TheUltimatePineapple

TheUltimatePineapple  added the comment:

For me CPython has caused a lot of pain without having CMake.

I have to manually compile CPython on each OS I want to support, having to fix 
the quirks on each build system and I have keep the built linkable blobs in my 
project which increases the repo size.

It seems though the people here are so old-fashioned they don't see the point 
in CMake ¯\_(ツ)_/¯

I don't think I can keep CPython adopted in my engine if it keeps being this 
way, I'll have to look into alternate scripting languages which don't rely on 
antiquated build systems.

--

___
Python tracker 

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



[issue40864] spec_set/autospec/spec seems to not be reading attributes defined in class body

2020-06-06 Thread Evan Fagerberg


Evan Fagerberg  added the comment:

Rereading the documentation, I see that a class attribute set to null will 
return a MagicMock for that attribute. That might be a reasonable workaround. 
Perhaps the more concrete solution would be that dir lists uninitialized class 
attributes and if a type hint is present the class attributes uses a spec of 
that type hint.

--

___
Python tracker 

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



[issue31213] __context__ reset to None in nested exception

2020-06-06 Thread Chris Jerdonek


Change by Chris Jerdonek :


--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue40894] asyncio.gather() cancelled() always False

2020-06-06 Thread Kyle Stanley


Kyle Stanley  added the comment:

Thank you for the bug report Timm.

While I can certainly understand the source of the confusion here, I think you 
may be misunderstanding an important part of cancellation for futures. 
Specifically a future can't be cancelled once it reaches the PENDING state, 
this is indicated when future.cancel() returns false; see 
https://github.com/python/cpython/blob/0e96c419d7287c3c7f155c9f2de3c61020386256/Lib/asyncio/futures.py#L152
 for the source code. In your example code snippet, you can also see this if 
you replace the line:

```
future_gather.cancel()
```
with the following:
```
if not future_gather.cancel():
logger.info("future_gather could not be cancelled")
```

Also, to clarify on something else:
> However, my understanding is that asyncio.gather() is scheduled for 
> deprecation, so maybe changes in this area are on halt anyways!?

asyncio.gather() is not deprecated or scheduled for deprecation, it is simply 
the loop argument being deprecated.

--
nosy: +aeros

___
Python tracker 

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



[issue40896] Missing links to Source Code in Documentation pages

2020-06-06 Thread Edison Abahurire


New submission from Edison Abahurire :

Just below the Module heading, most library documenation pages like 
https://docs.python.org/3/library/datetime.html have a link to the source code 
in the form of `Source code: Lib/datetime.py` that links to the cpython github 
file of that module.

Some modules like https://docs.python.org/3/library/time.html are missing this 
though and yet I think it would be quite useful for people who want to navigate 
the depths of the implementation.

Now, the challenge is that most modules are not located in single code files 
but what if, instead of leaving it blank, we link to the folder that contains 
the code of that module? Wouldn't that be helpful?

For example:
For https://docs.python.org/3/library/wsgiref.html, we can add this 
https://github.com/python/cpython/tree/master/Lib/wsgiref as the link to source 
code.

--
assignee: docs@python
components: Documentation
messages: 370863
nosy: docs@python, edison.abahurire, eric.araujo, ezio.melotti, mdk, willingc
priority: normal
severity: normal
status: open
title: Missing links to Source Code in Documentation pages
type: enhancement

___
Python tracker 

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



[issue31254] WeakKeyDictionary/Mapping doesn't call __missing__

2020-06-06 Thread Nathaniel Smith


Change by Nathaniel Smith :


--
pull_requests:  -19900

___
Python tracker 

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



[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2020-06-06 Thread Daniel Fortunov


Change by Daniel Fortunov :


--
nosy: +dfortunov
nosy_count: 15.0 -> 16.0
pull_requests: +19902
pull_request: https://github.com/python/cpython/pull/20687

___
Python tracker 

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



[issue40895] weakref documentation contains cautions about dictionary mutation problems that have been solved in the implementation

2020-06-06 Thread Daniel Fortunov


Change by Daniel Fortunov :


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

___
Python tracker 

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



[issue31254] WeakKeyDictionary/Mapping doesn't call __missing__

2020-06-06 Thread Daniel Fortunov


Change by Daniel Fortunov :


--
keywords: +patch
nosy: +dfortunov
nosy_count: 4.0 -> 5.0
pull_requests: +19900
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20687

___
Python tracker 

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



[issue27603] Migrate IDLE context menu items to shell extension

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee: terry.reedy -> 

___
Python tracker 

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



[issue17506] Improve IDLE news handling

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Separate news items are now consolidated during the release process.  But two 
issue with copying them.  1. They are not line wrapped, whereas news.txt is.  
2. I don't always make (or keep) entries identical.

--
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue22010] Idle: better management of Shell window output

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

1 is a another issue.  2. was partly taken care of by squeezer.
3 is needed.  SyntaxError is often best handled by editing.
4 is still needed.  Tab replacement will happen with a sidebar.

--
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue40895] weakref documentation contains cautions about dictionary mutation problems that have been solved in the implementation

2020-06-06 Thread Daniel Fortunov


New submission from Daniel Fortunov :

The doccumentation at https://docs.python.org/3.10/library/weakref.html 
cautions that the WeakKeyDictionary and WeakValueDictionary are susceptible to 
the problem of dictionary mutation during iteration.

These notes present the user with a problem that has no easy solution.

I dug into the implementation and found that fortunately, Antoine Pitrou 
already addressed this challenge (10 years ago!) by introducing an 
_IterationGuard context manager to the implementation, which delays mutation 
while an iteration is in progress.

I asked for confirmation and Antoine agreed that these notes could be removed:
https://github.com/python/cpython/commit/c1baa601e2b558deb690edfdf334fceee3b03327#commitcomment-39514438

--
assignee: docs@python
components: Documentation
messages: 370860
nosy: dfortunov, docs@python
priority: normal
severity: normal
status: open
title: weakref documentation contains cautions about dictionary mutation 
problems that have been solved in the implementation
versions: Python 3.10

___
Python tracker 

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



[issue22209] Idle: add better access to extension information

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Open on macOS Mohave now has an All files * filter option, and opening *.def is 
easy.  If not true on every Mac still getting new versions of Python, too bad.

--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue18330] Fix idlelib.PyShell.build_subprocess_arglist use of __import__

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

In #36429, the 'else' branch that did not work was deleted.

The reason __import__ is discouraged is the reason for the repetition of 'run', 
in the line kept, as explained above.  However, since the line works, it is not 
a bug, and I now prefer to leave it alone.  If someone disables it, IDLE will 
not start.

del_exitf was added for Visual IDLE -- VIDLE (sp?)  Investigating whether it is 
still needed and possible deleting it is another issue.  So is deprecating 
starting with PyShell, or having pyshell as main running tests in a development 
setting.

--
resolution:  -> not a bug
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue40894] asyncio.gather() cancelled() always False

2020-06-06 Thread Timm Wagener


Change by Timm Wagener :


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

___
Python tracker 

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



[issue24996] IDLE: debugger local/global vars should not be editable

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue25031] IDLE - file list improvements

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy:  -kbk, roger.serwy
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue25036] IDLE - infrastructure changes so editors don't assume they're in a toplevel

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy:  -kbk, roger.serwy
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue18444] IDLE: Revise Mac OS X key bindings.

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Serhiy add IDLE Modern Unix a couple of years ago.  Something similar is still 
needed for macOS.

--
title: IDLE: Mac OS X pressing ctrl-A in Python shell moved cursor before the 
prompt, which then makes the keyboard unresponsive. -> IDLE: Revise Mac OS X 
key bindings.
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue18064] IDLE: add current directory to open_module

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue6171] IDLE - TreeWidget draw and double-click (Ubuntu)

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> works for me
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



[issue30666] IDLE: add tests for autocomplete window.

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue30667] IDLE: revise doc subsection 'Completions'

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue27922] Make IDLE tests less flashy

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

After doing away with most of the flashes, we started adding tests using key 
and mouse event_generate, which seemed to require a visible GUI.  So the goal 
seems a lost cause.  If I revisit, a new issue.

--
status: open -> closed

___
Python tracker 

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



[issue40894] asyncio.gather() cancelled() always False

2020-06-06 Thread Timm Wagener


New submission from Timm Wagener :

It seems like the future subclass returned by asyncio.gather() 
(_GatheringFuture) can never return True for future.cancelled() even after it's 
cancel() has been invoked successfully (returning True) and an await on it 
actually raised a CancelledError. This is in contrast to the behavior of normal 
Futures and it seems generally to be classified as a minor bug by developers.

* Stackoverflow Post: 
https://stackoverflow.com/questions/61942306/asyncio-gather-task-cancelled-is-false-after-task-cancel
* Github snippet: 
https://gist.github.com/timmwagener/dfed038dc2081c8b5a770e175ba3756b

I have created a fix and will create a PR. It seemed rather easy to fix and the 
asyncio test suite still succeeds. So maybe this is a minor bug, whose fix has 
no backward-compatibility consequences. However, my understanding is that 
asyncio.gather() is scheduled for deprecation, so maybe changes in this area 
are on halt anyways!?



# excerpt from snippet
async def main():
"""Cancel a gather() future and child and return it."""

task_child = ensure_future(sleep(1.0))
future_gather = gather(task_child)

future_gather.cancel()
try:
await future_gather
except CancelledError:
pass

return future_gather, task_child


# run
future_gather, task_child = run(main())

# log gather state
logger.info(future_gather.cancelled())  # False / UNEXPECTED / ASSUMED BUG
logger.info(future_gather.done())  # True
logger.info(future_gather.exception())  # CancelledError
logger.info(future_gather._state)  # FINISHED

# log child state
logger.info(task_child.cancelled())  # True
logger.info(task_child.done())  # True
# logger.info(task_child.exception())  Raises because _state is CANCELLED
logger.info(task_child._state)  # CANCELLED

--
components: asyncio
messages: 370855
nosy: asvetlov, timmwagener, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.gather() cancelled() always False
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2020-06-06 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.10, Python 3.9 -Python 2.7

___
Python tracker 

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



[issue29382] IDLE search and replace should use 'hit' tag instead of 'hilite'

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue27603] Migrate IDLE context menu items to shell extension

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee:  -> terry.reedy
components: +Installation

___
Python tracker 

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



[issue27892] Idlelib: document or move delayed imports

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue27603] Migrate IDLE context menu items to shell extension

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Steve, is this out of date or still something that could be done in the code we 
control?  Would you review and possibly merge a patch is submitted? (I don't 
know what 'shell extension' means.)

--
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue40882] memory leak in multiprocessing.shared_memory.SharedMemory in Windows

2020-06-06 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 5.0 -> 6.0
pull_requests: +19897
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20684

___
Python tracker 

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



[issue35019] Allow ipaddres.IPv4/v6Address in asyncio.create_server

2020-06-06 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Issue 38952 is a duplicate of this.

--
message_count: 4.0 -> 5.0
nosy: +remi.lapeyre
nosy_count: 4.0 -> 5.0
pull_requests: +19896
versions: +Python 3.10, Python 3.9
pull_request: https://github.com/python/cpython/pull/17434

___
Python tracker 

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



[issue40830] Certain uses of dictionary unpacking raise TypeError

2020-06-06 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue40893] tkinter integrate TkDND support

2020-06-06 Thread E. Paine

New submission from E. Paine :

For years, the Python docs for the tkinter.dnd module (and prior Tkdnd module) 
have said that it will become deprecated once it has been replaced by TkDND 
bindings (I can find it back in the Python 2.2 docs – 
https://docs.python.org/2.2/lib/node508.html). Despite this, I cannot find 
anywhere that the changes are actually proposed (have I missed something?!).

Attached is a git diff of a draft of proposed changes for the tkinter library, 
tkinter docs and Windows installer. The changes to the tkinter library are 
designed so that TkDND is not required where tcl/tk is installed, and in 
particular I check before any call is made to the library that it has been 
successfully loaded so as to give the user a more helpful error message.

I don’t feel it is ready to be a PR yet, unless that would be helpful, as I 
have not been able to extensively test on MacOS (I think I have sufficiently 
tested on Windows and Linux, though someone is bound to find a problem!). I 
also don’t feel it is ready for a PR because I would really appreciate if 
someone could take a serious look at the changes to the installer. I have got 
it working but I don’t really understand how the installer works and it is 
quite likely that the TkDND externals should have their own group and bindpath.

On a similar note to the Windows installer, how do we declare to the Linux 
package maintainers that TkDND is now an optional dependency of Python? I 
cannot find a file where optional dependencies are mentioned, so is there some 
mechanism to notify them of the changes?

I want to give credit where it is due and so it should be noted that new docs 
are very nearly just a “translation” of the TkDND man page and that the changes 
in the tkinter library are (loosely) based on the TkinterDND bindings.

I also have the relevant files for the cpython-source-deps and cpython-bin-deps 
repos, but would need someone with write permissions to create a ‘tkdnd’ branch 
in each of those repos before I create the PRs for them.

I am very new to contributing and so have a few questions on what is expected 
of me:
1. What is required of a news entry, and where would it go (I am assuming 
Misc\NEWS.d\next\Library)?
2. Could such a change, though not particularly large for code, be considered a 
“major new feature” (which would require a PEP)?

If people don’t generally want to add TkDND bindings to the tkinter library, I 
would instead propose that we remove the note that the tkinter.dnd module will 
be deprecated (but leave the note about it being experimental).

--
components: Tkinter
files: tkdnd.diff
keywords: patch
messages: 370852
nosy: epaine
priority: normal
severity: normal
status: open
title: tkinter integrate TkDND support
type: enhancement
versions: Python 3.10
Added file: https://bugs.python.org/file49217/tkdnd.diff

___
Python tracker 

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



[issue40741] Upgrade to SQLite v3.32.1 in Windows and macOS builds

2020-06-06 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

SQLite 3.32.2 is out: https://www.sqlite.org/releaselog/3_32_2.html

>From the changelog:
Fix a long-standing bug in the byte-code engine that can cause a COMMIT command 
report as success when in fact it failed to commit. Ticket 810dc8038872e212

I've created a PR for cpython-source-deps.

--

___
Python tracker 

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



[issue21140] Idle: saving Shell or an OutputWindow should default to .txt

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

There was a recent stackoverflow question in which newbie pulled shell log into 
editor and ran as is.  Got SyntaxError as 'Python 3' start of startup message.

--
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue27769] IDLE: Replace All up, no wrap replaces one up, all down

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue40724] Support buffer protocol with type specs

2020-06-06 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset f7c4e236429606e1c982cacf24e10fc86ef4462f by scoder in branch 
'master':
bpo-40724: Support setting buffer slots from type specs (GH-20648)
https://github.com/python/cpython/commit/f7c4e236429606e1c982cacf24e10fc86ef4462f


--

___
Python tracker 

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



[issue40724] Support buffer protocol with type specs

2020-06-06 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +19895
pull_request: https://github.com/python/cpython/pull/20683

___
Python tracker 

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



[issue27732] IDLE tests should be quiet

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue17238] IDLE: Add import statement completion

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I opened #40892 for using rlcomplete suffixes.
I should look as #25419 for patch and messages for import ideas.

--

___
Python tracker 

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



[issue40314] python code order of magnitude faster than equivalent CPython code for simple import statement

2020-06-06 Thread Zachary Ware


Zachary Ware  added the comment:

I've finally had a chance to try to reproduce this myself, and did.  However, a 
subsequent run of `test.exe` showed exactly the same timing as the Python test, 
and even another attempt after removing and re-installing tensorflow showed 
comparable timing to the Python version.  Can you reproduce the slow timing on 
multiple runs?

--

___
Python tracker 

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



[issue27609] IDLE completions: format, factor, and fix

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

40892 Use prefixes from rlcompleter.  Compute constant once.

--
dependencies: +IDLE: use rlcompleter suffixed for completions
versions: +Python 3.10 -Python 3.6, 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



[issue40892] IDLE: use rlcompleter suffixed for completions

2020-06-06 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Tab completions may be suffixed with ' ' (keywords), ':' (keywords)*, or '(' 
(callables) if one of those is required.  Ex. 'import ', 'finally:', 'len('.  
Attributes may get '('.  The possible downside is needing to remove the suffix 
if one does not want the completion for what it is but as a prefix to a longer 
word.  Ex. 'imports','elsewhere', 'length'.  But this should be much less 
common in code.

* 'else ' should be 'else:'

With keywords added (#37765) tab list is sorted(Completer().global_match('') + 
list(__main__.dict__.keys())).  Whatever decide on, calculate first part once 
(if not already).  list.sort used preexisting order.  key are sorted.  builtins 
might be.

--
messages: 370845
nosy: terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: use rlcompleter suffixed for completions

___
Python tracker 

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



[issue34858] MappingProxy objects should JSON serialize just like a dictionary

2020-06-06 Thread Bob Ippolito


Bob Ippolito  added the comment:

I would certainly reconsider it at this point, I think a bona fide ABC 
*specific to JSON encoding* would be a good way to do it. simplejson has two 
ways to do this, the `for_json` parameter which will use a `for_json()` method 
on any object as the JSON representation if present, and the 
`namedtuple_as_object` parameter which will do the same for objects with an 
`_asdict()` method. As part of the standard library it might make more sense to 
rename `for_json()` to `__json__()` or similar.

It is a bit unfortunate that you can't guarantee round-trip on deserialization, 
but that has always been the case. To get round-tripping (without tagging 
everything that has been encoded in some way like pickle does), you really 
should be working with a schema of some kind.

--

___
Python tracker 

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



[issue40891] Use pep573 in functools

2020-06-06 Thread hai shi


New submission from hai shi :

petr have write a PR(adding a method: _PyType_GetModuleByDef) to supply pep573 
in 
https://github.com/encukou/cpython/pull/4/commits/98dd889575cf7d1688495983ba791e14894a0bb8

So I try to use pep573 in functools again in: 
https://github.com/shihai1991/cpython/pull/5

>From the CI gate result, the only one question is a resource leak in 
>functools(I am not find the leak reason now): 
>https://github.com/shihai1991/cpython/pull/5/checks?check_run_id=743098116

some other discuss info in issue40137.

--
components: Extension Modules
messages: 370843
nosy: petr.viktorin, shihai1991, vstinner
priority: normal
severity: normal
status: open
title: Use pep573 in functools
versions: Python 3.10

___
Python tracker 

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



[issue27733] Test that self.bell is called in IDLE classes when intended.

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue7949] IDLE: avoid no-contrast popups and dialogs.

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The IDLE Dark theme has been added and I use it routinely.  Ttk widgets, 
including frames, are AFAIK used everywhere possible.  We are not yet using ttk 
styles to configurable colors, but I would expect that the default style should 
always be viewable.  My speculation is that this should prevent white-on-white 
or black-on-black.

Mathias and Sureyya, do you see today the unusable combinations you say 10 and 
7 years ago?

Cheryl, are any of the issues described above possible on Ubuntu (today)?

--
nosy: +cheryl.sabella
title: IDLE: problems with dark GTK or KDE color schemes -> IDLE: avoid 
no-contrast popups and dialogs.
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue40870] Custom AST can crash Python (debug build)

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



[issue40890] Dict views should be introspectable

2020-06-06 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Dict views wrap an underlying mapping but don't expose that mapping as an 
attribute.

Traditionally, we do expose wrapped objects:  property() exposes fget,  
partial() exposes func, bound methods expose __func__, ChainMap() exposes maps, 
etc.

Exposing this attribute would help with introspection, making it possible to 
write efficient functions that operate on dict views.

--
components: Interpreter Core
keywords: easy (C)
messages: 370841
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Dict views should be introspectable
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue39791] New `files()` api from importlib_resources.

2020-06-06 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

See GH-20681 for a proposed fix. I've scheduled the build bots to run the 
patch. Will build bots prove the fix? If not, can you test the patch in the 
same environment where it was discovered?

--

___
Python tracker 

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



[issue40889] Symmetric difference on dict_views is inefficient

2020-06-06 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Running "d1.items() ^ d2.items()" will rehash every key and value in both 
dictionaries regardless of how much they overlap.

By taking advantage of the known hashes, the analysis step could avoid making 
any calls to __hash__().  Only the result tuples would need to hashed.

Currently the code below calls hash for every key and value on the left and for 
every key and value on the right:

  >>> left = {1: -1, 2: -2, 3: -3, 4: -4, 5: -5, 6: -6, 7: -7}
  >>> right = {1: -1, 2: -2, 3: -3, 4: -4, 5: -5, 8: -8, 9: -9}
  >>> left.items() ^ right.items()# Total work: 28 __hash__() calls
  {(6, -6), (7, -7), (8, -8), (9, -9)}

Compare that with the workload for set symmetric difference which makes zero 
calls to __hash__():

  >>> set(left) ^ set(right)
  {6, 7, 8, 9}

FWIW, I do have an important use case where this matters.

--
components: Interpreter Core
messages: 370839
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Symmetric difference on dict_views is inefficient
type: performance
versions: Python 3.10

___
Python tracker 

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



[issue39791] New `files()` api from importlib_resources.

2020-06-06 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +19894
pull_request: https://github.com/python/cpython/pull/20681

___
Python tracker 

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



[issue16123] IDLE - deprecate running without a subprocess

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Deprecation has been done and a message is printed under the splash screen.  
With 5 more years of maintenance experience under deprecation, I have not 
experienced -n mode as a maintenance burden.  So I have no inclination at 
present to remove it (or even implement any of the ideas above).

Deprecation usually means 'no maintenance'.  For idlelib, that means no new 
tests specifically for -n mode (and there never were any).  I don't do manual 
tests either. (More patches and more testing in regular mode is more important 
to me.)  It is possible that some feature has been disabled in that mode, but 
there are no such reports and I have not encountered anything in my occasional 
experiments in that mode.  (Such as when someone claim that something only 
worked with -n.)

I have occasionally touched blocks with 'if subprocess ... else ...' but it has 
not been hard to leave the else part alone.

A year or so ago, I added a 'Startup failure' section to the IDLE doc.  It list 
multiple possible causes and things to try. -n is irrelevant to most of them.  
If someone knows of another current issue, open a new tracker issue.

--
dependencies:  -Idle: use pipes instead of sockets to talk with user subprocess
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue40870] Custom AST can crash Python (debug build)

2020-06-06 Thread miss-islington


miss-islington  added the comment:


New changeset 83a9ba442662c2a030b45955f3dd24ff4b24bb61 by Miss Islington (bot) 
in branch '3.8':
bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)
https://github.com/python/cpython/commit/83a9ba442662c2a030b45955f3dd24ff4b24bb61


--

___
Python tracker 

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



[issue40870] Custom AST can crash Python (debug build)

2020-06-06 Thread miss-islington


miss-islington  added the comment:


New changeset 90ee51f1cd9e63cfe0f402392612f50fc1bea747 by Miss Islington (bot) 
in branch '3.9':
bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)
https://github.com/python/cpython/commit/90ee51f1cd9e63cfe0f402392612f50fc1bea747


--

___
Python tracker 

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



[issue39791] New `files()` api from importlib_resources.

2020-06-06 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Thanks for the report Michael. I'm trying to figure out the best way to address 
the issue. That test is shared with importlib_metadata, so needs to run without 
CPython's test suite fixtures, such as the ones that generate non-ascii 
filenames. I'm tempted to just attempt to create the fixture and skip if the 
fixture fails. An alternate approach might be to attempt to load CPython's 
fixture, skip if that value is None, and fallback to the snowman otherwise.

--

___
Python tracker 

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



[issue40888] Add close method to queue

2020-06-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

You should probably bring this up on the python-ideas mailing list.

--
nosy: +eric.smith
type:  -> enhancement
versions: +Python 3.10

___
Python tracker 

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



[issue18823] Idle: use pipes instead of sockets to talk with user subprocess

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Problems with multiprocessing and tkinter on Mac might have been due to using 
the default start method, which used to be fork and is now spawn.  This should 
be retested sometime.

--
nosy:  -kbk, roger.serwy
versions: +Python 3.10 -Python 3.8

___
Python tracker 

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



[issue24781] Improve UX of IDLE Highlighting configuration tab

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue25146] IDLE debugger could better visualize program execution

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue25352] Add 'make this my default python' to windows installs for Python3.5 and later

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The py launcher now prefered since at least a year ago.  I believe the 
installer has the requested box.  Hovering over taskbar icons pops up the 
version, and I think they now survive upgrades. (And none of these are idlelib 
issues.)

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



[issue34858] MappingProxy objects should JSON serialize just like a dictionary

2020-06-06 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

+1 for reconsidering whether the json module should support mappings that don't 
inherit for dict.  The decision not to support general mappings is ancient and 
predates a lot of modern tooling.

The only worry is that the objects won't round-trip — you could store a 
ChainMap but you wouldn't get a ChainMap back :-(

--

___
Python tracker 

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



[issue1528593] Printing: No print dialog or page setup

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue21152] Idle: timed autosave for shell (and maybe editor) window

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue27965] Automatic .py extension when saving with IDLE on OSX

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> IDLE does not supply a default ext of .py on Windows or OS X 
for new file saves

___
Python tracker 

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



[issue24826] ability to integrate editor, shell, debugger in one window

2020-06-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue1350] IDLE - CallTips enhancement - show full doc-string in new window

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I am not sure what to do with this.  The addition of squeezer to Shell and 
ability to expand into textview makes this a bit less needed.  It would have to 
be rewritten.  It seems big, but a large part is revision of tests, which have 
since been moved to unittests in separate test files.

--
nosy:  -Saimadhav.Heblikar, gpolo, kbk, markroseman
priority: normal -> low
versions: +Python 3.10 -Python 3.5

___
Python tracker 

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



[issue34858] MappingProxy objects should JSON serialize just like a dictionary

2020-06-06 Thread Nathaniel Manista


Nathaniel Manista  added the comment:

Err, "... it's something that complicates writing code according to...", sorry.

--

___
Python tracker 

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



[issue34858] MappingProxy objects should JSON serialize just like a dictionary

2020-06-06 Thread Nathaniel Manista


Nathaniel Manista  added the comment:

There's a great deal more additional discussion about this over at 
https://discuss.python.org/t/json-does-not-support-mapping-and-mutablemapping/2829,
 but I would like to heartily "hear hear" this issue for the way it is weird 
that

json.dumps(frozendict.frozendict({'3':5}))

does not evaluate to the string "{'3': 5}" and it's something that makes 
writing according to and teaching others to code according to the 
make-your-code-safer-by-using-immutability-in-all-possible-things principle.

--
nosy: +Nathaniel Manista

___
Python tracker 

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



[issue5150] IDLE: add rstrip to Format menu

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Adding rstrip as it was then was done over a decade ago, and this issue was 
closed then.  Improvements, as discussed immediately above have been added with 
other issues, or will be.  I am rejecting the add-on idea of incorporating 
reindent.py as unneeded.  (It should have been a new issue instead of 
re-opening this one.)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: IDLE to support reindent.py -> IDLE: add rstrip to Format menu

___
Python tracker 

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



[issue39791] New `files()` api from importlib_resources.

2020-06-06 Thread Michael Felt

Michael Felt  added the comment:

The 'fancy' file name breaks on latin-1 character set.

aixtools@gcc119:[/home/aixtools/python/py39-3.9] 
a4fa9a95153a3800dea60b3029b2dcaf8a4f6acb Lib/test/test_importlib/test_main.py   
<
diff --git a/Lib/test/test_importlib/test_main.py 
b/Lib/test/test_importlib/test_main.py
index 42a7999..7b18c3d 100644
--- a/Lib/test/test_importlib/test_main.py
+++ b/Lib/test/test_importlib/test_main.py
@@ -246,3 +246,19 @@ class TestEntryPoints(unittest.TestCase):
 """
 with self.assertRaises(Exception):
 json.dumps(self.ep)
+
+def test_module(self):
+assert self.ep.module == 'value'
+
+def test_attr(self):
+assert self.ep.attr is None
+
+
+class FileSystem(fixtures.OnSysPath, fixtures.SiteDir, unittest.TestCase):
+def test_unicode_dir_on_sys_path(self):
+"""
+Ensure a Unicode subdirectory of a directory on sys.path
+does not crash.
+"""
+fixtures.build_files({'☃': {}}, prefix=self.site_dir)
+list(distributions())

AIX bots fail with:

Captured traceback
==

Traceback (most recent call last):
  File 
"/home/shager/cpython-buildarea/3.9.edelsohn-aix-ppc64/build/Lib/test/test_importlib/test_main.py",
 line 263, in test_unicode_dir_on_sys_path
fixtures.build_files({'\u2603': {}}, prefix=self.site_dir)
  File 
"/home/shager/cpython-buildarea/3.9.edelsohn-aix-ppc64/build/Lib/test/test_importlib/fixtures.py",
 line 202, in build_files
full_name.mkdir()
  File 
"/home/shager/cpython-buildarea/3.9.edelsohn-aix-ppc64/build/Lib/pathlib.py", 
line 1309, in mkdir
self._accessor.mkdir(self, mode)
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2603' in position 
17: ordinal not in range(256)



Test report
===

Failed tests:

- test_importlib

--
nosy: +Michael.Felt

___
Python tracker 

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



[issue33689] Blank lines in .pth file cause a duplicate sys.path entry

2020-06-06 Thread Ido Michael


Ido Michael  added the comment:

Created a PR: GH-20679 

I did see some of the changes are already in the code for example, 
test_underpth_nosite_file.test_sity.py already had pth_lines filter out: ''.

I think it's because this issue relevant only for 3.6?
Or maybe this issue was solved already and this bug report is redundant

--

___
Python tracker 

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



[issue40830] Certain uses of dictionary unpacking raise TypeError

2020-06-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On Windows: works in installed 3.8.3, fails in 3.9.0b1. Works in freshly 
compiled 3.9 and master.  The patch seems to have worked.  Mark, is there any 
reason to not close this as fixed?

--
nosy: +terry.reedy
stage: patch review -> 

___
Python tracker 

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



[issue33689] Blank lines in .pth file cause a duplicate sys.path entry

2020-06-06 Thread Ido Michael


Change by Ido Michael :


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

___
Python tracker 

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



[issue40065] py39: remove deprecation note for xml.etree.cElementTree

2020-06-06 Thread Ido Michael


Ido Michael  added the comment:

Tal, is there a decision to this debate or can I just move the dep. warning?

--
nosy: +Ido Michael, taleinat

___
Python tracker 

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



[issue40594] urljoin since 3.5 incorrectly filters out double slashes

2020-06-06 Thread Ido Michael


Ido Michael  added the comment:

I can take this

--
nosy: +Ido Michael, taleinat

___
Python tracker 

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



[issue33689] Blank lines in .pth file cause a duplicate sys.path entry

2020-06-06 Thread Ido Michael


Change by Ido Michael :


--
nosy: +taleinat

___
Python tracker 

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



[issue40643] Improve doc-strings for datetime.strftime & strptime

2020-06-06 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 3.0 -> 4.0
pull_requests: +19892
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20677

___
Python tracker 

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



[issue40870] Custom AST can crash Python (debug build)

2020-06-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19890
pull_request: https://github.com/python/cpython/pull/20675

___
Python tracker 

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



[issue40885] Cannot pipe GzipFile into subprocess

2020-06-06 Thread Nehal Patel


Nehal Patel  added the comment:

In my use case, I was actually trying to stream a large gzip file from the 
cloud directly into subprocess without spilling onto disk or RAM i.e. the code 
actually  looked something more like:

r, w = os.pipe()
# ... launch a thread to feed r
with gzip.open(os.fdopen(w, 'rb')) as gz:
res = subprocess.run("myexe", stdin=gz, capture_output=True)
## fyi, expected output is tiny
 
(In my case, I could modify the executable to expect compressed input, so I 
chose that solution.  Another possibility would have been to use 
subprocess.POpen twice, once with  'gzcat' and second with 'myexe')

I agree that given how libgz works, it would be difficult to fix the  problem.  
I would suggest finding a way to alert the user about this issue because it 
will in general be a very confusing situation when this happens.

--

___
Python tracker 

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



[issue40870] Custom AST can crash Python (debug build)

2020-06-06 Thread miss-islington


miss-islington  added the comment:


New changeset 68874a8502da440a1dc4746cf73262648b870aee by Batuhan Taskaya in 
branch 'master':
bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)
https://github.com/python/cpython/commit/68874a8502da440a1dc4746cf73262648b870aee


--
nosy: +miss-islington

___
Python tracker 

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



[issue40870] Custom AST can crash Python (debug build)

2020-06-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19891
pull_request: https://github.com/python/cpython/pull/20676

___
Python tracker 

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



[issue40888] Add close method to queue

2020-06-06 Thread Андрей Казанцев

New submission from Андрей Казанцев :

I have a problem with notifying all current subscribers and new subscribers 
about the closure of the queue and the reason. For example, I have a producer 
that reads messages from websocket or something else and send this to a queue, 
and several consumers (I do not know how many). If any exception occurred, then 
all current subscribers and subscribers which will be added later should know 
about this error. I tried to send an exception to a queue, but that did not 
help, because I have several consumers. Also, this will not protect new 
consumers. I propose to add a new close method with exc argument, which will 
throw an exception when calling the get method, and also throw an exception for 
all current _getters.

--
components: asyncio
messages: 370818
nosy: asvetlov, heckad, yselivanov
priority: normal
severity: normal
status: open
title: Add close method to queue

___
Python tracker 

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



[issue40816] Add missed AsyncContextDecorator to contextlib

2020-06-06 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

No, please look at the pull request.

--

___
Python tracker 

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



[issue40614] ast.parse doesn't respect feature_version for debug f-strings

2020-06-06 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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



[issue40614] ast.parse doesn't respect feature_version for debug f-strings

2020-06-06 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset f7ed4d4e83f5d9e85e244a1cbc460f26436ab24d by Shantanu in branch 
'3.8':
bpo-40614: Respect feature version for f-string debug expressions (GH-20196) 
(GH-20466)
https://github.com/python/cpython/commit/f7ed4d4e83f5d9e85e244a1cbc460f26436ab24d


--

___
Python tracker 

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



  1   2   >