[issue41433] Logging libraries BufferingHandler flushed twice at shutdown

2020-07-28 Thread Tatsunosuke Shimada


New submission from Tatsunosuke Shimada :

BufferingHandler

I expected function flush of BufferingHandler called once but it is called 
twice. 
This is due to that shutdown calls flush before close function which calls 
flush function inside.
(Faced this issue on my custom implementation of flush function.)

Seems that there is no need of calling flush inside BufferingHandler.

Following is the link to the code of function shutdown and Buffering Handler
https://github.com/python/cpython/blob/0124f2b5e0f88ee7f5d40fca96dbf087cbe4764b/Lib/logging/handlers.py#L1286
https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Lib/logging/__init__.py#L2151

This issue could be also related.
https://bugs.python.org/issue26559

--
components: Library (Lib)
messages: 374559
nosy: adamist521, vinay.sajip
priority: normal
severity: normal
status: open
title: Logging libraries BufferingHandler flushed twice at shutdown
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2020-07-28 Thread Peixing Xin


Change by Peixing Xin :


--
pull_requests: +20820
pull_request: https://github.com/python/cpython/pull/21675

___
Python tracker 

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



[issue41431] Optimize dict_merge for copy

2020-07-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka, yselivanov

___
Python tracker 

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



[issue41432] IDLE: Handle bad highlight tab color config

2020-07-28 Thread Terry J. Reedy


New submission from Terry J. Reedy :

https://stackoverflow.com/questions/35397377/python-freezes-when-configuring-idle
 froze IDLE with a custom theme missing 'colours for the blinker and 
highlighting'.  I reported some experiments there.  Tracebacks might help, but

Proposal 1: check theme before try to paint.  All keys present?  Replace 
missing with normal colors.


https://stackoverflow.com/questions/63137659/idle-crashing-when-i-press-configure-idle
 froze IDLE with a custom theme with a bad color "#00224".

 File "C:\Users\...\idlelib\configdialog.py", line 1279, in paint_theme_sample
self.highlight_sample.tag_config(element, **colors)
...
_tkinter.TclError: invalid color name "#00224"

Proposal 2: wrap line in try-except, if error text matches, extract bad color, 
replace any occurrence of bad color with "#00" (black) or "#FF" 
(white), report to user with suggestion to edit.  Maybe save first.  Should do 
within loop in case more errors.

--
assignee: terry.reedy
components: IDLE
messages: 374558
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Handle bad highlight tab color config
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



[issue41427] howto/descriptor.rst incorrectly mentions method.__class__

2020-07-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the PR.

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



[issue41431] Optimize dict_merge for copy

2020-07-28 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue41431] Optimize dict_merge for copy

2020-07-28 Thread Inada Naoki


Inada Naoki  added the comment:

PyDict_Copy() is not used in eval loop or calling functions. So removing 
clone_combined_dict() is a considerable option.

Another option is to use clone_combined_dict() in dict_merge, instead of adding 
dict_copy2().

Pros: No performance regression. PyDict_Copy() is as fast as before.
Cons: Can not "fast copy" split dict and dirty dict.

I suppose most dict used by `dict(d)` or `dict.update(d)` is clean and 
combined. So I will implement the second option.

--

___
Python tracker 

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



[issue41428] PEP 604 -- Allow writing union types as X | Y

2020-07-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue41431] Optimize dict_merge for copy

2020-07-28 Thread Inada Naoki


Inada Naoki  added the comment:

To reduce code size, I am considering to remove clone_combined_dict. I will 
check how PyDict_Copy() is performance critical.

This is microbenchmark result of d.copy() and dict(d).

$ ./python -m pyperf timeit --compare-to ./python-master -s 
'd=dict.fromkeys(range(1000))' -- 'd.copy()'
python-master: . 4.36 us +- 0.07 us
python: . 5.96 us +- 0.10 us

Mean +- std dev: [python-master] 4.36 us +- 0.07 us -> [python] 5.96 us +- 0.10 
us: 1.37x slower (+37%)

$ ./python -m pyperf timeit --compare-to ./python-master -s 
'd=dict.fromkeys(range(1000))' -- 'dict(d)'
python-master: . 21.6 us +- 0.2 us
python: . 6.01 us +- 0.09 us

Mean +- std dev: [python-master] 21.6 us +- 0.2 us -> [python] 6.01 us +- 0.09 
us: 3.59x faster (-72%)

--

___
Python tracker 

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



[issue41427] howto/descriptor.rst incorrectly mentions method.__class__

2020-07-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20818
pull_request: https://github.com/python/cpython/pull/21668

___
Python tracker 

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



[issue41427] howto/descriptor.rst incorrectly mentions method.__class__

2020-07-28 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +20817
pull_request: https://github.com/python/cpython/pull/21667

___
Python tracker 

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



[issue41430] Document C docstring behavior

2020-07-28 Thread James Corbett


Change by James Corbett :


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

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-07-28 Thread miss-islington


miss-islington  added the comment:


New changeset 7cfede6859586f77f786bda56af4698ae2245f56 by Miss Islington (bot) 
in branch '3.8':
closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH-21569)
https://github.com/python/cpython/commit/7cfede6859586f77f786bda56af4698ae2245f56


--

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-07-28 Thread miss-islington


miss-islington  added the comment:


New changeset 22216107f2890e7ee2ab055e4983b76ff9c62169 by Miss Islington (bot) 
in branch '3.9':
closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH-21569)
https://github.com/python/cpython/commit/22216107f2890e7ee2ab055e4983b76ff9c62169


--

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-07-28 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +20814
pull_request: https://github.com/python/cpython/pull/21670

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-07-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20815
pull_request: https://github.com/python/cpython/pull/21671

___
Python tracker 

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



