[issue41762] Documentation job fails on CIs: duplicate token description of format_spec

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

> I closed bpo-41760 as a duplicate of this issue.

The error message was different but similar:

Warning, treated as error:
/<>/Doc/library/string.rst:311:duplicate token description of 
sign, other instance in library/functions

--

___
Python tracker 

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



[issue41762] Documentation job fails on CIs: duplicate token description of format_spec

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

I closed bpo-41760 as a duplicate of this issue.

--

___
Python tracker 

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



[issue41760] 3.8.6 rc1 documentation fails to build with sphinx 3.2.1

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

I close this issue as a duplicate of bpo-41762.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Documentation job fails on CIs: duplicate token description of 
format_spec

___
Python tracker 

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



[issue39651] Exceptions raised by EventLoop.call_soon_threadsafe

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the bug report Ben Darnell, it's now fixed.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue41772] Zipfile.testzip considers wrong password as correct

2020-09-11 Thread Amir Mohamadi


New submission from Amir Mohamadi :

Zipfile.testzip sometimes works perfectly with wrong password. refer to poc.py 
I've a zip file with password '76453' and when I try a wrong password with 
extractall:

myzip.setpassword('10006050')
myzip.extractall()

it raises a Bad CRC-32 exception. but when I try testzip instead of extractall:

myzip.setpassword('10006050')
myzip.testzip()

no exception is raised

--
Added file: https://bugs.python.org/file49452/poc.py

___
Python tracker 

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



[issue39651] Exceptions raised by EventLoop.call_soon_threadsafe

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1b0f0e3d7d03155da1cf9769a847874d559e57e3 by Victor Stinner in 
branch 'master':
bpo-39651: Fix asyncio proactor _write_to_self() (GH-22197)
https://github.com/python/cpython/commit/1b0f0e3d7d03155da1cf9769a847874d559e57e3


--

___
Python tracker 

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



[issue39651] Exceptions raised by EventLoop.call_soon_threadsafe

2020-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21271
pull_request: https://github.com/python/cpython/pull/22216

___
Python tracker 

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



[issue39651] Exceptions raised by EventLoop.call_soon_threadsafe

2020-09-11 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41772] Zipfile.testzip considers wrong password as correct

2020-09-11 Thread Amir Mohamadi


Change by Amir Mohamadi :


Added file: https://bugs.python.org/file49453/encrypted.zip

___
Python tracker 

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



[issue41731] test_cmd_line_script fails with verbosity level more than 1

2020-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 34e3c7592be70f652c293eb179593bf2928adeb4 by Miss Islington (bot) 
in branch '3.9':
bpo-41731: Make test_cmd_line_script pass with -vv (GH-22206)
https://github.com/python/cpython/commit/34e3c7592be70f652c293eb179593bf2928adeb4


--

___
Python tracker 

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



[issue41731] test_cmd_line_script fails with verbosity level more than 1

2020-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 77901dc6c3d06dd31f6c84b2d3cb21dc26b1e351 by Miss Islington (bot) 
in branch '3.8':
bpo-41731: Make test_cmd_line_script pass with -vv (GH-22206)
https://github.com/python/cpython/commit/77901dc6c3d06dd31f6c84b2d3cb21dc26b1e351


--

___
Python tracker 

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



[issue41772] Zipfile.testzip considers wrong password as correct

2020-09-11 Thread Amir Mohamadi


Change by Amir Mohamadi :


--
components: Library (Lib)
nosy: Amir
priority: normal
severity: normal
status: open
title: Zipfile.testzip considers wrong password as correct
type: behavior

___
Python tracker 

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



[issue41731] test_cmd_line_script fails with verbosity level more than 1

2020-09-11 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41731] test_cmd_line_script fails with verbosity level more than 1

2020-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21269
pull_request: https://github.com/python/cpython/pull/22214

___
Python tracker 

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



[issue41731] test_cmd_line_script fails with verbosity level more than 1

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 7e711ead26fea6465e0ef2e3b8880b57ba8fc129 by Terry Jan Reedy in 
branch 'master':
bpo-41731: Make test_cmd_line_script pass with -vv (GH-22206)
https://github.com/python/cpython/commit/7e711ead26fea6465e0ef2e3b8880b57ba8fc129


--

___
Python tracker 

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



[issue41729] test_winconsoleio fails and hangs on Windows

2020-09-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue41729] test_winconsoleio fails and hangs on Windows

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset c2577b9e0e2f8652f079b4ac473347c63f15e25c by Miss Islington (bot) 
in branch '3.9':
bpo-41729: Fix test_winconsole failures (3) and hang (GH-22146)
https://github.com/python/cpython/commit/c2577b9e0e2f8652f079b4ac473347c63f15e25c


--

___
Python tracker 

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



[issue41745] BoundArguments.arguments used in the recommended way to call a callable silently succeeds for nonexistent arguments

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I use signature for IDLE call tips, but have never used .bind and subsequent 
calls.  After understanding the behavior, my question as initial reviewer is 
whether it is an *implementation* bug.  Perhaps, but not obviously so.

Whether or not it is a design wart serious enough to warrant an design change 
is a different question, which I am not going to judge.  Maybe there is a 
reason for the current design we have not thought of.  Or maybe it is an 
accident too painful to change.

I am convinced that the doc could be better.

--
stage:  -> needs patch

___
Python tracker 

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



