[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-11 Thread Eryk Sun


Eryk Sun  added the comment:

> We'd CreateFile the file and then immediately pass it to 
> _open_osfhandle

Unlike _wopen, _open_osfhandle doesn't truncate Ctrl+Z (0x1A) from the last 
byte when the flags value contains _O_TEXT | _O_RDWR. _wopen implements this to 
allow appending data in text mode. The implementation is based on GetFileType 
(skip pipes and character devices), _lseeki64, _read, and _chsize[_s].

O_TEXT (ANSI text mode) has to be supported for now, but it doesn't properly 
fit in Python 3. The io module opens files using the CRT's binary mode. It 
doesn't implement newline translation for bytes I/O. And io.TextIOWrapper 
doesn't support Ctrl+Z as a logical EOF marker. 

As long as it's supported, O_TEXT should be made the default in os.open (but 
not in msvcrt.open_osfhandle), independent of the CRT default fmode (i.e. 
_get_fmode and _set_fmode). Many callers already assume that's the case. For 
example, tempfile.mkstemp with text=True uses tempfile._text_openflags, which 
doesn't include os.O_TEXT. That assumption is currently wrong if 
_set_fmode(_O_BINARY) is called.

Thankfully, Python has never documented support for the _O_WTEXT, _O_U16TEXT, 
and _O_U8TEXT Unicode text modes in os.open. To my knownledge, there is no 
reasonable way to reimplement these modes. The C runtime doesn't expose a 
public interface to modify a file's internal text and Unicode modes, and 
_open_osfhandle only supports ANSI text mode. If _Py_wopen is implemented, it 
will have to fail the Unicode (UTF-16 or UTF-8) modes with EINVAL. Even without 
_Py_wopen, I'd prefer to modify os.open to fail them because wrapping a 
Unicode-mode fd with io.FileIO doesn't function reliably. FileIO doesn't 
guarantee wchar_t aligned reads and writes, which the CRT requires in Unicode 
mode.

--

___
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 Stefan Behnel


Stefan Behnel  added the comment:

Big +1 from me, too, for the same reasons Yury gave.

--
nosy: +scoder

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



[issue41758] turtledemo.colormixer crashes with a stack overflow

2020-09-11 Thread Tushar Sadhwani


New submission from Tushar Sadhwani :