[issue38156] input fucntion raises SystemError after specific input.

2020-07-28 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset a74eea238f5baba15797e2e8b570d153bc8690a7 by Benjamin Peterson in 
branch 'master':
closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH-21569)
https://github.com/python/cpython/commit/a74eea238f5baba15797e2e8b570d153bc8690a7


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



[issue41431] Optimize dict_merge for copy

2020-07-28 Thread Inada Naoki


Inada Naoki  added the comment:

Microbenchmark for commit cf4f61ce50e07f7ccd3aef991647050c8da058f9.

# timeit -s 'd=dict.fromkeys(range(8))' -- 'dict(d)'
Mean +- std dev: [master] 311 ns +- 2 ns -> [patched] 144 ns +- 1 ns: 2.16x 
faster (-54%)

# timeit -s 'd=dict.fromkeys(range(1000))' -- 'dict(d)'
Mean +- std dev: [master] 21.6 us +- 0.2 us -> [patched] 7.67 us +- 0.09 us: 
2.81x faster (-64%)

# timeit -s 'd=dict.fromkeys(range(8))' -- '{}.update(d)'
Mean +- std dev: [master] 301 ns +- 5 ns -> [patched] 149 ns +- 1 ns: 2.01x 
faster (-50%)

# timeit -s 'd=dict.fromkeys(range(1000))' -- '{}.update(d)'
Mean +- std dev: [master] 21.4 us +- 0.2 us -> [patched] 7.64 us +- 0.07 us: 
2.80x faster (-64%)

--
stage: patch review -> 

___
Python tracker 

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



[issue41431] Optimize dict_merge for copy

2020-07-28 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue41431] Optimize dict_merge for copy

2020-07-28 Thread Inada Naoki


New submission from Inada Naoki :

Although there are dict.copy() and PyDict_Copy(), dict_merge can be used for 
copying dict.

* d={}; d.update(orig)
* d=dict(orig)
* d=orig.copy() # orig has many dummy keys.

--
components: Interpreter Core
messages: 374550
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Optimize dict_merge for copy
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



[issue41416] Restore default implementation of __ne__ in mixins Set and Mapping

2020-07-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

If you want to add back the __ne__() method, that would be fine.

FWIW, "class A(collections.abc.Set, int)" seems pretty exotic to me.  I 
wouldn't have expected that work out well.

--

___
Python tracker 

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



[issue41416] Restore default implementation of __ne__ in mixins Set and Mapping

2020-07-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
Removed message: https://bugs.python.org/msg374497

___
Python tracker 

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



[issue41427] howto/descriptor.rst incorrectly mentions method.__class__

2020-07-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
title: howto/descriptor.rst unnecessarily mentions method.__class__ -> 
howto/descriptor.rst incorrectly mentions method.__class__

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-07-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't feel a need to change anything, my post hit a few seconds after yours 
:-) 

That said, "return u ** (-1.0 / alpha)" would be a slight, but nice improvement.

It might also be reasonable to document a safe range of alpha values.

--

___
Python tracker 

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



[issue41430] Document C docstring behavior

2020-07-28 Thread James Corbett


New submission from James Corbett :

As described in 
https://stackoverflow.com/questions/25847035/what-are-signature-and-text-signature-used-for-in-python-3-4,
 https://bugs.python.org/issue20586, and 
https://stackoverflow.com/questions/50537407/add-a-signature-with-annotations-to-extension-methods,
  it is possible to embed a signature in docstrings for C functions, so that 
`help` and `inspect.signature` work properly on them. However, this 
functionality isn't documented anywhere. I think something should be added to 
the "extending and embedding the Python interpreter" tutorial.

--
assignee: docs@python
components: Documentation
messages: 374547
nosy: docs@python, jameshcorbett
priority: normal
severity: normal
status: open
title: Document C docstring behavior
type: enhancement

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-07-28 Thread Tim Peters


Tim Peters  added the comment:

BTW, if we have to "do something", how about changing

return 1.0 / u ** (1.0/alpha)

to the mathematically equivalent

return (1.0 / u) ** (1.0/alpha)

? Not sure about Linux-y boxes, but on Windows that would raise OverflowError 
instead of ZeroDivisionError. Which makes more sense, because the Pareto 
variable we're _trying_ to produce is too large to represent.  If it returns 
math.inf on some box instead, same thing.

Or, also faster, and suffering fewer rounding errors,

return  u ** (-1.0 / alpha)

--

___
Python tracker 

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



[issue41420] Academic Free License v. 2.1 link is not found and is obsolete

2020-07-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

I also found what looks like a copy of AFL 2.1 on Python's own wiki:

https://wiki.python.org/moin/PythonSoftwareFoundationLicenseFaq/AFL-2.1

(Of course, being a wiki, this has the disadvantage of being publicly editable. 
:-)

Yet another option presents itself: do away with the AFL 2.1 and just require 
Apache 2.0. See https://en.wikipedia.org/wiki/License_proliferation for more on 
this.

--

___
Python tracker 

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



[issue41420] Academic Free License v. 2.1 link is not found and is obsolete

2020-07-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

A few options present themselves:

- We could switch to AFL 3.0 (https://opensource.org/licenses/AFL-3.0). This 
will require some review by our lawyer.

- We could link to another copy of AFL 2.1. Honestly the original one seems 
pretty odd.

- We could link to the archive.org copy of AFL 2.1.

But looking at archive.org I find this copy:

https://web.archive.org/web/20170827133353/https://www.samurajdata.se/opensource/mirror/licenses/afl-2.1.php

which has the following text, in red, at the top:

Larry Rosen has ceased to use or recommend any version of the Academic Free 
License below version 2.1

(Note that Larry Rosen is the AFL's author.)

So maybe the first option, get a legal opinion on switching to AFL 3.0, is our 
best recourse.

--

___
Python tracker 

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



[issue41427] howto/descriptor.rst unnecessarily mentions method.__class__

2020-07-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The origin of the error was an incorrect update from Python 2 semantics where 
the class was exposed as an attribute:

Python 2.7.17 (v2.7.17:c2f86d86e6, Oct 19 2019, 16:24:34) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
>>> class A:
def f(self, x):
return x

>>> a = A()
>>> bm = a.f
>>> bm.im_class

>>> bm.im_self
<__main__.A instance at 0x103a204b0>
>>> bm.im_func


--

___
Python tracker 

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



[issue41429] Let fnmatch.filter accept a tuple of patterns

2020-07-28 Thread Andrés Delfino

Change by Andrés Delfino :


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

___
Python tracker 

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



[issue41046] unittest: make skipTest a classmethod

2020-07-28 Thread James Corbett


James Corbett  added the comment:

I was careless in my example, it would need to be `cls.skipTest(reason)`. 
However, that really doesn't have anything to do with why it should be a 
`classmethod` instead of an instance method: it's so that you can call 
`skipTest` from `classmethods`, namely `setUpClass` which is called by the 
`unittest` framework. You can currently call `skipTest` from `setUpClass` only 
with something ugly like `cls.skipTest(None, reason)` (i.e. passing `None` for 
the `self` parameter, which works because `self` isn't used).

--

___
Python tracker 

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



[issue41427] howto/descriptor.rst unnecessarily mentions method.__class__

2020-07-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Good catch.  Thanks for the report.

--

___
Python tracker 

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



[issue41429] Let fnmatch.filter accept a tuple of patterns

2020-07-28 Thread Andrés Delfino

New submission from Andrés Delfino :

I propose to let fnmatch.filter accept a tuple of patterns as its pat 
parameter, while still supporting a single string argument (just like 
str.endswith does).

The code to do this manually and efficiently pretty much involves copying 
filter.

--
components: Library (Lib)
messages: 374540
nosy: adelfino
priority: normal
severity: normal
status: open
title: Let fnmatch.filter accept a tuple of patterns
type: enhancement

___
Python tracker 

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



[issue41427] howto/descriptor.rst unnecessarily mentions method.__class__

2020-07-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-07-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The point of the "u = 1.0 - self.random()" line was to prevent the case where 
*u* was exactly equal to zero; however, as you noted, raising a very small 
number to a small can round down to zero.

We could wrap the calculation in a try/except to catch the ZeroDivisionError 
but that is probably insufficient.  The codomain can easily spew beyond the 
range of a C double:

   >>> alpha = 0.01
   >>> u = 0.005
   >>> 1.0 / u ** (1.0 / alpha)
   1.2676506002282268e+230 <== Huge!

We could clamp the values as is done in gammavariate().  Or we can raise a 
clean Overflow or Underflow exception but that would be unpleasant for users if 
it were to arise unexpectedly.

--

___
Python tracker 

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



[issue41413] IDLE: exit at input() prompt is not complete

2020-07-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

More specifically, why the change results the same box twice on Mac but not on 
Windows.  The previous double-save issue, worst on Mac, was #35379.

--
nosy: +taleinat

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-07-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
type:  -> behavior
versions: +Python 3.10, Python 3.9 -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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-07-28 Thread Tim Peters


Tim Peters  added the comment:

I'm inclined to ignore this. No actual user has complained about this, and I 
doubt any ever will:  it's got to be rare as hen's teeth to use a parameter 
outside of, say, [0.1, 10.0], in real life. The division error can't happen for 
those. For "small" alpha, the distribution simply does contain values too large 
to represent as binary doubles. So the only other defensible thing to do be 
done in this case is to return math.inf (or raise OverflowError) - but why slow 
it down for something no actual user cares about?

--

___
Python tracker 

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



[issue35379] IDLE's close fails io is set to None on Mac

2020-07-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#41413 exposed another double save on Mac issue.

--

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-07-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +tim.peters

___
Python tracker 

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



[issue41428] PEP 604 -- Allow writing union types as X | Y

2020-07-28 Thread Maggie Moss


New submission from Maggie Moss :

https://www.python.org/dev/peps/pep-0604/

--
messages: 374535
nosy: maggiemoss
priority: normal
pull_requests: 20811
severity: normal
status: open
title: PEP 604 -- Allow writing union types as X | Y
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



[issue41413] IDLE: exit at input() prompt is not complete

2020-07-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

IRv, please, please, snip the message you respond to when replying by email 
instead of with a browser.

I am guessing that you or someone installed python as root/admin and you are 
working as non-root. 

I will try to figure out why the change results in the 'running' box appearing 
twice instead of just once, and if a fix is possible that does not make this 
happen.  But I have noticed on other close issues that close is at least 
sometimes called more than once.  The shutdown system has multiple patches and 
is delicate to change, and not unittested, which would be non-trivial.  The 
peculiarily of this issue is that it is the initial idle process left running 
rather than the secondary user code execution process.

--

___
Python tracker 

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



[issue41380] Add snake example to turtledemo

2020-07-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue41418] GH-21658: Add snake game to tools/demo!

2020-07-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This is a duplicate of the original issue, #41380, except that it proposes to 
put the new file where it does not belong and will be useless, instead of in 
turtledemo.

--
assignee:  -> terry.reedy
nosy: +terry.reedy
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed
superseder:  -> Add snake example to turtledemo

___
Python tracker 

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



[issue41413] IDLE: exit at input() prompt is not complete

2020-07-28 Thread Irv Kalb


Irv Kalb  added the comment:

I have tried the test that Terry outlined (from double clicking on the IDLE 
icon), and I can confirm that I get the exact same results.  In the menu bar, I 
see just the Apple icon and "IDLE".  The items in the IDLE menu work (About 
IDLE and Preferences).  At that point, I have to force quit.

I found the pyshell.py file and the line that you suggested changing.  I can 
make the change but when I go to save, I get a permissions error and cannot 
save the file.

Irv

> On Jul 27, 2020, at 7:44 PM, Terry J. Reedy  wrote:
> 
> 
> Terry J. Reedy  added the comment:
> 
> Simpler test.
> 
> Open IDLE Shell (only) from icon or (preferably) terminal.
 input()
>   # Close IDLE without giving input with Window (X), File => exit, or 
> Control/Command-Q.
> Click OK in "Your program is still running" box (from PyShell)
> 
> On Windows, IDLE closes apparently cleanly, but Task Manager shows that (at 
> least usually) the IDLE process moves from Apps to Background processes, with 
> label 'Python x.y.z Shell', where it remains as an inaccessible 20 mb zombie 
> until [End Task]ed.  This is not normal.
> 
> On macOS Mohave, the Shell window and IDLE part of the top menubar disappear, 
> but the Apple part remains with the apple and program name entry ("IDLE" or 
> "Python" depending on whether started from icon or Terminal).  I presume this 
> is the equivalent of Python becoming a background process, except that Apple 
> keeps a visible link to it.  If I start IDLE in Terminal with trailing &, 
> there are initially two processes, and the first remains along with the Apple 
> menu.
> 
> Under the IDLE/Python menu item, About and Preferences still bring up the 
> corresponding dialogs, which worked as far as I tested.  This confirms that 
> the IDLE process is still alive. A couple of times, Quit (Command-Q) worked 
> to quit/crash python, and Segmentation Fault appeared in Terminal once.  
> Later, Quit did not work and I had to use (apple)=> Force Quit.
> 
> The trivial solution is to not close with input pending.  First, either hit 
> Enter to let the user code run or end-of-file (default ^D) to kill it.  A 
> corresponding patch could enforce this with a message to enter or kill before 
> closing.
> 
> However, I believe the issue is that PyShell.readline uses a nested tk 
> mainloop() as a control mechanism.  Four callbacks, including eof_callback, 
> call quit() to exit the nested mainloop and finish readline.  But the 
> callback has to finish and be pulled off the stack first.  Three of the 
> callbacks return immediately after 'quit()'.  However, PyShell.close 
> continues closing before readline continues.
> 
> When I replaced pyshell line  1016
>return EditorWindow.close(self)
> with
>root.after(1, EditorWindow.close self)
> the bug disappears.  The opens a time gap between PyShell.close and 
> EditorWindow.close that allows readline to return '', signalling end-of-file.
> 
> This change also works on my Mac, except that I have to say 'yes' twice to 
> close.
> Irv, please try this replacement on your system.
> 
> --
> title: At prompt for input(), pressing Command q kills IDLE -> IDLE: exit at 
> input() prompt is not complete
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue41306] test_tk test_widgets.ScaleTest fails with Tk 8.6.10

2020-07-28 Thread Ned Deily

Ned Deily  added the comment:

This issue should be fixed for upcoming releases. Nosying Łukasz for 
consideration of "release blocker" status.

--
nosy: +lukasz.langa
priority: normal -> critical

___
Python tracker 

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



[issue41405] python 3.9.0b5 test

2020-07-28 Thread Ned Deily


Ned Deily  added the comment:

As xtreak noted earlier, the test_tk failure is documented in Issue41306.  It 
is a result of changes in Tk 8.6.x itself but the tests need to be fixed to 
work with older and newer versions of Tk 8.6.x. And the curses issues were 
originally reported in Issue36630 which has been superseded by Issue36982. If 
there is further discussion needed on either of these two issues, let's use 
them, please.

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> test_tk test_widgets.ScaleTest fails with Tk 8.6.10

___
Python tracker 

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



[issue36630] failure of test_colors_funcs in test_curses with ncurses 6.1

2020-07-28 Thread Ned Deily


Ned Deily  added the comment:

I believe this is now just a duplicate of Issue36982. If there is anything not 
already covered there, let's discuss it there.

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Add support for extended color functions in ncurses 6.1

___
Python tracker 

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



[issue41427] howto/descriptor.rst unnecessarily mentions method.__class__

2020-07-28 Thread Yonatan Goldschmidt


Change by Yonatan Goldschmidt :


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

___
Python tracker 

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



[issue41410] Opening a file in binary mode makes a difference on all platforms in Python 3

2020-07-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think deleting the last sentence is sufficient.

--
keywords: +newcomer friendly
nosy: +eric.smith

___
Python tracker 

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



[issue36982] Add support for extended color functions in ncurses 6.1

2020-07-28 Thread Ned Deily

Ned Deily  added the comment:

PR 17536 was based on the original PR 13534 and has now gone through a couple 
of rounds of code review. Other than a missing doc change, everything in PR 
13534 is covered (and updated) in PR 17536 so I've closed the original PR.  
Other than adding the doc change and a final core developer review of the last 
requested changes, this *should* be good to go.

We really need to get this merged since, without it, Python builds fail with 
the newer versions of ncurses now in most distributions.  Once it is merged 
into master for 3.10, Łukasz can provide direction about whether and when it 
should be backported to 3.9 and/or 3.8.

--
nosy: +hpj, lukasz.langa, ned.deily, serhiy.storchaka
priority: normal -> critical
stage: patch review -> commit review
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue41427] howto/descriptor.rst unnecessarily mentions method.__class__