[issue41729] test_winconsoleio fails and hangs on Windows

2020-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset bbab34084e876291d96a65741f075db3adfa7733 by Miss Islington (bot) 
in branch '3.8':
bpo-41729: Fix test_winconsole failures (3) and hang (GH-22146)
https://github.com/python/cpython/commit/bbab34084e876291d96a65741f075db3adfa7733


--

___
Python tracker 

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



[issue41729] test_winconsoleio fails and hangs on Windows

2020-09-11 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41729] test_winconsoleio fails and hangs on Windows

2020-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21267
pull_request: https://github.com/python/cpython/pull/22212

___
Python tracker 

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



[issue41729] test_winconsoleio fails and hangs on Windows

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 31c9828ec026e5d9b9122d55bf0aa7cb45bfecc5 by Terry Jan Reedy in 
branch 'master':
bpo-41729: Fix test_winconsole failures (3) and hang (GH-22146)
https://github.com/python/cpython/commit/31c9828ec026e5d9b9122d55bf0aa7cb45bfecc5


--

___
Python tracker 

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



[issue41763] IDLE: scale font to Windows' "zoom" factor

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Are you the Elisha Paine that suggested the original fix?

I am still interested in the subject, but there are a lot of factors to 
consider.

Rereading #33656, I disagree that IDLE is lying; tk scales on startup and 
others agreed with the current setting, and even thought it should be made part 
of the Python install.

I did a *lot* of testing, using a magnifier looking at IDLE, Firefox, and 
Command Prompt, and changing the properties settings.

The minimum client for GetDpiForWindow is Windows 10, version 1607, whereas the 
current solution works for all Win 10 and likely Win 8, so it cannot replace 
the latter.

Currently, when I change Settings / Display / Scale and layout, which is what I 
presume you mean by 'zoom factor' (100%, 125%, ...), IDLE 3.9 changes too, as I 
would expect.  The text window change is not exactly in proportion to the 
Display dialog change, but the difference might be the layout white space.  
This is contrary to what you report.  I have Win 10 2004 with Sept updates.

When I downscale the resolution, the type for both the dialog and IDLE 
enlarges.  I presume that this is to keep it smooth rather than becoming 
pixelated.

I have access to system with 2 4k monitors.  When I downscaled one, and moved 
Windows between them, the physical height was sometimes maintained, but 
sometimes changed.  I will probably install Python on that system to see how 
IDLE and tkinter and turtledemo (without the fix) look, and repeat the above 
experiment.

If people changes font face, they may need to adjust the 'size', and the 
physical size for a given 'size' varies between fonts.

--

___
Python tracker 

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



[issue40108] Improve error message for -m option when .py is present

2020-09-11 Thread Jay Cee Garcia


Change by Jay Cee Garcia :


--
components: +XML
type:  -> behavior

___
Python tracker 

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



[issue41762] Documentation job fails on CIs: duplicate token description of format_spec

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Two issues about Sphinx 3.2.1 failing with "duplicate token description"
(posted on both)
#41760 'sign', multiple people nosy, failed where?
#41762 'format_spec', on Travis, PR by Victor Stinner (2.2.0 okay)

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41760] 3.8.6 rc1 documentation fails to build with sphinx 3.2.1

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Two issues about Sphinx 3.2.1 failing with "duplicate token description"
(posted on both)
#41760 'sign', multiple people nosy, failed where?
#41762 'format_spec', on Travis, PR by Victor Stinner (2.2.0 okay)

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41771] bdist_wininst doesn't execute postinstall script

2020-09-11 Thread Mark Hammond


Change by Mark Hammond :


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

___
Python tracker 

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



[issue41758] turtledemo.colormixer crashes with a stack overflow

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I cannot reproduce on Win 10, 32bit repository debug builds, amd64 machine, 
with either current master or 3.8, started from command prompt in normal 
environment with same command.  I also used installed 3.9 a bit.

Are .pyenv and pyenv-win your names or do they mean something possibly 
relevant?  I presume PS is PowerShell, which should not be relevant.
Did you get the stack trace upon startup, or thereafter, without touching the 
app?  If not, what did you do, in detail?

One time crash or repeatable?  Either way, please try current release.  If we 
cannot reproduce, we cannot test a fix. 

In the stacktrace, each cycle begins with a mouse-move event, handled by 
eventfun, which wraps and calls the user function (here 'shift) with event.x, 
event.y.  The relevant code is

def shift(self, x, y):
self.sety(max(0,min(y,1)))
self._color[self.x] = self.ycor()
self.fillcolor(self._color)
setbgcolor()

def setbgcolor():
screen.bgcolor(red.ycor(), green.ycor(), blue.ycor())

Both sety (move turtle to y) and bgcolor require an update __call__ into 
tcl/tk.  These normally should return and the call stack back to eventfun 
unwound.  Instead, it appears that new event handlings get added.  I suspect 
something peculiar about your system.

The line  'File "", line 1 in coords' is extremely odd, as it looks 
like an interactive injection of a command.  However, the previous trace line 
is '...turtle.py", line 755 in _pointlist', referring to turtle line

cl = self.cv.coords(item)

where cv is a tkinter canvas, and the 2761 in the top trace is the line within 
the coords methods calling tk.  So maybe  is an anomaly related to 
stack exhaustion.

Another possible factor is the turtle _items list.  It can grow, but I am not 
familiar with turtle internals.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41771] bdist_wininst doesn't execute postinstall script