turtledemo.colormixer crashes after (what i'm assuming) 1000 changes to the 
state of a color bar.


# Error:

PS C:\Users\tusha> python -m turtledemo.colormixer
Fatal Python error: Cannot recover from stack overflow.
Python runtime state: initialized

Current thread 0x0f74 (most recent call first):
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 2761 in coords
  File "", line 1 in coords
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 755 in _pointlist
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 3158 in _goto
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 1826 in sety
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtledemo\colormixer.py",
 line 29 in shift
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 655 in eventfun
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 1883 in __call__
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 1305 in update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 562 in _update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 2662 in _update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 3195 in _goto
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 1826 in sety
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtledemo\colormixer.py",
 line 29 in shift
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 655 in eventfun
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 1883 in __call__
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 1305 in update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 562 in _update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 583 in _bgcolor
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 1240 in bgcolor
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtledemo\colormixer.py",
 line 35 in setbgcolor
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtledemo\colormixer.py",
 line 32 in shift
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 655 in eventfun
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 1883 in __call__
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 1305 in update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 562 in _update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 2662 in _update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 3195 in _goto
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 1826 in sety
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtledemo\colormixer.py",
 line 29 in shift
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 655 in eventfun
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 1883 in __call__
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 1305 in update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 562 in _update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 583 in _bgcolor
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 1240 in bgcolor
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtledemo\colormixer.py",
 line 35 in setbgcolor
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtledemo\colormixer.py",
 line 32 in shift
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 655 in eventfun
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 1883 in __call__
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\tkinter\__init__.py", 
line 1305 in update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 562 in _update
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 583 in _bgcolor
  File "C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtle.py", 
line 1240 in bgcolor
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-amd64\lib\turtledemo\colormixer.py",
 line 35 in setbgcolor
  File 
"C:\Users\tusha\.pyenv\pyenv-win\versions\3.8.1-

[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2020-09-11 Thread Vladyslav Bondar


Vladyslav Bondar  added the comment:

This is about openssl configuration in Ubuntu. In the latest Ubuntu, they 
disabled TLS 1.0/1.1.

So to enable it back there is a workaround (taken from StackOverflow):

You should modify openssl config: /etc/ssl/openssl.cnf

You need to add this to the beginning of your config file:

openssl_conf = default_conf

And then this to the end:

[ default_conf ]

ssl_conf = ssl_sect

[ssl_sect]

system_default = ssl_default_sect

[ssl_default_sect]
MinProtocol = None
CipherString = DEFAULT:@SECLEVEL=1

--

___
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


New submission from Freek de Kruijf :

In a function definition I have the following piece of code:

try:
with open(requests,'rt') as f:
tree = ElementTree.parse(f)

On execution I got:

Traceback (most recent call last):
   File "/srv/www/bin/web.py", line 362, in 
 build_db()
   File "/srv/www/bin/web.py", line 58, in build_db
 db_builder.build_DB()
   File "/srv/www/bin/db_builder.py", line 190, in build_DB
 tree = ElementTree.parse(f)
 TypeError: parse() missing 1 required positional argument: 'source'

There is an assignment for requests like
requests = '..' + os.path.sep + "/etc/signatures.xml"
This gives requests the value ..//etc/signatures.xml while the program runs in 
/srv/www/bin/

When I run the small python script like:

import xml.etree.ElementTree as ElementTree
with open('/srv/www/etc/signatures.xml','rt') as f:
tree = ElementTree.parse(f)

all is well.
Apparently open(requests,'rt') does not raise an error.

--
components: Extension Modules
messages: 376706
nosy: f.de.kruijf
priority: normal
severity: normal
status: open
title: ElementTree.parse gives error message about missing1 required positional 
argument: 'source' but it is there
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



[issue41730] Show deprecation warnings for tkinter.tix

2020-09-11 Thread wyz23x2


wyz23x2  added the comment:

Ping? We will miss 3.8.6/3.9.0rc2 if it's too late!

--

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Compared to Python 3.8, PR 21961 has no regression related to subinterpreters.

Oh. I forgot that static types cannot be modified (in Python, but it's possible 
in C). So my PR still changed the behavior compared to 3.8:
---
import _testcapi
import _ast
res = _testcapi.run_in_subinterp("import _ast; _ast.AST.x = 1")
if res != 0:
raise Exception("bug")
print(_ast.AST.x)
---

On Python 3.8, this code snippet fails with:

TypeError: can't set attributes of built-in/extension type '_ast.AST'

On master, it is possible to modify or add an _ast.AST attribute. Since PR 
21961 moves back to a global strange, Petr is correct that a subinterpreter can 
now modify the state of another subinterpreter the _ast.AST type.

So I modified my PR 21961 to revert partially the change which converted 
AST_type type from a static type to a heap type.

My PR 21961 converts AST_type back to a static type, to avoid these problems. 
Sadly, it makes _ast module incompatible with PEP 384, but the priority is to 
fix this 3rd regression. We can reconsider converting PEP 384 back to a heap 
type later, but we will have to be careful with not reintroducing all these 
bugs.

--

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

parse() is an instance method. It should be called as tree.parse(f) (where tree 
is an instance of ElementTree), not ElementTree.parse(f).

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



[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2020-09-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

issue38815 also reported similar issue in test_min_max_version_mismatch.

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


New submission from Matthias Klose :

the 3.8.6 rc1 documentation fails to build with sphinx 3.2.1:

[...]
reading sources... [ 98%] whatsnew/3.1
reading sources... [ 98%] whatsnew/3.2
reading sources... [ 98%] whatsnew/3.3
reading sources... [ 98%] whatsnew/3.4
reading sources... [ 98%] whatsnew/3.5
reading sources... [ 99%] whatsnew/3.6
reading sources... [ 99%] whatsnew/3.7
reading sources... [ 99%] whatsnew/3.8
reading sources... [ 99%] whatsnew/changelog
reading sources... [100%] whatsnew/index

/<>/Doc/tools/extensions/pyspecific.py:245: 
RemovedInSphinx40Warning: PyModulelevel is deprecated. Please check the 
implementation of 
  return PyModulelevel.run(self)
/<>/Doc/tools/extensions/pyspecific.py:277: 
RemovedInSphinx40Warning: PyClassmember is deprecated. Please check the 
implementation of 
  return PyClassmember.run(self)
/<>/Doc/tools/extensions/pyspecific.py:289: 
RemovedInSphinx40Warning: PyClassmember is deprecated. Please check the 
implementation of 
  return PyClassmember.run(self)
/<>/Doc/tools/extensions/pyspecific.py:271: 
RemovedInSphinx40Warning: PyModulelevel is deprecated. Please check the 
implementation of 
  return PyModulelevel.run(self)
/<>/Doc/tools/extensions/pyspecific.py:283: 
RemovedInSphinx40Warning: PyClassmember is deprecated. Please check the 
implementation of 
  return PyClassmember.run(self)
/<>/Doc/tools/extensions/pyspecific.py:302: 
RemovedInSphinx40Warning: PyClassmember is deprecated. Please check the 
implementation of 
  return PyClassmember.run(self)

Warning, treated as error:
/<>/Doc/library/string.rst:311:duplicate token description of 
sign, other instance in library/functions
make[1]: *** [Makefile:52: build] Error 2

--
components: Build
messages: 376711
nosy: doko
priority: normal
severity: normal
status: open
title: 3.8.6 rc1 documentation fails to build with sphinx 3.2.1
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



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

2020-09-11 Thread Matthias Klose


Change by Matthias Klose :


--
nosy: +ned.deily

___
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 STINNER Victor


STINNER Victor  added the comment:

Paul: What is the status of this issue? Is it already fixed? It is the release 
blocker priority.

--

___
Python tracker 

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



[issue41183] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.5.10 has been released, so I understand that this issue has been 
fixed. Thanks Christian Heimes for fixes ;-)

--
nosy: +vstinner
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



[issue40964] Connection to IMAP server cyrus.andrew.cmu.edu hangs

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

The tests have been disabled, so I understand that the "release blocker" 
priority is no longer needed. It would be nice to reenable these tests, but I 
consider that it should not block the next 3.9 release.

--
nosy: +vstinner
priority: release blocker -> 

___
Python tracker 

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



[issue41183] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

2020-09-11 Thread Larry Hastings


Larry Hastings  added the comment:

Nope, it's not fixed.

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

___
Python tracker 

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



[issue41761] multiprocessing.Queue prevents program exit when containing a reasonable amount of data

2020-09-11 Thread Dominik Schmid


New submission from Dominik Schmid :

Reproduction steps: run the attached queue_busted.py

expected result: 
"done." is printed and the program terminates.

actual result:
"done." is printed and the program does not terminate.

Documentation link for your convenience:
https://docs.python.org/3.7/library/multiprocessing.html#multiprocessing.Queue.close

The lowest to trigger the bug seems to be 1639 42's in the queue.
If I put numpy.array([42]) into the queue instead of 42, I need much fewer 
items to trigger the bug.
When q.close() is called explicitly, it always terminates but sometimes prints 
a BrokenPipeError.

Reproduced on windows (Python 3.7.2) and Debian (Python 2.7.16).

--
components: Library (Lib)
files: queue_busted.py
messages: 376716
nosy: Dominik Schmid
priority: normal
severity: normal
status: open
title: multiprocessing.Queue prevents program exit when containing a reasonable 
amount of data
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file49451/queue_busted.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


Change by STINNER Victor :


--
keywords: +patch
nosy: +vstinner
nosy_count: 6.0 -> 7.0
pull_requests: +21256
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22197

___
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


New submission from STINNER Victor :

https://travis-ci.com/github/python/cpython/jobs/383579366

Warning, treated as error:

/home/travis/build/python/cpython/Doc/library/string.rst:311:duplicate token 
description of format_spec, other instance in reference/lexical_analysis

--
assignee: docs@python
components: Documentation
messages: 376717
nosy: docs@python, vstinner
priority: normal
severity: normal
status: open
title: Documentation job fails on CIs: duplicate token description of 
format_spec
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



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

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

There are two format_spec definitions:

"format_spec ::=  
[[fill]align][sign][#][0][width][grouping_option][.precision][type]"
https://docs.python.org/dev/library/string.html#format-specification-mini-language

"format_spec   ::=  (literal_char | NULL | replacement_field)*"
https://docs.python.org/dev/reference/lexical_analysis.html#formatted-string-literals

--
nosy: +BTaskaya, pablogsal

___
Python tracker 

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



[issue40746] test_gdb failing on 32-bit armv7l when built with GCC -Og (fail on Raspbian on 3.9, regression from 3.8)

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

gdb doesn't work fully when Python is built with -Og. I don't think that there 
is much that we can do. I suggest to skip test_gdb on 32-bit ARM when Python is 
built with -Og.

I don't think that this regular requires the "release blocker" priority. It 
would be nice to fix but it should not hold the 3.9.0 final release.

--

___
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 STINNER Victor


STINNER Victor  added the comment:

The CI failed on the PR on the master branch: 
https://github.com/python/cpython/pull/21748 First, the Travis CI job didn't 
start. I closed/opened the issue: Travis CI ran. New issue: bpo-41762. Once 
bpo-41762 will be fixed, it should be possible to attempt again to merge this 
PR.

--
nosy: +vstinner

___
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 Stefan Behnel


Stefan Behnel  added the comment:

Copying some of the design discussion from the PR here 
(https://github.com/python/cpython/pull/22196/files#r486730457), because it 
belongs into the ticket.

Yury Selivanov proposed to add a new C-API function for this (naming changes by 
me):

typedef enum {PYGEN_RETURN, PYGEN_ERROR, PYGEN_NEXT} PyGenSendStatus;

PyGenSendStatus PyGen_Send(PyGenObject *gen, PyObject *arg, PyObject 
**result);

Mark Shannon and I agreed that the status code should be the return value, with 
some confusion whether "PyGen_" or "PyCoro_" would be appropriate prefixes.

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.

However, I think this will be demanded and used by extensions, including Cython 
implemented ones, so it seems better to make them use a public function than a 
private one.

Let's continue these lines of discussion here.

--

___
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 Matthias Klose


Change by Matthias Klose :


--
nosy: +lukasz.langa

___
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 failed to reproduce the issue locally. I tried:

cd Doc
make clean
make venv PYTHON=../python 
./venv/bin/python -m pip install sphinx==2.2.0 blurb python-docs-theme
make check suspicious html SPHINXOPTS="-q -W -j4"

--

___
Python tracker 

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



[issue41183] [3.5] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

2020-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.5.10 is not the last 3.5 release?

* https://devguide.python.org/#status-of-python-branches
* https://www.python.org/dev/peps/pep-0478/

--
title: Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures -> [3.5] 
Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

___
Python tracker 

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



[issue41183] [3.5] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

2020-09-11 Thread Larry Hastings


Larry Hastings  added the comment:

It depends on whether or not I get any more fixes for the rest of the month.  
(Theoretically 3.5 support ends on Sep 13, but I decided to extend it to the 
end of the month.)

I filed this on July 1, so it's already been two months, and the developer who 
would handle this has stopped replying.  If I don't get a fix for this issue 
before the end of the month, then 3.5.10 will be the last release of 3.5 and 
this will simply go unfixed.

--

___
Python tracker 

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



[issue35293] make doctest (Sphinx) emits a lot of warnings

2020-09-11 Thread Dong-hee Na


Change by Dong-hee Na :


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

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

The documentation states that: 

Calling a GzipFile object’s close() method does not close fileobj, since you 
might wish to append more material after the compressed data. This also allows 
you to pass an io.BytesIO object opened for writing as fileobj, and retrieve 
the resulting memory buffer using the io.BytesIO object’s getvalue() method.

(https://docs.python.org/3.8/library/gzip.html)


It's reasonable that, since you opened the file, you would also be responsible 
for closing it.

--
components: +Library (Lib)
nosy: +iritkatriel

___
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


Change by STINNER Victor :


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

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

Oh. It seems like the warning only occurs randomly!? It is gone on one of my PR.

--

___
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



[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



[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



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



[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



[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



[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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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: +twouters

___
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



[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



[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


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



[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



[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



[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



[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



[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



[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



[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


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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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


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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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



[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



[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



  1   2   >