2020-07-28 Thread Yonatan Goldschmidt


New submission from Yonatan Goldschmidt :

In Doc/howto/descriptor.rst:

# Internally, the bound method stores the underlying function,
# the bound instance, and the class of the bound instance.
>>> d.f.__func__

>>> d.f.__self__
<__main__.D object at 0x1012e1f98>
>>> d.f.__class__


The bound method (PyMethodObject) does not store "the class of the bound 
instance" - it only stores the "function" and "self".
d.f.__class__ is the class of the "method" type itself, not the class of d.f's 
instance (D from d = D())

I think this mention should be removed from the documentation?

--
assignee: docs@python
components: Documentation
messages: 374526
nosy: Yonatan Goldschmidt, docs@python
priority: normal
severity: normal
status: open
title: howto/descriptor.rst unnecessarily mentions method.__class__
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



[issue41380] Add snake example to turtledemo

2020-07-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

>From the closed PR: "I'll delete it from turtledemo and it will be at 
>tools/demo file!"

No! turtledemo was in tools/demo in 2.x, where hardly anyone saw it.  It was 
made into an importable module in 3.0.  A link was later added to the IDLE help 
menu.  I oppose adding any turtle demos back to tools/demo.  I would rather 
pull the few tkinter demos into a tkinter.demo subdirectory.