2020-09-11 Thread Mark Hammond


New submission from Mark Hammond :

install.c tries to dynamically load PyCFunction_New at 
https://github.com/python/cpython/blob/fb2718720346c8c7a0ad2d7477f20e9a5524ea0c/PC/bdist_wininst/install.c#L686
 - however, since 3.8 this no longer exists - PyCFunction_New is a #define 
which calls PyCFunction_NewEx

--
assignee: mhammond
messages: 376771
nosy: mhammond
priority: normal
severity: normal
status: open
title: bdist_wininst doesn't execute postinstall script
type: behavior
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



[issue41770] Import module doesn't updated

2020-09-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This is not a bug, it is working as designed. Importing takes the module from 
the cache. You can either delete the module from the cache:

del sys.modules['modulename']
import modulename  # reloads from the module file


or possibly simpler, use reload:

importlib.reload(modulename)

--
components: +Interpreter Core -Windows
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: resource usage -> behavior

___
Python tracker 

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



[issue41719] Why does not range() support decimals?

2020-09-11 Thread chen-y0y0


Change by chen-y0y0 :


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

___
Python tracker 

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



[issue41725] bz2 would use a dedicated exception for data error

2020-09-11 Thread Michał Górny

Michał Górny  added the comment:

> An OSError for a file the OS can read seems a bit off.  What is the 
> accompanying message?

For example:

  OSError: Invalid data stream

(I've just put random string into a file, and opened it as bzip2)

> Would something like ValueError("bz2 compressor failed with BZ_DATA_ERROR") 
> be better?

It would be a partial improvement.  However, it would also break backwards 
compatibility with code already catching OSError.  It might be better to go 
with custom exception type derived from OSError to keep existing code working.

> Michał, are there precedents or models for this in the other file compression 
> modules?

Python 3.8 has introduced BadGzipFile in gzip module, to replace their OSError.

lzma has used LZMAError from day one.

--

___
Python tracker 

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2020-09-11 Thread Bug Reporter


Bug Reporter  added the comment:

I followed Vladyslav Bondar's 2020-09-11 09:10:30 recommendations and it worked:
Tests result: SUCCESS

Thank you.

It is not clear though how Canonical built its python-3.8.2 which comes with 
Ubuntu-20.04. Does anyone know someone at Canonical to ask this question?

--
versions: +Python 3.8 -Python 3.10

___
Python tracker 

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



[issue41770] Import module doesn't updated

2020-09-11 Thread pmp-p


Change by pmp-p :


--
nosy:  -pmpp

___
Python tracker 

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



[issue41770] Import module doesn't updated

2020-09-11 Thread pmp-p


pmp-p  added the comment:

Hi, you just need to call del sys.modules['xxx'] and have a look at 
https://docs.python.org/3.7/library/importlib.html#importlib.invalidate_caches 

before importing again

--
nosy: +pmpp

___
Python tracker 

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



[issue41770] Import module doesn't updated

2020-09-11 Thread chen-y0y0


New submission from chen-y0y0 :

# I create a module:
# \sys.path\xxx.py
a = 9
# And:
>>> import xxx
>>> xxx.a
9
# I delete this imported module and modified this module:
del xxx
# \sys.path\xxx.py
a = 9
b = 8
# And re-import:
>>> import xxx
>>> xxx.b
# But:
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: type object 'xxx' has no attribute 'b'

--
components: Windows
messages: 376766
nosy: paul.moore, prasechen, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Import  module doesn't updated
type: resource usage
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



[issue41762] Documentation job fails on CIs: duplicate token description of format_spec

2020-09-11 Thread Dong-hee Na


Dong-hee Na  added the comment:

>>> sphinx.__version__
'3.2.1

I can reproduce this issue consistantly on my local machine with this 
environment.

--
nosy: +corona10

___
Python tracker 

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



[issue41769] Positional arguments which use store boolean actions do not behave as other actions.

2020-09-11 Thread Rafael Guterres Jeffman


New submission from Rafael Guterres Jeffman :

argparse allow the use of `store_true` and `store_false` for positional 
arguments, and although it is weird, it should be fine, but using either action 
raises a behavior I believe is wrong.

Given the following Python code:

```
import argparse

arg = argparse.ArgumentParser()
arg.add_argument("opt", action="store_false")

arg.parse_args(["-h"])
```

The output is:

```
usage: t.py [-h]

positional arguments:
  opt

optional arguments:
  -h, --help  show this help message and exit
```

Note that the positional argument is not shown in the `usage` line.

When any string parameter is given, the result is:

```
usage: t.py [-h]
t.py: error: unrecognized arguments:
```

(add to the end of the output the value of the argument.)

Even if the use of a positional value is not the best way to describe boolean 
parameter (optional arguments provide a much better interface for such values), 
if argparse is to support positional boolean values they should work as other 
positional arguments.

I'd suggest raising an error if store_true or store_false is used along with 
positional values.

--
components: Library (Lib)
messages: 376764
nosy: rjeffman
priority: normal
severity: normal
status: open
title: Positional arguments which use store boolean actions do not behave as 
other actions.
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



[issue2651] Strings passed to KeyError do not round trip

2020-09-11 Thread Anthony Sottile


Anthony Sottile  added the comment:

(I know this is old and closed but I've just run into the same thing with 
pwd.getpwnam in issue41767)


KeyError: "getpwnam(): name not found: 'test'"


would it be possible / make sense to extend `KeyError` with a 
named-only-argument which would preserve the raw string in this case?

something like (yeah the name is probably not great, I haven't had time to 
think much about this)

raise KeyError("getpwnam(): name not found 'test'", preserve_msg=True)

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue41767] KeyError exception is more difficult to read due to quoting

