[issue40841] Provide mimetypes.sniff API as stdlib

2020-07-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think that both functions for detecting file type, by name and by content, 
are useful in different circumstances. We have similar more specific detection 
functions sndhdr and imghdr.

But I am not sure whether it should be a part of the mimetypes module or 
separate module. Should it use sndhdr and imghdr modules for audio and image 
types? Should it be a wrapper to the libmagic library 
(https://linux.die.net/man/3/libmagic) or reimplement it in Python?

If we add the code for detecting the file type based on algorithms used in 
browsers, should not we add also the code for detecting the text encoding based 
on other algorithms used in browsers, or it is too much?

--

___
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 Serhiy Storchaka


Serhiy Storchaka  added the comment:

If deque does not fully support the MutableSequence interface, should not it be 
un-regitered as MutableSequence? Maybe we need other abstract class which would 
be parent of MutableSequence and deque?

--
nosy: +stutzbach

___
Python tracker 

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



[issue36788] Add clamp() function to builtins

2020-07-28 Thread Mark Dickinson


Mark Dickinson  added the comment:

#41408 was closed as a duplicate of this issue

See also the recent discussion on python-ideas at 
https://mail.python.org/archives/list/python-id...@python.org/thread/KWAOQFSV3YJYQV2Y5JXGXFCXHJ3WFLRS/#KWAOQFSV3YJYQV2Y5JXGXFCXHJ3WFLRS

That discussion has petered out without a clear consensus. The next step would 
likely be for an interested party to put together a PEP.

--

___
Python tracker 

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



[issue41408] Add a `clamp` function to the `math` module

2020-07-28 Thread Mark Dickinson


Change by Mark Dickinson :


--
resolution: rejected -> duplicate
superseder:  -> Add clamp() function to builtins

___
Python tracker 

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



[issue36788] Add clamp() function to builtins

2020-07-28 Thread Mark Dickinson


Mark Dickinson  added the comment:

Another python-ideas thread, from 2016: 
https://mail.python.org/archives/list/python-id...@python.org/thread/EHZAXE4P2VOT3CE4H6SNDPDASW7H2CGS/

--

___
Python tracker 

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



[issue41395] pickle and pickletools cli interface doesn't close input and output file.

2020-07-28 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue41411] Improve and consolidate f-strings docs

2020-07-28 Thread Ama Aje My Fren


Ama Aje My Fren  added the comment:

Hi Ezio,

Would you see this being resolved in part by a HOWTO document?

--
nosy: +amaajemyfren

___
Python tracker 

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



[issue41395] pickle and pickletools cli interface doesn't close input and output file.

2020-07-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +easy

___
Python tracker 

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



[issue41417] SyntaxError: assignment expression within assert

2020-07-28 Thread Jan Češpivo

New submission from Jan Češpivo :

Hi,

it should be useful if assignment expression works within assertion.

For example (real use-case in tests):

assert r := re.match(r"result is (\d+)", tested_text)
assert int(r.group(1)) == expected_number

I haven't found a mention about assertions in 
https://www.python.org/dev/peps/pep-0572/ so it isn't technically a bug but it 
might be omission (?).

Thx!

--
components: Interpreter Core
messages: 374476
nosy: jan.cespivo
priority: normal
severity: normal
status: open
title: SyntaxError: assignment expression within assert
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



[issue41394] Document '_' in interpreter tutorial

2020-07-28 Thread wyz23x2


Change by wyz23x2 :


--
pull_requests: +20796
pull_request: https://github.com/python/cpython/pull/21654

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


karl  added the comment:

This should be closed. The PR has been merged and the doc is now up to date.

--
nosy: +karlcow

___
Python tracker 

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



[issue41417] SyntaxError: assignment expression within assert

2020-07-28 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I don't know if this limitation is intentional, but not that you can use an 
assignment expression when you enclose the expression with parenthesis:

>>> assert (a:=1)
>>> a
1
>>>

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue41417] SyntaxError: assignment expression within assert

2020-07-28 Thread Jan Češpivo

Jan Češpivo  added the comment:

Hi Ronald,

thank you. It works! :)

--

___
Python tracker 

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



[issue41417] SyntaxError: assignment expression within assert

2020-07-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue35328] Set a environment variable for venv prompt

2020-07-28 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset c82dda1e08c4b74ca24f88d6a549d93108c319cf by Zackery Spytz in 
branch 'master':
bpo-35328: Set VIRTUAL_ENV_PROMPT at venv activation (GH-21587)
https://github.com/python/cpython/commit/c82dda1e08c4b74ca24f88d6a549d93108c319cf


--

___
Python tracker 

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



[issue40236] datetime.datetime.strptime get day error

2020-07-28 Thread karl


karl  added the comment:

Same on macOS 10.15.6 (19G73)