--

___
Python tracker 

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



[issue41426] [curses] Grammar mistake in curses.getmouse() docs

2020-07-28 Thread Brett Cannon


New submission from Brett Cannon :

https://docs.python.org/3/library/curses.html#curses.getmouse

"this method should be call to retrieve"

"call" -> "called"

--
assignee: docs@python
components: Documentation
keywords: newcomer friendly
messages: 374524
nosy: brett.cannon, docs@python
priority: normal
severity: normal
status: open
title: [curses] Grammar mistake in curses.getmouse() docs
versions: Python 3.10, 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



[issue41303] perf_counter result does not count system sleep time in Mac OS

2020-07-28 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

macOS 10.12 also has clock_gettime(), which would allow using the generic code 
path (although the current path must be kept for older versions of macOS).

--

___
Python tracker 

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



[issue41422] C Unpickler memory leak via memo

2020-07-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-07-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41425] [tkinter] "Coupling Widget Variables" example missing code

2020-07-28 Thread Brett Cannon


New submission from Brett Cannon :

The example for 
https://docs.python.org/3.8/library/tkinter.html#coupling-widget-variables is 
missing:

1. Imports
2. Code to launch the example

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 374522
nosy: brett.cannon, docs@python
priority: normal
severity: normal
status: open
title: [tkinter] "Coupling Widget Variables" example missing code
versions: Python 3.10, 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



[issue41422] C Unpickler memory leak via memo

2020-07-28 Thread kale-smoothie


kale-smoothie  added the comment:

The leak demonstrated in the attachment is, to my understanding, caused by 
memoizing the closure returned from the `find_class` method that's used to 
intercept global references. The cycle is then: Unpickler, memo table, closure, 
Unpickler (via cell reference to `self`).

My proposed patch visits every entry in the memo table.

Pre-patch run of valgrind on leak_pickler.py:

==20339== HEAP SUMMARY:
==20339== in use at exit: 190,189,238 bytes in 2,406,919 blocks
==20339==   total heap usage: 3,150,288 allocs, 743,369 frees, 233,766,596 
bytes allocated
==20339== 
==20339== LEAK SUMMARY:
==20339==definitely lost: 0 bytes in 0 blocks
==20339==indirectly lost: 0 bytes in 0 blocks
==20339==  possibly lost: 190,176,150 bytes in 2,406,835 blocks
==20339==still reachable: 13,088 bytes in 84 blocks
==20339== suppressed: 0 bytes in 0 blocks
==20339== Rerun with --leak-check=full to see details of leaked memory

Post-patch run of valgrind on leak_pickler.py:

==20880== HEAP SUMMARY:
==20880== in use at exit: 667,277 bytes in 6,725 blocks
==20880==   total heap usage: 2,853,739 allocs, 2,847,014 frees, 216,473,216 
bytes allocated
==20880== 
==20880== LEAK SUMMARY:
==20880==definitely lost: 0 bytes in 0 blocks
==20880==indirectly lost: 0 bytes in 0 blocks
==20880==  possibly lost: 654,624 bytes in 6,646 blocks
==20880==still reachable: 12,653 bytes in 79 blocks
==20880== suppressed: 0 bytes in 0 blocks
==20880== Rerun with --leak-check=full to see details of leaked memory

--

___
Python tracker 

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



[issue41424] [tkinter] Grammatical error in "Packer" docs

2020-07-28 Thread Brett Cannon


New submission from Brett Cannon :

"Geometry managers are used to specify the relative positioning of the 
positioning of widgets within their container".

Remove "of the positioning".

--
assignee: docs@python
components: Documentation
keywords: newcomer friendly
messages: 374520
nosy: brett.cannon, docs@python
priority: normal
severity: normal
status: open
title: [tkinter] Grammatical error in "Packer" docs
versions: Python 3.10, 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



[issue41422] C Unpickler memory leak via memo

2020-07-28 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +20809
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21664

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-07-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +mark.dickinson, rhettinger

___
Python tracker 

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



[issue41423] `multiprocessing.Array` and `multiprocessing.managers.SyncManager.Array` APIs are similar but not the same

2020-07-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue41423] `multiprocessing.Array` and `multiprocessing.managers.SyncManager.Array` APIs are similar but not the same

2020-07-28 Thread Ben


Change by Ben :


--
nosy: +bjs

___
Python tracker 

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



[issue41423] `multiprocessing.Array` and `multiprocessing.managers.SyncManager.Array` APIs are similar but not the same

2020-07-28 Thread James Thistlewood


New submission from James Thistlewood :

I stumbled across this by trying to implement a call to the latter, while 
reading the docs for the former.