2020-09-11 Thread Anthony Sottile


Change by Anthony Sottile :


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

___
Python tracker 

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



[issue41767] KeyError exception is more difficult to read due to quoting

2020-09-11 Thread Martin Panter


Martin Panter  added the comment:

Perhaps a duplicate of Issue 2651, closed because it was too hard to fix 
without breaking compatibility.

--
nosy: +martin.panter
superseder:  -> Strings passed to KeyError do not round trip

___
Python tracker 

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



[issue41768] unittest.mock spec calls class properties

2020-09-11 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



[issue41760] 3.8.6 rc1 documentation fails to build with sphinx 3.2.1

2020-09-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +vstinner

___
Python tracker 

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



[issue41755] Docs: Please remove `from distutils.core import setup`

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

There is discussion on pydev about formally deprecating distutils, which would 
deprecate that snippet.

--
nosy: +dstufft, eric.araujo, terry.reedy

___
Python tracker 

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



[issue41649] Can't pass Path like objects to subprocess api's on Windows.

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I closed #41753 as a duplicate of this.  

On that issue, Eryk Sun said "The underlying subprocess.Popen class was updated 
in 3.8 to support path-like objects in `args` (with shell=False) and 
`executable` on Windows [1]. This change was not backported to 3.6 and 3.7."

The latter is because 3.6 and 3.7 only get security patches.  Jani, please 
verify that this is still an issue with 3.8 and/or 3.9.

--
nosy: +terry.reedy
versions:  -Python 3.5, 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



[issue41753] subprocess.run on windows does not convert path to string

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Also, 3.7 only get security patches.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41753] subprocess.run on windows does not convert path to string

2020-09-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Can't pass  Path like objects to subprocess api's on Windows.

___
Python tracker 

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



[issue41768] unittest.mock spec calls class properties

2020-09-11 Thread melwitt


Change by melwitt :


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

___
Python tracker 

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



[issue41749] Allow omission of imghdr.what file arg if bytes are given

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The opening message confused me by using 'need' as 'currently required to call' 
rather than 'required to compute (test) and necessarily needed to call'; but 
after reading the code, I believe I understand and modified title to match.  
More simply, one could call what(h=b'...') after the change instead of 
what(None, b'...').  This is the change in the tests (but the old form must 
still be tested also).

I don't see how the change would affect correct legacy use.  (The TypeError to 
ValueError change is wrong, and I don't understand the other exception change.) 
 However, what('') should get the same error as currently (see additional 
change in review).

However, what is very problemmatic is requiring 1 of 2 different arguments.  
For range, the first parameter is really 'start_or_stop', an int either way, 
with the interpretation depending on the presence of a second.  This is a 
nuisance for understanding, but a convenience in usage.  But I think requiring 
an argument (usually) passed positionally or an argument that now has to be 
passed by keyword, with an arbitrary letter name, is worse and less justified.  
So my current view is that this change should be rejected.

--
nosy: +terry.reedy
title: Little improve on imghdr library -> Allow omission of imghdr.what file 
arg if bytes are given
type: behavior -> enhancement

___
Python tracker 

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



[issue41768] unittest.mock spec calls class properties

2020-09-11 Thread melwitt


New submission from melwitt :

When async magic method support was added to unittest.mock.Mock to address 
issue #26467, it introduced a getattr call [1] that causes class properties to 
be called when the class is used as a mock spec.

This caused a problem for a test in my project when running with Python 3.8 
where previously the test worked OK with Python 3.6.

The test aims to verify that a class instance is not created if the called code 
path does not access the class property and thus the class will not create a 
heavy object unless it's needed (lazy create on access via @property).

As of Python 3.8, the @property is always called and is called by the mock spec 
process itself, even though the code path being tested does not access the 
class @property.

Here is a code snippet that illustrates the @property calling from the mock 
spec alone:

class SomethingElse(object):
def __init__(self):
self._instance = None

@property
def instance(self):
if not self._instance:
self._instance = 'object'

...

def test_property_not_called_with_spec_mock(self):
obj = SomethingElse()
self.assertIsNone(obj._instance)
mock = Mock(spec=obj)
self.assertIsNone(obj._instance)

$ ./python -m unittest -v 
unittest.test.testmock.testmock.MockTest.test_property_not_called_with_spec_mock
test_property_not_called_with_spec_mock 
(unittest.test.testmock.testmock.MockTest) ... FAIL

==
FAIL: test_property_not_called_with_spec_mock 
(unittest.test.testmock.testmock.MockTest)
--
Traceback (most recent call last):
  File "/home/vagrant/cpython/Lib/unittest/test/testmock/testmock.py", line 
2173, in test_property_not_called_with_spec_mock
self.assertIsNone(obj._instance)
AssertionError: 'object' is not None

[1] 
https://github.com/python/cpython/blob/fb2718720346c8c7a0ad2d7477f20e9a5524ea0c/Lib/unittest/mock.py#L492

--
components: Library (Lib)
messages: 376757
nosy: melwitt
priority: normal
severity: normal
status: open
title: unittest.mock spec calls class properties
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