Python 3.8.3 (v3.8.3:6f8c8320e9, May 13 2020, 16:29:34) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.strptime("2024-0-3 00:00:00", "%Y-%W-%w %H:%M:%S")
datetime.datetime(2024, 1, 3, 0, 0)
>>> datetime.datetime.strptime("2024-1-3 00:00:00", "%Y-%W-%w %H:%M:%S")
datetime.datetime(2024, 1, 3, 0, 0)


Also 
https://pubs.opengroup.org/onlinepubs/007908799/xsh/strptime.html

note that iso8601 doesn't have this issue.
%V - ISO 8601 week of the year as a decimal number [01, 53].
https://en.wikipedia.org/wiki/ISO_week_date

--
nosy: +karlcow

___
Python tracker 

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



[issue41394] Document '_' in interpreter tutorial

2020-07-28 Thread wyz23x2


Change by wyz23x2 :


--
pull_requests:  -20792

___
Python tracker 

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



[issue41318] Better error message of "Cannot recover from stack overflow."

2020-07-28 Thread Heyi Tang


Change by Heyi Tang :


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

___
Python tracker 

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



[issue41417] SyntaxError: assignment expression within assert

2020-07-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is a duplicate of issue39909.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Assignment expression in assert causes SyntaxError

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


Akuli  added the comment:

I don't think it's very common to write code that needs to work with any 
MutableSequence but not with any Sequence. I think that's the only situation 
where missing support for deque.pop(index) is a problem.

Maybe deque should be a Sequence but not a MutableSequence. Or maybe there 
should be a way to say "MutableSequence does not require support for 
.pop(index) even though you get it by inheriting from MutableSequence".

--

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

Assuming it fits, I'm going to update the 3.9+ post-install message to this 
(assume the HTML renders normally). Any comments?


New to Python? Start with the online 
tutorial and documentation;.

At your terminal, type "py" to launch Python, or search for Python in your 
Start menu.

See what's
 new in this release.

Special thanks to Mark Hammond, without whose years of freely shared Windows 
expertise, Python for Windows would still be Python for DOS.

--

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

> That said, since os.link() hasn't been working as advertised, this change 
> needs to be accompanied by changing the default value of follow_symlinks to 
> False. That will retain the status quo behavior for most systems, except in 
> the rare case that src_dir_fd or dst_dir_fd is used. If it isn't changed to 
> False, then suddenly os.link() calls will start following symlinks, whereas 
> prior to the change they did not because link() was being called instead of 
> linkat(). 


Isn't that a backwards-incompatible change?

--

___
Python tracker 

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



[issue40236] datetime.datetime.strptime get day error

2020-07-28 Thread karl


karl  added the comment:

Also this.

>>> import datetime
>>> d0 = datetime.datetime.strptime("2024-0-3 00:00:00", "%Y-%W-%w %H:%M:%S")
>>> d0.strftime("%Y-%W-%w %H:%M:%S")
'2024-01-3 00:00:00'
>>> d1 = datetime.datetime.strptime("2024-1-3 00:00:00", "%Y-%W-%w %H:%M:%S")
>>> d1.strftime("%Y-%W-%w %H:%M:%S")
'2024-01-3 00:00:00'
>>> d2301 = datetime.datetime.strptime("2023-0-1 00:00:00", "%Y-%W-%w %H:%M:%S")
>>> d2311 = datetime.datetime.strptime("2023-1-1 00:00:00", "%Y-%W-%w %H:%M:%S")
>>> d2301
datetime.datetime(2022, 12, 26, 0, 0)
>>> d2311
datetime.datetime(2023, 1, 2, 0, 0)
>>> d2311.strftime("%Y-%W-%w %H:%M:%S")
'2023-01-1 00:00:00'
>>> d2301.strftime("%Y-%W-%w %H:%M:%S")
'2022-52-1 00:00:00'


Week 0 2023 became Week 52 2022 (which is correct but might lead to surprises)

--

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

Added a screenshot, after tweaking the spacing just a little.

--
Added file: https://bugs.python.org/file49343/postinstall.png

___
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


Change by Steve Dower :


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

___
Python tracker 

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



[issue40947] Replace PLATLIBDIR macro with config->platlibdir

2020-07-28 Thread Steve Dower


Change by Steve Dower :


--
pull_requests:  -20800

___
Python tracker 

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



[issue40947] Replace PLATLIBDIR macro with config->platlibdir

2020-07-28 Thread Steve Dower


Change by Steve Dower :


--
nosy: +steve.dower
nosy_count: 2.0 -> 3.0
pull_requests: +20800
pull_request: https://github.com/python/cpython/pull/21656

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


--
keywords: +patch
pull_requests: +20801
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/21656

___
Python tracker 

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



[issue40947] Replace PLATLIBDIR macro with config->platlibdir

2020-07-28 Thread Steve Dower


Change by Steve Dower :


--
nosy:  -steve.dower

___
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 Eryk Sun