I think this is quite confusing and unnecessary that the APIs between these two 
definitions should differ.  The same goes for `multiprocessing.Value` and 
`multiprocessing.managers.SyncManager.Value`.

This is especially exacerbated by the fact that the docs _are incorrect_. On 
this page [1], under 'Server process', a link to 'Array' is made. If it were 
correct, it would link to `multiprocessing.managers.SyncManager.Array`, since 
it's talking about a manager object - the kind returned by `Manager()`. But it 
links to `multiprocessing.Array`. Of course, the simple solution would be to 
change the link to link to the correct place, but I think this shows an 
unnecessary inconsistency in the API itself.

I don't have a PR for this yet, nor have I fully investigated, but should it be 
feasible I would like to implement it myself. I'm interested to hear what 
people think.

[1] 
https://docs.python.org/3/library/multiprocessing.html#sharing-state-between-processes

--
components: Library (Lib)
messages: 374519
nosy: jthistle
priority: normal
severity: normal
status: open
title: `multiprocessing.Array` and `multiprocessing.managers.SyncManager.Array` 
APIs are similar but not the same
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue41422] C Unpickler memory leak via memo

2020-07-28 Thread kale-smoothie


New submission from kale-smoothie :

I'm not familiar with the workings of GC/pickle, but it looks like the traverse 
code in the C Unpickler omits a visit to the memo, potentially causing a memory 
leak?

--
components: Library (Lib)
files: leak_pickler.py
messages: 374518
nosy: kale-smoothie
priority: normal
severity: normal
status: open
title: C Unpickler memory leak via memo
type: resource usage
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9
Added file: https://bugs.python.org/file49345/leak_pickler.py

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-07-28 Thread David MacIver


David MacIver  added the comment:

I guess on actual inspection of the code (which I should have done before, 
sorry) it's obvious why this happens: u ** (1.0 / alpha) will round to 0.0 for 
small values of u, and the smaller alpha is the higher the probability of that 
happening, in that it happens with probability c ** alpha for some c.

--

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-07-28 Thread David MacIver


New submission from David MacIver :

The following code raises a ZeroDivisionError:


from random import Random

Random(14064741636871487939).paretovariate(0.01)


This raises:

random.py, line 692, in paretovariate
return 1.0 / u ** (1.0/alpha)
ZeroDivisionError: float division by zero


That specific stack trace is from 3.8.5 but I've tried this on 3.6 and 3.7 as 
well.

It's a little hard to tell what the intended correct range of parameter values 
is for paretovariate, and this may just be lack of validation for the alpha < 1 
case - perhaps that was never intended to be supported?

Based on some very informal inspection, what seems to happen is that the 
probability of getting a ZeroDivisionError approaches one as you approach zero. 
They rarely occur at this level of alpha (0.01), but for alpha=0.001 they seem 
to occur just under half the time, and for alpha=0.0001 they occur more than 
90% of the time.

(For the interested, this bug was found by Hypothesis as part of its own 
testing of our integration with the Random API)

--
components: Library (Lib)
messages: 374516
nosy: David MacIver
priority: normal
severity: normal
status: open
title: Random.paretovariate sometimes raises ZeroDivisionError for small alpha
versions: 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



[issue36661] Missing dataclass decorator import in dataclasses module docs

2020-07-28 Thread Brett Cannon


Change by Brett Cannon :


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



[issue36661] Missing dataclass decorator import in dataclasses module docs

2020-07-28 Thread Brett Cannon


Brett Cannon  added the comment:

Thanks for noticing, Karl!

--

___
Python tracker 

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



[issue41409] deque.pop(index) is not supported

2020-07-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am convinced by Raymond's argument, it seems that with the current state of 
the ABC classes and semantics the most pragmatical solution is the status quo. 
It would be a weird if deque is a Sequence but not a MutableSequence because it 
can clearly be mutated.

--

___
Python tracker 

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