[issue41745] BoundArguments.arguments used in the recommended way to call a callable silently succeeds for nonexistent arguments

2020-09-11 Thread Julian Berman


Julian Berman  added the comment:

Not sure I agree with it being just a doc issue -- happy to clarify if 
something was unclear, not sure from your message if it was or if you disagree, 
but e.g.:

> However, your 'two' function takes no arguments, so valid values of args and 
> kwargs must be empty for them to be used in a call.  In all cases, args() and 
> kwargs() must look at the signature to see which key-value pairs they should 
> extract from arguments.

Right, and that's "dangerous" behavior to me -- BoundArguments.arguments will 
happily let you add arguments to it, but does no error checking at that point, 
so does not raise an exception if you typo an argument that isn't in the 
signature of the callable, and then when you try to call the callable (via the 
only way possible, namely using .args and .kwargs), that argument that was 
never added is just dropped.

Does that make sense? Or were you disagreeing with that being undesirable 
behavior?

--

___
Python tracker 

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



[issue41745] BoundArguments.arguments used in the recommended way to call a callable silently succeeds for nonexistent arguments

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Bound is created with 5 public attributes:
>>> dir(bound)
[..., 'apply_defaults', 'args', 'arguments', 'kwargs', 'signature']
>>> bound.args
()
>>> bound.arguments
{}
>>> bound.kwargs
{}
msg376578: I don't understand 'non-existent' arguments,  Nor 'what 
happened...print... ignored' as there is no previous print.

msg376590: Given " Changes in arguments will reflect in args and kwargs.", I 
agree that changes to 'arguments' *apparently* not being reflected in 'args' 
and 'kwargs' is initally a bit puzzling
.
>>> bound.kwargs == bound.arguments
True
>>> bound.arguments['something'] = 'guess'
>>> bound.kwargs
{}
>>> bound.arguments
{'something': 'guess'}

However, your 'two' function takes no arguments, so valid values of args and 
kwargs must be empty for them to be used in a call.  In all cases, args() and 
kwargs() must look at the signature to see which key-value pairs they should 
extract from arguments.

>>> def f(a): pass

>>> signature(f).bind()  # Must pass value arguments
Traceback (most recent call last):
...
TypeError: missing a required argument: 'a'
>>> b = signature(f).bind(3)
>>> b.arguments
{'a': 3}
>>> b.args
(3,)  # Because 'a' is positional.
>>> b.kwargs
{}  # Because 'a' is not keyword only.
>>> b.arguments['a']=5
>>> b.args
(5,)  # Legitimate change reflected here.

Perhaps the doc could be improved, but I have no particular suggestion.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, terry.reedy

___
Python tracker 

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



[issue41767] KeyError exception is more difficult to read due to quoting

2020-09-11 Thread Anthony Sottile


New submission from Anthony Sottile :

For example:

>>> import pwd
>>> pwd.getpwnam("test")
Traceback (most recent call last):
  File "", line 1, in 
KeyError: "getpwnam(): name not found: 'test'"


An improvement would be something which doesn't have the extra set of quotes 
such as:

>>> import pwd
>>> pwd.getpwnam("test")
Traceback (most recent call last):
  File "", line 1, in 
KeyError: getpwnam(): name not found: 'test'



I understand this is due to the `KeyError` repr, I wonder if something could be 
done to improve this (maybe a subclass of KeyError? maybe a new  optional 
named-only argument to KeyError?)


Seems there are others which could be improved here as well:

>>> import unicodedata
>>> unicodedata.lookup('zzz')
Traceback (most recent call last):
  File "", line 1, in 
KeyError: "undefined character name 'zzz'"

--
messages: 376754
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: KeyError exception is more difficult to read due to quoting
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



[issue41646] shutil.copy documentation should clarify support for path-like objects

2020-09-11 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 4.0 -> 5.0
pull_requests: +21263
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22208

___
Python tracker 

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



[issue41729] test_winconsoleio fails and hangs on Windows

2020-09-11 Thread Steve Dower


Steve Dower  added the comment:

No objections. I'd guess it was a typo.

--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-09-11 Thread Steve Dower


Steve Dower  added the comment:

If you look at the PR into 3.9, it includes a test for this exact case. Start 
by copying that into 3.10 and then make it pass and everything should be good :)

--

___
Python tracker 

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



[issue41742] Request for docs.python.org/3/library/configparser.html#exceptions improvement

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

https://docs.python.org/3/library/configparser.html#exceptions, like similar 
sections for other module docs, lists and explains the non-builtin exceptions 
defined and used in the module.  Functions in all modules can potentially raise 
various builtin exceptions, and some of these may be mentioned.  They are all 
documented in a beginning chapter the library doc, which users are expected to 
be familiar with.

That said, I vaguely remember at least some Exceptions sections beginning with 
some like 'Additional exceptions defined in this module.'  If you or someone 
thinks it worthwhile enough to check other modules, using the left sidebar ToC, 
to find such examples, I will consider making a PR.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41672] imaplib: wrong return type documented

2020-09-11 Thread Norbert Cyran


Norbert Cyran  added the comment:

@corona10 PR added: https://github.com/python/cpython/pull/22207

--

___
Python tracker 

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



[issue41672] imaplib: wrong return type documented

2020-09-11 Thread Norbert Cyran


Change by Norbert Cyran :


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

___
Python tracker 

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