Eryk Sun  added the comment:

> Isn't that a backwards-incompatible change?

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? I'd rather it was fixed to 
behave consistently in 3.10, even if it's backwards incompatible with some use 
cases on some platforms. I think for most use cases, it's just called without 
arguments as os.link(src, dst), in which case on most platforms switching the 
default to follow_symlinks=False will preserve the existing and expected 
behavior.

--

___
Python tracker 

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



[issue41394] Document '_' in interpreter tutorial

2020-07-28 Thread wyz23x2


Change by wyz23x2 :


--
pull_requests: +20802
pull_request: https://github.com/python/cpython/pull/21657

___
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 Ezio Melotti

Ezio Melotti  added the comment:

HOWTOs are generally used to explain how to accomplish a certain task, so I'm 
not sure if they are a good fit for this situation.

In the list of proposed solutions in my first message, 1-3 should be quite easy 
to implement.  This leaves us with 4-5.

To summarize what we already have (let me know if I missed anything):
* string.rst[0] (the string module):
String constants (string constants)
Custom String Formatting (string.Formatter)
Format String Syntax (explains the syntax of {...})
Format Specification Mini-Language
Format examples
Template strings (string.Template)
Helper functions (string.capwords)
* stdtypes.rst[1] (about Python builtin types):
  Text Sequence Type — str (short intro about str)
String Methods (all the str.* methods)
printf-style String Formatting (old %-formatting)
* introduction.rst[2] (the string section in the tutorial)
* lexical_analysis.rst[3]
  String and Bytes literals
  String literal concatenation
  Formatted string literals

The lexical analysis is probably fine as is.  The introduction in the tutorial 
should mention f-strings, include a couple of examples, and link to the 
documentation for more.  The stdtypes page is already quite long and crowded, 
so I'm wary about adding more stuff in there.  So, unless we add a separate 
page somewhere, the string page seems the best candidate, even if technically 
it should be about the string module.

On top of items 1-3 of my previous message, to solve 4-5 I suggest to:
1) move the printf-style formatting section to string.rst;
2) add a section about f-strings under Format String Syntax in string.rst, 
focusing on differences and caveats that are unique to f-strings;
3) add some f-string-specific examples after the format examples
4) mention f-string in the string section of the tutorial, and in the text 
sequence type section of stdtypes.rst;

The string.rst page could then look something like:
String constants (string constants)
Custom String Formatting (string.Formatter)
Format String Syntax (explains the syntax of {...})
Format Specification Mini-Language
Format examples
f-strings
f-strings examples
printf-style String Formatting (old %-formatting)
Template strings (string.Template)
Helper functions (string.capwords)

This should consolidate all the docs in two places: string.rst and 
lexical_analysis.rst (they have a different target, so the separation is ok).  
All other places can then refer to this.  Once this is done, we can still 
decide to move these out of string.rst.

[0]: https://docs.python.org/3/library/string.html
[1]: https://docs.python.org/3/library/stdtypes.html#textseq
[2]: https://docs.python.org/3/tutorial/introduction.html#strings
[3]: 
https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals

--

___
Python tracker 

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



[issue41394] Document '_' in interpreter tutorial

2020-07-28 Thread wyz23x2


Change by wyz23x2 :


--
pull_requests:  -20790

___
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 Mats Wichmann


Mats Wichmann  added the comment:

I still think there ought to be some pointer to 
https://docs.python.org/3/using/windows.html in there.

--

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

I changed the middle paragraph to this:

See what's
 new in this release, or find more info about using 
Python on Windows.

--

___
Python tracker 

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



[issue41418] Add snake game to tools/demo!

2020-07-28 Thread Ehsonjon Gadoev


New submission from Ehsonjon Gadoev :

Its simple snake game for beginners! It based on simple algorithm! If you know! 
And it must be on python/cpython repo! Cause, I made python (snake) game with 
Python Programming Language xD (maybe not funny)!

We love python as much as you do! Yea!

--
components: Tkinter
files: snake.py
messages: 374492
nosy: Ehsonjon Gadoev
priority: normal
severity: normal
status: open
title: Add snake game to tools/demo!
versions: Python 3.8
Added file: https://bugs.python.org/file49344/snake.py

___
Python tracker 

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



[issue41418] Add snake game to tools/demo!

2020-07-28 Thread Ehsonjon Gadoev


Change by Ehsonjon Gadoev :


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

___
Python tracker 

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



[issue41418] Add snake game to tools/demo!

2020-07-28 Thread Ehsonjon Gadoev


Change by Ehsonjon Gadoev :


--
hgrepos: +390

___
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 Ehsonjon Gadoev


Change by Ehsonjon Gadoev :


--
title: Add snake game to tools/demo! -> GH-21658: Add snake game to tools/demo!

___
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



[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



[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


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



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



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



[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



[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



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



[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



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


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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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



[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



[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



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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



  1   2   >