[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> So, do you think it should just be documented that follow_symlinks is 
> effectively ignored with os.link() on most platforms that claim to support 
> it, unless either src_dir_fd or dst_dir_fd is used?

At this stage, I am just trying to understand all the possibilities in the 
design space and I don't have a preferred path. I just wanted to point out that 
we should take into account that many things may be broken if we make changes 
that are backwards-incompatible in a low-level function and we must have that 
in mind

--

___
Python tracker 

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



[issue41380] Add snake example to turtledemo

2020-07-28 Thread Ehsonjon Gadoev


Ehsonjon Gadoev  added the comment:

Moved to https://bugs.python.org/issue41418

--

___
Python tracker 

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



[issue40841] Provide mimetypes.sniff API as stdlib

2020-07-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

When the standard says "trust the filename" it is talking to the
application, not to the sniffing library. The library should provide the
tool for applications to follow the standard, but I don't see a reason why
we would have to enforce how applications call the library. Since we agree
there are use cases beyond what the standard has thought of for combining
sniffing the data and guessing based on the filename, we should make that
possible, the standard's exhortations notwithstanding.

Python is not a browser; a browser could be an application written in
Python. Python therefulre should provide tools that are useful to implement
a browser.

--

___
Python tracker 

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



[issue41412] After installation on Windows7, 64bit Python 3.9.0b5 reports "api-ms-win-core-path-l1-1-0.dll" missing and doesn't start

2020-07-28 Thread Steve Dower


Steve Dower  added the comment:

Leaving this open until we can validate on the next release. I don't have 
convenient access to old versions of Windows anymore (and don't have time to 
deal with inconvenient access this week).

--
priority: release blocker -> deferred blocker
stage: patch review -> commit review

___
Python tracker 

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



[issue40948] Better identify Windows installer as installer only, not runner

2020-07-28 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



[issue40841] Provide mimetypes.sniff API as stdlib

2020-07-28 Thread Dong-hee Na


Dong-hee Na  added the comment:

> I think that both functions for detecting file type, by name and by content

I think so too, mime sniffing would not be a way to alternate the method based 
on the file extension. Both APIs should be provided.

> should not we add also the code for detecting the text encoding based on 
> other algorithms used in browsers

I already add the code for text encoding detection based on the whatwg standard 
so if this API is landed, yes text encoding detection will be supported.(e.g 
utf-16be)
IMHO, there would be use-cases since today python is used a lot for text data 
handling (for example crawling, data pre-processing) 

There would be the question that the standard for the browser is appropriate 
for the python stdlib module.
My answer is that the whatwg standard could be the one of best standards to 
follow if make the decision to provide mime sniffing.

The standard handle mime types that are widely used in the real world not only 
for browser but also HTTP server or else.

One of the big stress to maintain mime-types detection is that considering how 
many mime-types should be supported.
Luckily, whatwg can be the strong standard to make the decision.

--

___
Python tracker 

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



[issue41411] Improve and consolidate f-strings docs

2020-07-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Note that there already is something in the tutorial about f-strings (in
inputoutput.rst, labeled tut-f-strings), and the intro has a link to their
reference manual description in the "see also" section.

--

___
Python tracker 

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



[issue40948] Better identify Windows installer as installer only, not runner

2020-07-28 Thread miss-islington


miss-islington  added the comment:


New changeset 95cc37f6b8e895a5042e2a10e5d9026429e06342 by Miss Islington (bot) 
in branch '3.9':
bpo-41412 and bpo-40948: Windows installer updates (GH-21656)
https://github.com/python/cpython/commit/95cc37f6b8e895a5042e2a10e5d9026429e06342


--

___
Python tracker 

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



[issue41420] Academic Free License v. 2.1 link is not found and is obsolete

2020-07-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

I've sent an email to our lawyer.

--

___
Python tracker 

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



[issue41412] After installation on Windows7, 64bit Python 3.9.0b5 reports "api-ms-win-core-path-l1-1-0.dll" missing and doesn't start

2020-07-28 Thread miss-islington


miss-islington  added the comment:


New changeset 95cc37f6b8e895a5042e2a10e5d9026429e06342 by Miss Islington (bot) 
in branch '3.9':
bpo-41412 and bpo-40948: Windows installer updates (GH-21656)
https://github.com/python/cpython/commit/95cc37f6b8e895a5042e2a10e5d9026429e06342


--

___
Python tracker 

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



[issue41412] After installation on Windows7, 64bit Python 3.9.0b5 reports "api-ms-win-core-path-l1-1-0.dll" missing and doesn't start

2020-07-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset 37a06cbe5c17c2aa6ad938339fd42531a8a0bea0 by Steve Dower in branch 
'master':
bpo-41412 and bpo-40948: Windows installer updates (GH-21656)
https://github.com/python/cpython/commit/37a06cbe5c17c2aa6ad938339fd42531a8a0bea0


--

___
Python tracker 

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



[issue40948] Better identify Windows installer as installer only, not runner

2020-07-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset 37a06cbe5c17c2aa6ad938339fd42531a8a0bea0 by Steve Dower in branch 
'master':
bpo-41412 and bpo-40948: Windows installer updates (GH-21656)
https://github.com/python/cpython/commit/37a06cbe5c17c2aa6ad938339fd42531a8a0bea0


--

___
Python tracker 

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



[issue41412] After installation on Windows7, 64bit Python 3.9.0b5 reports "api-ms-win-core-path-l1-1-0.dll" missing and doesn't start

2020-07-28 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +20807
pull_request: https://github.com/python/cpython/pull/21661

___
Python tracker 

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



[issue41420] Academic Free License v. 2.1 link is not found and is obsolete

2020-07-28 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue40948] Better identify Windows installer as installer only, not runner

2020-07-28 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41420] Academic Free License v. 2.1 link is not found and is obsolete

2020-07-28 Thread Dmytro Litvinov


New submission from Dmytro Litvinov :