[issue41737] Improper NotADirectoryError when opening a file in a fake directory

2020-09-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: Improper NotADirectoryError when opening a file under a fake directory 
-> Improper NotADirectoryError when opening a file in a fake directory

___
Python tracker 

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



[issue25963] strptime not parsing some timezones

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue26007] Support embedding the standard library in an executable

2020-09-11 Thread Brett Cannon


Brett Cannon  added the comment:

Update: PEP 432 was withdrawn, so this issue is now languishing and not blocked 
on something else.

--

___
Python tracker 

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



[issue25912] Use __spec__.__name__ instead of __name__ in the docs where appropriate

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue41731] test_cmd_line_script fails with verbosity level more than 1

2020-09-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue26007] Support embedding the standard library in an executable

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue25682] __package__ not set to None under pdb in Python 3

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
components: +Library (Lib) -Extension Modules
nosy:  -brett.cannon

___
Python tracker 

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



[issue41766] Python3.10 (x64) crashes after flake8/pyflakes on Windows

2020-09-11 Thread neonene


Change by neonene :


--
nosy: +pablogsal, vstinner -paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue41731] test_cmd_line_script fails with verbosity level more than 1

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I verified with master on Win10 debug 32 build. The relevant lines, 147-151, are

if verbose > 1:
print('Output from test script %r:' % script_exec_args)
print(repr(err))
print('Expected output: %r' % expected_msg)
self.assertIn(expected_msg.encode('utf-8'), err)

Normally, 'script_exec_args' is singular, the absolute file name to be 
executed.  In the two failing cases, file 'name' is an import name, preceded by 
-m.  Line 148 prints an informational header, when very verbose is requested, 
that only serves to identify the following lines. It is *not* tested.  
Therefore, we need not worry about the exact format, just avoiding a spurious 
error.  The following is equivalent except when the value is a list (which 
should have been a tuple), when is prints without error:

print(f'Output from test script {script_exec_args!r:}')

"Output from test script ['-m', 'test_pkg']:" seems clear enough for any human 
reader.I ran entire suite with -vv and did not find any other new, 
unexpected errors.  PR to follow shortly.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41766] Python3.10 (x64) crashes after flake8/pyflakes on Windows

2020-09-11 Thread neonene


New submission from neonene :

On Python3.10(64bit only) for Windows,
flake8 (with .pyc cache) frequently crashes after output.

e.g:
python -m flake8   c:/Python3/Lib/turtle.py
python -m pyflakes c:/Python3/Lib/turtle.py

I think I encountered the crash after PR21293 applied.
(bpo-41194: "Convert _ast extension to PEP 489")

--
components: Interpreter Core, Windows
messages: 376747
nosy: neonene, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python3.10 (x64) crashes after flake8/pyflakes on Windows
type: crash
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



[issue41765] XFCE task switcher shows 'Tk' insteadl of Window title

2020-09-11 Thread Mark Summerfield


New submission from Mark Summerfield :

This tiny test application illustrates the problem:
```python
#!/usr/bin/env python3
import tkinter as tk
app = tk.Tk()
app.withdraw()
app.title('Test App')
app.deiconify()
app.mainloop()
```
When run on Linux with XFCE the task bar entry shows the text 'Test App', but 
the task switcher shows 'Tk' rather than the title text.

--
components: Tkinter
messages: 376745
nosy: mark
priority: normal
severity: normal
status: open
title: XFCE task switcher shows 'Tk' insteadl of Window title
type: behavior
versions: Python 3.6, Python 3.8

___
Python tracker 

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



[issue41725] bz2 would use a dedicated exception for data error

2020-09-11 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

An OSError for a file the OS can read seems a bit off.  What is the 
accompanying message?  Would something like ValueError("bz2 compressor failed 
with BZ_DATA_ERROR") be better? 

Michał, are there precedents or models for this in the other file compression 
modules?

--
nosy: +serhiy.storchaka, terry.reedy
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



[issue25343] Document atomic operations on builtin types

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue25467] Put “deprecated” warnings first

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue25509] PyImport_ImportModule inaccurately described

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
keywords: +easy

___
Python tracker 

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



[issue25509] PyImport_ImportModule inaccurately described

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
versions: +Python 3.10 -Python 3.5

___
Python tracker 

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



[issue25509] PyImport_ImportModule inaccurately described

2020-09-11 Thread Brett Cannon


Brett Cannon  added the comment:

https://github.com/python/cpython/blob/45b34a04a577aa49fa4825421758c3e8eaa1625d/Python/import.c#L1474-L1485
 shows that the docs could be simplified to point out that 
`PyImport_ImportModule()` is a wrapper around `PyImport_Import()` which takes 
`const char *`.

--

___
Python tracker 

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



[issue25643] Python tokenizer rewriting

2020-09-11 Thread Brett Cannon


Brett Cannon  added the comment:

@serhiy: did you still want to commit this?

--

___
Python tracker 

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



[issue25330] Docs for pkgutil.get_data inconsistent with semantics

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +twouters

___
Python tracker 

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



[issue41729] test_winconsoleio fails and hangs on Windows

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Steve, as author of the file and line in question, do you have any objection to 
changing it?

--

___
Python tracker 

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



[issue25330] Docs for pkgutil.get_data inconsistent with semantics

2020-09-11 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue27071] unittest.TestCase.assertCountEqual is a very misleading name

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Issue 38240 was closed as a duplicate of this.  After reconsidering, I agree 
with leaving the name alone.  Changing test assertXXX method names is a big 
nuisance, which we have done enough of.

If one is using IDLE,
>>> unittest.TestCase.assertCountEqual(
displays a boxed calltip with the signature and the two line summary that seems 
clear enough to me.  Good names are good; so are good docstring summaries.

|(self, first, second, msg=None)   |
|Asserts that two iterables have the same elements, the same number of |
|times, without regard to order.   |


--

___
Python tracker 

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



[issue38240] assertCountEqual is horribly misleading, sounds like only counts are being compared

2020-09-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.10 -Python 3.7

___
Python tracker 

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



[issue38240] assertCountEqual is horribly misleading, sounds like only counts are being compared

2020-09-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Vitaly, when you repost to posts by email, please delete the post you are 
responding to, expect possible for a particular line.  The full post is already 
here on the web page above the response, and a duplicate copy is just noise 
that wastes screen space.

--
nosy: +terry.reedy
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue41759] ElementTree.parse gives error message about missing1 required positional argument: 'source' but it is there

2020-09-11 Thread Freek de Kruijf


Freek de Kruijf  added the comment:

Op vrijdag 11 september 2020 17:06:43 CEST schreef u:
> Serhiy Storchaka  added the comment:
> 
> It was not clear what you do without code and full traceback.
> 
> The example uses *function* parse() from *module* ElementTree. Your code
> seems uses *method* parse() of *class* ElementTree.
> 
> https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.Eleme
> ntTree.parse
> https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.Elem
> entTree.ElementTree.parse

I have very little knowledge about class, instance and the other specific 
terms used in Python.

I just try to use a Python script, I found and need, and ran into this 
problem. What it does looks simple to me. As simple as the 3 line script I 
showed, which works.
Why does the larger script give this confusing error about a missing argument, 
which is present? It is a file name or file object as it should.
What I understand is that tree becomes an instance. Of what?

Is the problem caused by using ElementTree in "import xml.etree.ElementTree as 
ElementTree". Should I use "import xml.etree.ElementTree as ET" and "tree = 
ET.parse(f)"?

-- 
fr.gr.

Freek de Kruijf

--

___
Python tracker 

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



[issue41756] Do not always use exceptions to return result from coroutine

2020-09-11 Thread Yury Selivanov


Yury Selivanov  added the comment:

@Mark
> Mark Shannon wrote: I don't think [the C-API function] should be public, as a 
> possible further improvement is to stop passing exceptions through a side 
> channel, but in result. Maybe we don't want to do that, but lets' not add to 
> the (already rather large) C-API.

Yeah, we can add it as a "private" function, I'm not entirely opposed to that. 
But... it would be great if Cython and C code could still depend on it and use 
it. And then... why should it be private? The corresponding Python API 
"gen.send()" and "gen.throw()" is public, why can't the C API be public too?

We will not fundamentally change generators (it would be a major backwards 
incompatible change), so committing to a good C API sounds reasonable.

@Mark
> Remember that PyIter_Next() is pretty much the same, though, and it has the 
> standard "return PyObject*" interface. These two would diverge then.

Maybe we should call it `_PyIter_Send()`?  While `.send()` is mostly about 
coroutines, regular generators have the method too, and it would be weird to 
call `_PyCoro_Send` on a generator object.

@Vladimir
> PYGEN_ERROR  | NULL | Regular PyErr_* functions should be used to work 
> with error case

Correct.

--

___
Python tracker 

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



[issue41764] sub function would not work without the flags but the search would work fine

2020-09-11 Thread Matthew Barnett


Matthew Barnett  added the comment:

The arguments are: re.sub(pattern, repl, string, count=0, flags=0).

Therefore:

re.sub("pattern","replace", txt, re.IGNORECASE | re.DOTALL)

is passing re.IGNORECASE | re.DOTALL as the count, not the flags.

It's in the documentation and the interactive help.

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

___
Python tracker 

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



[issue41756] Do not always use exceptions to return result from coroutine

2020-09-11 Thread Vladimir Matveev


Vladimir Matveev  added the comment:

If I understand proposed shape of API correctly - it was not supposed to return 
exception via "result" so contract for new `PyGen_Send` function is something 
like:

Return value | result   | Comment
-
PYGEN_RETURN | not NULL | Returned value
PYGEN_NEXT   | not NULL | Yielded value
PYGEN_ERROR  | NULL | Regular PyErr_* functions should be used to work with 
error case

--

___
Python tracker 

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



[issue41764] sub function would not work without the flags but the search would work fine

2020-09-11 Thread ali


New submission from ali :

it would work like this sub("pattern","replace", txt, flags= re.IGNORECASE | 
re.DOTALL)
but it wouldnt work like this  sub("pattern","replace", txt, re.IGNORECASE | 
re.DOTALL)

--
components: Regular Expressions
messages: 376734
nosy: bayat, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: sub function would not work without the flags but the search would work 
fine
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



[issue24792] zipimporter masks import errors

2020-09-11 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Library (Lib)
type: enhancement -> behavior
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.4, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue24792] zipimporter masks import errors

2020-09-11 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +patch
nosy: +iritkatriel
nosy_count: 6.0 -> 7.0
pull_requests: +21259
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22204

___
Python tracker 

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



[issue41763] IDLE: scale font to Windows' "zoom" factor