Link to Acamedic Free License v. 
2.1(https://www.samurajdata.se/opensource/mirror/licenses/afl-2.1.php) at 
https://www.python.org/psf/contrib/ is not found. Also, Guido mentioned that 
version 2.1 seems obsolete and we may need to review that with the lawyer 
(https://bugs.python.org/issue41328#msg374495).

--
assignee: docs@python
components: Documentation
messages: 374501
nosy: DmytroLitvinov, docs@python
priority: normal
severity: normal
status: open
title: Academic Free License v. 2.1 link is not found and is obsolete
type: behavior

___
Python tracker 

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



[issue41328] In unittest doc, replace Hudson CI with Travis and Appveyor

2020-07-28 Thread Dmytro Litvinov


Dmytro Litvinov  added the comment:

Done: https://bugs.python.org/issue41420

--

___
Python tracker 

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



[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-28 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I agree that the current implementation is wonky.  

The implementation should use linkat(2) whenever it is available, that's the 
only portable way to honour the follow_symlinks flag as POSIX says that the 
behaviour for link(2) with symbolic links is implementation defined.

>From a quick experiment link(2) on Linux behaves like linkat(2) without 
>AT_SYMLINK_FOLLOW.  On macOS link(2) behaves like linkat(2) *with* 
>AT_SYMLINK_FOLLOW.   

That means os.link behaviour is currently different on macOS and Linux. 

I think it would be worthwhile to try to standardise the behaviour. Given the 
relative market sizes it I'd go for the current behaviour on Linux (with 
explicit tests!), even if that might not be backward compatible on macOS.

I'd also add a configure test for the behaviour of link(2) and error out when 
the user specifies a value for follow_symlinks that's not compatible with 
link(2) when linkat(2) is not available.  Or maybe only do this when the user 
explicitly passes in a value for this argument (make it a tri-state).

Also: note that the current macOS installers on macOS don't look at the 
follow_symlinks flag at all, they are build on macOS 10.9 where linkat(2) is 
not available (unlink macOS 10.10 or later).  That's why I noticed this problem.

--

___
Python tracker 

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



[issue41328] In unittest doc, replace Hudson CI with Travis and Appveyor

2020-07-28 Thread miss-islington


miss-islington  added the comment:


New changeset 59cfba326801a1fd809836c16887f53765f9680f by Miss Islington (bot) 
in branch '3.8':
bpo-41328: Replace mention of Hudson CI with Travis CI and AppVeyor (GH-21653)
https://github.com/python/cpython/commit/59cfba326801a1fd809836c16887f53765f9680f


--

___
Python tracker 

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



[issue41416] Restore default implementation of __ne__ in mixins Set and Mapping

2020-07-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> if we have a class which inherits from both Set and int

This really seems like an invented problem rather than an actual problem.

> class A(collections.abc.Set, int): pass

Would anyone ever do this and be surprised the sets and ints don't combine 
perfectly?

If you must, add a footnote to the collections.abc entry for __ne__ noting that 
__ne__ is inherited.  Or you can restore the definition of Set.__ne__ that was 
present in 3.4.

--

___
Python tracker 

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



[issue41328] In unittest doc, replace Hudson CI with Travis and Appveyor

2020-07-28 Thread miss-islington


miss-islington  added the comment:


New changeset e31b8a5cd13ca529e59c1e05d4524ae750a5b5a0 by Miss Islington (bot) 
in branch '3.9':
bpo-41328: Replace mention of Hudson CI with Travis CI and AppVeyor (GH-21653)
https://github.com/python/cpython/commit/e31b8a5cd13ca529e59c1e05d4524ae750a5b5a0


--

___
Python tracker 

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



[issue41419] Path.mkdir and os.mkdir don't respect setgid if its parent is g-s

2020-07-28 Thread Christopher Harrison


New submission from Christopher Harrison :

The setgid bit is not set when creating a directory, even when explicitly 
specified in the mode argument, when its containing directory doesn't have its 
own setgid bit set. When the parent does have the setgid bit, it works as 
expected.

Steps to reproduce:

1. Outside of Python, create a working directory with mode 0770, such that:

   >>> from pathlib import Path
   >>> oct(Path().stat().st_mode)
   '0o40770'

2. Set the umask to 0, to be sure it's not a masking issue:

   >>> import os
   >>> _ = os.umask(0)

3. Create a subdirectory with mode ug+rwx,g+s (2770):

   >>> (test := Path("test")).mkdir(0o2770)
   >>> oct(test.stat().st_mode)
   '0o40770'

   Notice that setgid is not respected.

4. Set setgid to the working directory:

   >>> Path().chmod(0o2770)
   >>> oct(Path().stat().st_mode)
   '0o42770'

   This works as expected.

5. Create another subdirectory with mode ug+rwx,g+s:

   >>> (test2 := Path("test2")).mkdir(0o2770)
   >>> oct(test2.stat().st_mode)
   '0o42770'

   The setgid bit of the new directory is now correctly set.

This also affects os.mkdir.

I have only tested this under Python 3.8.2 and 3.8.3 on a POSIX filesystem. (I 
assume it's not relevant to non-POSIX filesystems.)

--
components: Library (Lib)
messages: 374496
nosy: Xophmeister
priority: normal
severity: normal
status: open
title: Path.mkdir and os.mkdir don't respect setgid if its parent is g-s
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



[issue41328] In unittest doc, replace Hudson CI with Travis and Appveyor

2020-07-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Can you file a separate bug report for the license link? We may need to review 
that with the lawyer, to see if we can use AFL 3.0, since AFL 2.1 seems 
obsolete.

--

___
Python tracker 

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



[issue41328] In unittest doc, replace Hudson CI with Travis and Appveyor

2020-07-28 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue41328] In unittest doc, replace Hudson CI with Travis and Appveyor

2020-07-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20805
pull_request: https://github.com/python/cpython/pull/21659

___
Python tracker 

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



[issue41328] In unittest doc, replace Hudson CI with Travis and Appveyor

2020-07-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20806
pull_request: https://github.com/python/cpython/pull/21660

___
Python tracker 

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



[issue41328] In unittest doc, replace Hudson CI with Travis and Appveyor

2020-07-28 Thread miss-islington


miss-islington  added the comment:


New changeset 5e3826785dcc64f8e1a8a7bde11b88fbb40943be by Dmytro Litvinov in 
branch 'master':
bpo-41328: Replace mention of Hudson CI with Travis CI and AppVeyor (GH-21653)
https://github.com/python/cpython/commit/5e3826785dcc64f8e1a8a7bde11b88fbb40943be


--
nosy: +miss-islington

___
Python tracker 

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



[issue41409] deque.pop(index) is not supported

2020-07-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> If deque does not fully support the MutableSequence interface,
> should not it be un-regitered as MutableSequence?

You could unregister it, but for such a minor variance, it isn't worth it.  
We're not unregistering sets and frozenset from Set even though there are minor 
variances in the operators. 

The ABCs are quite limited in what they do. The underlying machinery is mostly 
about determining whether a method is present or not.  Concrete classes are 
free to override, extend or raise NotImplemented.  For example, a Counter is 
still a mapping even though fromkeys() raises NotImplemented and update() has 
different semantics than Mapping.  

Jelle has already adapted TypeShed to match the concrete class, so no actual 
user issue remains.

--

___
Python tracker 

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



  1   2   >