2020-09-11 Thread E. Paine


New submission from E. Paine :

Following #33656, IDLE now "lies" to Windows and declares it has system DPI 
awareness to achieve a *sharper* look. System dpi is in effect:
DPI_AWARENESS_UNAWARE * Windows' zoom factor

Therefore, for IDLE to scale to the Windows' zoom/scale factor (System > 
Display > Scale and layout > Change the size of text, apps and other items), we 
need multiply the user's chosen font size by the zoom factor.

Unfortunately I cannot quote the docs about the multiplication I gave above but 
have extensively tested and found this to hold true (the docs are not very 
explanatory but a link and small snippet can be found below):

DPI_AWARENESSReturn value
DPI_AWARENESS_UNAWARE96
DPI_AWARENESS_SYSTEM_AWARE   The system DPI.
[https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdpiforwindow]

We can use the GetDpiForWindow function to get the system dpi and divide it by 
96 (DPI_AWARENESS_UNAWARE) to get the scale factor for the font. This keeps 
IDLE sharp while allowing it to respect the user's scaling preferences.

I was not intending for this to not be an option (it would happen on any 
Windows system unless the user digs through the source), though appreciate that 
it could cause a significant change on first-load.

I considered adding this logic to the idlelib.run.fix_scaling method (which 
already modifies tkinter font size) but thought that users would not want this 
if their application was not set as DPI aware so settled on extending the 
idlelib.config.IdleConf.GetFont method instead.

My motivation for this is that currently that the user has to manually change 
their font size to match their Windows zoom factor (IDLE, without the user 
changing their font size, remains the same size regardless of what setting the 
user chooses as their scale factor). I have prepared a branch if this change is 
something that would interest you Terry.

Eryk, I have nosied you as I believe you are the person for Windows API calls 
(please do remove yourself if I am wrong).

--
assignee: terry.reedy
components: IDLE
messages: 376733
nosy: epaine, eryksun, taleinat, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: scale font to Windows' "zoom" factor
type: enhancement
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



[issue28694] tkinter interface to fontchooser

2020-09-11 Thread Mark Roseman


Change by Mark Roseman :


--
nosy: +markroseman

___
Python tracker 

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



[issue41759] ElementTree.parse gives error message about missing1 required positional argument: 'source' but it is there

2020-09-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It was not clear what you do without code and full traceback.

The example uses *function* parse() from *module* ElementTree. Your code seems 
uses *method* parse() of *class* ElementTree.

https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.parse
https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.ElementTree.parse

--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-09-11 Thread Paul Moore


Paul Moore  added the comment:

I think this reproduces the underlying issue:

>>> import zipfile
>>> from pathlib import Path
>>> p = zipfile.Path("tst.zip")
>>> Path("tst.zip").unlink()
Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\UK03306\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 
1321, in unlink
self._accessor.unlink(self)
PermissionError: [WinError 32] The process cannot access the file because it is 
being used by another process: 'tst.zip'
>>>

Basically, zipfile.Path objects don't have any way to close the underlying 
zipfile, so you have to delete the path object to free up the file for deletion.

In the context of importlib, maybe permanently holding a reference to the 
zipfile.Path object can't work, and it needs to be re-opened each time it's 
needed?

--

___
Python tracker 

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



[issue41025] C implementation of ZoneInfo cannot be subclassed

2020-09-11 Thread Paul Ganssle

Paul Ganssle  added the comment:

This is fixed in the 3.9 and master branches, it needs to be cherry-picked into 
the 3.9.0 release (at Łukasz's discretion, of course).

Łukasz: If you cherry-pick GH-20965/GH-21876 into the 3.9.0 release, please 
also cherry-pick GH-21907/GH-21912, since that fixes the refleak. (PRs are 
listed as "master"/"backport" since I don't know your workflow).

--

___
Python tracker 

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-09-11 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

> I haven't yet figured out whether there's a convenient way for the reader to 
> not keep the ZIP open for as long as it exists, but I think that's going to 
> be the safest fix.

You may be right here. I don't fully understand the repro, but it seems to me 
like you're trying to delete a zip file while you have resources open in that 
zip file. I think we need a separate issue to capture the underlying defect.

--

___
Python tracker 

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



[issue31686] GZip library doesn't properly close files

2020-09-11 Thread Irit Katriel


Irit Katriel  added the comment:

As for the bug you report - I was unable to reproduce it on windows (python 
3.10) or linux (python 3.7).  Can you check again to see if you still observe 
it, and give info on the system and python version if so?

--

___
Python tracker 

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



[issue41759] ElementTree.parse gives error message about missing1 required positional argument: 'source' but it is there

2020-09-11 Thread Freek de Kruijf


Freek de Kruijf  added the comment:

Op vrijdag 11 september 2020 11:31:29 CEST schreef u:
> Serhiy Storchaka  added the comment:
> 
> parse() is an instance method. It should be called as tree.parse(f) (where
> tree is an instance of ElementTree), not ElementTree.parse(f).
> 
> --
I have no idea how to make tree an instance.
Reading the documentation,
https://docs.python.org/2/library/xml.etree.elementtree.html,
it shows as an example:

import xml.etree.ElementTree as ET
tree = ET.parse('country_data.xml')

which is exactly what the program looks like and what my small python script 
does without an error.

-- 
fr.gr.

Freek de Kruijf

--

___
Python tracker 

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



  1   2   >