[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue42024] Exception ignored in: .remove at 0x7f6a325f2ea0>

2020-10-12 Thread jayesh


New submission from jayesh :

Team,

I am getting python warning messages while run ansible.
Previously I was using python 3.5.3, but after read the below article, I 
upgraded it with python 3.5.4. 

ref: https://github.com/ansible/ansible/issues/21982

Still facing the same issues. Kindly find attached logs for the same and help 
us to solve this issue.

Thanks

--
files: pthon-warning-3.5.4.txt
messages: 378539
nosy: jayesh007
priority: normal
severity: normal
status: open
title: Exception ignored in: .remove at 0x7f6a325f2ea0>
type: compile error
versions: Python 3.5
Added file: https://bugs.python.org/file49513/pthon-warning-3.5.4.txt

___
Python tracker 

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



[issue42023] Argparse: Add a "display" arg

2020-10-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +paul.j3, rhettinger

___
Python tracker 

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



[issue41822] Document the meaning of values for sys.float_info.rounds

2020-10-12 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2020-10-12 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue42010] Generic types accept indexing/subscripting, causing confusion

2020-10-12 Thread Ken Jin


Ken Jin  added the comment:

Partly due to Python 3.9.0's nascency, I've not been able to find online cases 
of beginners getting confused by this specific behavior.

Wow I didn't know about integer variadics, assuming they make their way into 
3.11, I can see why it'd be better to leave that in for now.

I'm going to close the PR, and if there are no more discussions in the next 30 
days, I'll close this bug report too. Thanks for clarifying.

--

___
Python tracker 

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



[issue40422] Light refactor: create a common _Py_closerange API

2020-10-12 Thread Kyle Evans


Change by Kyle Evans :


--
pull_requests: +21651
pull_request: https://github.com/python/cpython/pull/22680

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-12 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I used random_bench.py to compare PR 22679 to Master, and the results are in 
bench_results.txt. Results were varied. I suppose this depends on what cases we 
want to optimize for.

--
Added file: https://bugs.python.org/file49512/random_bench.py

___
Python tracker 

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



[issue40422] Light refactor: create a common _Py_closerange API

2020-10-12 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 64eb259cc1e42a5f74b5911a518d2c50daa8d50b by Kyle Evans in branch 
'master':
bpo-40422: Move _Py_*_SUPPRESS_IPH bits into _Py_closerange (GH-22672)
https://github.com/python/cpython/commit/64eb259cc1e42a5f74b5911a518d2c50daa8d50b


--

___
Python tracker 

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



[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-10-12 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 1c217652b690c184b43d8e2b6529a60a14e64328 by Saiyang Gou in branch 
'3.9':
[3.9] bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py 
(GH-22619) (#22624)
https://github.com/python/cpython/commit/1c217652b690c184b43d8e2b6529a60a14e64328


--

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-12 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

PR 22679 is a draft that does the two-way algorithm but also adds both of the 
tricks from Fredrik's implementation: a bit-set "bloom filter" and remembering 
the skip-distance between some pair of characters.

--
Added file: https://bugs.python.org/file49511/bench_results.txt

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-12 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue42010] Generic types accept indexing/subscripting, causing confusion

2020-10-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

Have you observed actual users getting confused by this? (E.g. StackOverflow or 
mailing list posts.) I would assume that if you try to *do* anything with the 
resulting object it's going to cause a traceback, and from there it's pretty 
straightforward to debug the situation. (Maybe not for absolute beginners, but 
they have a lot of ways to confuse themselves. :-)

There are people working on proposals for "integer variadics" that would 
actually give meaning to things like list[10] (or at least to A[10] and A[N, M] 
where A is a tensor type) so I am reluctant to forbid this now -- we might have 
to allow it in the next release.

--

___
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-10-12 Thread Vladimir Matveev


Change by Vladimir Matveev :


--
pull_requests: +21649
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/22677

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Eryk Sun


Eryk Sun  added the comment:

> So I'm +1 on fixing this by calling realpath.

In POSIX, calculate_path() in Modules/getpath.c calls calculate_argv0_path() 
before it calls calculate_read_pyenv(), and calculate_argv0_path() in turn 
calls resolve_symlinks(>argv0_path). Thus "pyvenv.cfg" isn't found 
and isn't used to find the standard library in POSIX when a virtual environment 
uses symlinks. Later on, "pyvenv.cfg" gets read by the site module, if 
importing the latter isn't skipped via -S. The site module sets sys._home to 
the `home` value, but sys._home only appears to be used by sysconfig when 
running from the build directory.

In Windows, calculate_path() in PC/getpathp.c could get the final (real) path 
for argv0_path before calling calculate_pyvenv_file(). Then, just like in 
POSIX, the environment's "pyvenv.cfg" file won't be found and won't be used to 
find the standard library when a virtual environment uses symlinks.

--

___
Python tracker 

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



[issue42020] interpreter hangs forever on invalid input

2020-10-12 Thread STINNER Victor


STINNER Victor  added the comment:

I don't see anything wrong with Python itself and I suggest to close the issue 
as "not a bug".

--

___
Python tracker 

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



[issue28002] ast.unparse can't roundtrip some f-strings

2020-10-12 Thread Shantanu


Shantanu  added the comment:

Bumping again!

--

___
Python tracker 

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



[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Henry Schreiner


Henry Schreiner  added the comment:

I tested before the patch, and I got 17 segfaults running a pybind11 module 20 
times. After the patch, I ran about 50 times and had no segfaults!

--

___
Python tracker 

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



[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread miss-islington


miss-islington  added the comment:


New changeset 8a12503b4532e33d590ecea7eb94cd0e6b0f1488 by Miss Skeleton (bot) 
in branch '3.9':
bpo-42015: Reorder dereferencing calls in meth_dealloc, to make sure m_self is 
kept alive long enough (GH-22670)
https://github.com/python/cpython/commit/8a12503b4532e33d590ecea7eb94cd0e6b0f1488


--

___
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-10-12 Thread Yury Selivanov


Yury Selivanov  added the comment:

> Also, in Include/abstract.h it should only be available for limited C API >= 
> 3.10:

Vladimir, could you please submit a PR?

> We now should discuss the behavior of PySend_Iter() if value is NULL. It is 
> not documented, the current behavior differs from the behavior for non-NULL 
> value, and it is used in the ceval loop.

IMO: I'd keep the behavior and just document it.

--

___
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-10-12 Thread Yury Selivanov


Change by Yury Selivanov :


--
status: closed -> open

___
Python tracker 

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



[issue42023] Argparse: Add a "display" arg

2020-10-12 Thread ThatXliner


New submission from ThatXliner :

In argparse, I've always wanted a way to make colored help text like those of 
poetry and pipenv. But argparse's show help isn't well documented (Therefore, I 
can't find a way to completely modify the help text), and the metavar arg isn't 
really helpful. I want to do something like this:

>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument("foo", help="To foo a bar", display="FOO")
>>> parser.print_help()

usage: main.py [-h] foo

positional arguments:
  FOO To foo a bar

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

>>>

That way, I can colorize the help output.

--
components: Library (Lib)
messages: 378526
nosy: ThatXliner
priority: normal
severity: normal
status: open
title: Argparse: Add a "display" arg
type: enhancement
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



[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 04b8631d84a870dda456ef86039c1baf34d08500 by Yannick Jadoul in 
branch 'master':
bpo-42015: Reorder dereferencing calls in meth_dealloc, to make sure m_self is 
kept alive long enough (GH-22670)
https://github.com/python/cpython/commit/04b8631d84a870dda456ef86039c1baf34d08500


--

___
Python tracker 

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



[issue42022] Allow ensurepip to work without bundled wheels

2020-10-12 Thread Filipe Laíns

New submission from Filipe Laíns :

Some Linux distributions, such as Debian, have guidelines against shipping 
things like prebuilt wheels.

Taking Debian as an example, they remove the pip and setuptools wheels and 
consequently break ensurepip. This also has some implications in the venv 
module.

As a way to fix this, I would like to propose for ensurepip to install .pth 
files pointing to the pip and setuptools packages in purelib/platlib.

This behavior could either be switched on by a flag in the makefile or, maybe, 
if the wheels are not found.

Do you think this would be a reasonable approach?
Currently, we cannot rely on the ensurepip to work. Some projects that really 
need it are shipping a vendored version of the module.

--
components: Library (Lib)
messages: 378524
nosy: FFY00, dstufft, ncoghlan, p-ganssle, pradyunsg
priority: normal
severity: normal
status: open
title: Allow ensurepip to work without bundled wheels
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue42017] Add new type in typing

2020-10-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

You can easily define that yourself if you need it, though honestly the utility 
seems marginal.

--
resolution:  -> rejected
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



[issue34976] IDLE: Replace the search dialog with a search bar

2020-10-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Notepad++ Find by marks all matches in the current doc as 'found', with a 
distinct (darker) highlight for the 'selected' found.  Double clicking selects 
a word, as in IDLE, *and* finds all matches.  One can then either 
cut/copy/replace the selection, as in IDLE, *or* look at other matches in the 
file.

Notepad++ also offers options to (in addition) 'Find all' in current doc or all 
opened docs.  This lists the hits in a separate box, as with IDLE's Find all.  
Double clicking on a hit line goes to that line.  (Easier than RtClick/goto.)

I suspect I would find live highlighting annoying.  Why would having all 'a's 
on a page light up when I type 'a' be a plus?  But I will try your patch when 
we are ready to focus on search/replace/find.  

I have mentioned elsewhere that I might go for a minimal search box on the 
status line separate from the dialog(s).

--

___
Python tracker 

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



[issue42021] Fix possible ref. leaks in _sqlite3 module initialisation

2020-10-12 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
type:  -> behavior

___
Python tracker 

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



[issue34976] IDLE: Replace the search dialog with a search bar

2020-10-12 Thread Tal Einat


Tal Einat  added the comment:

I should mention one *major* advantage of using a search/replace bar: Live 
highlighting of matches *as you type*. It really is a vastly better experience; 
if you haven't tried it yet, please do.

--

___
Python tracker 

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



[issue42021] Fix possible ref. leaks in _sqlite3 module initialisation

2020-10-12 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue34976] IDLE: Replace the search dialog with a search bar

2020-10-12 Thread Tal Einat


Tal Einat  added the comment:

The version in the PR is modeled after similar features in IDEs, not browsers. 
I mentioned browsers since they are very commonly used, and to the best of my 
knowledge all modern browsers use search bars. Therefore, as a UI element, 
search bars are now commonplace, unsurprising, and require no training to use.

As for replace, while many IDEs use a bar, many word processors do indeed still 
use a dialog for search/replace, and I've seen text editors use a bar for 
search but a dialog for replace.

I first implemented this for my personal use, since I much prefer bars to 
dialogs. But I can see the argument that they can be harder to use for novice 
users.

If we decide not to go with this path, I'll try to extract some of the 
improvements made to the search engine, such as highlighting all matches, into 
a PR improving the existing search and replace dialogs.

--

___
Python tracker 

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



[issue42020] interpreter hangs forever on invalid input

2020-10-12 Thread Eryk Sun


Eryk Sun  added the comment:

In Windows 10 2004, CSI is currently supported by the console host 
(conhost.exe) if virtual-terminal mode is enabled. Windows Terminal Preview 
supports many more C1 control codes, as will conhost.exe in the next release of 
Windows 10. This should be 'fun' considering the C1 controls block isn't 
reserved by Windows filesystems. CMD and PowerShell depend on the C0 controls 
being reserved and depend on the C1 controls not being implemented. They don't 
implement any escaping of control characters when listing filenames in a 
directory, unlike a tradition POSIX shell. Now that the console and Windows 
Terminal implement C1 controls, maybe PowerShell can be updated to escape them 
in file listings, but I don't see what can be done for CMD, which doesn't 
support string literals with escape sequences.

--

___
Python tracker 

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



[issue42021] Fix possible ref. leaks in _sqlite3 module initialisation

2020-10-12 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue42020] interpreter hangs forever on invalid input

2020-10-12 Thread Eryk Sun


Eryk Sun  added the comment:

The terminal you're using apparently implements C1 controls [1]. U+009B is the 
Control Sequence Introducer (CSI) for ANSI escape sequences. U+0090 starts a 
Device Control String (DCS), and it gets terminated by U+009C, a String 
Terminator (ST). For example, in GNOME Terminal in Linux:

>>> print('spam\x9b4Deggs')
eggs

>>> print('spam\x90some DCS string\x9c')
spam

---

[1] https://en.wikipedia.org/wiki/C0_and_C1_control_codes

--
nosy: +eryksun

___
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-10-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Few things I forget about. The new C API function should be exported in 
PC/python3dll.c.

Also, in Include/abstract.h it should only be available for limited C API >= 
3.10:

#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A
...
#endif

We now should discuss the behavior of PySend_Iter() if value is NULL. It is not 
documented, the current behavior differs from the behavior for non-NULL value, 
and it is used in the ceval loop. We should document this case explicitly and 
maybe change the behavior if it would be more appropriate.

--

___
Python tracker 

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



[issue42021] Fix possible ref. leaks in _sqlite3 module initialisation

2020-10-12 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

Handle PyDict_SetItemString() errors in _sqlite3 init by dereferencing the item 
object and then goto error.

--
components: Library (Lib)
messages: 378516
nosy: erlendaasland
priority: normal
severity: normal
status: open
title: Fix possible ref. leaks in _sqlite3 module initialisation
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



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

2020-10-12 Thread Yury Selivanov


Yury Selivanov  added the comment:

With the latest PR now merged this issue can be closed. Please reopen if there 
are any other action items left.

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



[issue37209] Add what's new entries for pickle enhancements

2020-10-12 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue42020] interpreter hangs forever on invalid input

2020-10-12 Thread denis

New submission from denis :

Python 3.8.5, Python 3.7.3
When trying to print invalid unicode, interpreter goes to a completely 
unresponsive state

>>> print("\x9b")


eyboardInterrupt
>>> print("\xa5")
¥
>>> print("\x95")

>>> print("\x90")
denis@debian:~$ 

--
components: Unicode
messages: 378514
nosy: dgan, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: interpreter hangs forever on invalid input
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue42017] Add new type in typing

2020-10-12 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue42019] Override MagicMock special methods

2020-10-12 Thread Aristotelis Mikropoulos


New submission from Aristotelis Mikropoulos :

This is more of a question whether the following is intended behavior:
Subclassing unittest.mock.MagicMock and overriding one of the special (double 
underscore) methods has no effect. The default MagicMock method implementation 
still stands. This isn't the case with subclassing Mock.
It is understood that the purpose of MagicMock is to offer stub implementations 
of certain special methods, but isn't defining them yourself in the body of a 
subclass supposed to override those stubs?
There is an example in the file attached.

--
components: Tests
files: mockcase.py
messages: 378513
nosy: Indy
priority: normal
severity: normal
status: open
title: Override MagicMock special methods
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49510/mockcase.py

___
Python tracker 

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



[issue40422] Light refactor: create a common _Py_closerange API

2020-10-12 Thread Kyle Evans


Change by Kyle Evans :


--
pull_requests: +21646
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/22672

___
Python tracker 

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



[issue42018] winreg SetValue(Ex) should mention integer as an acceptable value

2020-10-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
type:  -> enhancement
versions: +Python 3.10, Python 3.8

___
Python tracker 

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



[issue42018] winreg SetValue(Ex) should mention integer as an acceptable value

2020-10-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Windows
nosy: +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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Paul Moore


Paul Moore  added the comment:

I'm inclined to think that creating a venv from within another venv should be 
allowed. Tools like pipx can result in *other* tools being run from within a 
virtual environment, and I don't think it's good to disallow that usage - as an 
example, I have virtualenv, tox and nox installed via pipx, and all of them 
create virtual environments.

So I'm +1 on fixing this by calling realpath.

I don't think we need to do anything special for --system-site-packages. The 
docs say "Give the virtual environment access to the system site-packages dir". 
If people are trying to chain venvs using it, they are misreading that comment 
- and the best they could hope for is to request that it's made clearer.

--

___
Python tracker 

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



[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Yannick for your report and PR!

--

___
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-10-12 Thread Bug Reporter


Bug Reporter  added the comment:

I got an advice and posted the question at 
https://answers.launchpad.net/ubuntu/+source/openssl/+question/693423

--

___
Python tracker 

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



[issue34976] IDLE: Replace the search dialog with a search bar

2020-10-12 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Notepad++, which I use, uses a tabbed dialog for search and replace, which I 
think I would like to somewhat imitate.  Or just have one search and replace 
dialog.  I need to experiment.  I don't like the Firefox toolbar and consider 
it buggy.  In any case, it and browsers in general do not do replace.  Maybe 
yours is better.

--

___
Python tracker 

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



[issue35155] Clarify Protocol Handlers in urllib.request Docs

2020-10-12 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



[issue42017] Add new type in typing

2020-10-12 Thread ThatXliner


Change by ThatXliner :


--
versions: +Python 3.9 -Python 3.10

___
Python tracker 

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



[issue42017] Add new type in typing

2020-10-12 Thread ThatXliner


Change by ThatXliner :


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



[issue42018] winreg SetValue(Ex) should mention integer as an acceptable value

2020-10-12 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +21644
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22671

___
Python tracker 

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



[issue42018] winreg SetValue(Ex) should mention integer as an acceptable value

2020-10-12 Thread Kevin Wojniak


New submission from Kevin Wojniak :

On https://docs.python.org/3/library/winreg.html

For SetValue and SetValueEx is says:

> value is a string that specifies the new value.

but value can also be an integer if the type is DWORD. Here's a test that shows 
that: https://github.com/python/cpython/blob/3.9/Lib/test/test_winreg.py#L339

Suggested update:

> value is a string or integer that specifies the new value.

--
assignee: docs@python
components: Documentation
messages: 378508
nosy: docs@python, kwojniak_box
priority: normal
severity: normal
status: open
title: winreg SetValue(Ex) should mention integer as an acceptable value
versions: Python 3.9

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Steve Dower


Steve Dower  added the comment:

Thanks for figuring that out, Eryk.

Probably we should just update venv to do a realpath(sys._base_executable) to 
handle the venv-from-symlinked-venv scenario.

Though I'd also be quite happy to just disallow that entirely (as we used to?). 
If you enable system site packages thinking you're chaining venvs together, you 
may be surprised, so it might just be better to error out here. (On the *other* 
hand, if you're programmatically invoking venv, maybe you know what you're 
doing and we should allow it?)

--

___
Python tracker 

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



[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Yannick Jadoul


Yannick Jadoul  added the comment:

Yes, sorry for the delay; I got caught up in something else.

Meanwhile, https://github.com/python/cpython/pull/22670 should solve our 
issues. I think Henry confirmed this locally?

--

___
Python tracker 

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



[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Yannick Jadoul


Change by Yannick Jadoul :


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

___
Python tracker 

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



[issue42017] Add new type in typing

2020-10-12 Thread ThatXliner


New submission from ThatXliner :

Because there is a typing.AnyStr (which is equal to AnyStr = TypeVar("AnyStr", 
str, bytes)), I think there should be a AnyNum which is equivalent to

from decimal import Decimal
from fractions import Fraction
AnyNum = TypeVar("AnyNum", int, float, complex, Decimal, Fraction)

--
components: Library (Lib)
messages: 378505
nosy: ThatXliner
priority: normal
severity: normal
status: open
title: Add new type in typing
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue21927] BOM appears in stdin when using Powershell

2020-10-12 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Thanks Eryk for following up. Glad to hear the issue has been fixed upstream!

--

___
Python tracker 

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



[issue42016] Add ksh to venv examples

2020-10-12 Thread Fibonacci


New submission from Fibonacci :

Add an example on how to source with the korn shell (tested on OpenBSD). Maybe 
the bash/zsh example can be changed to use the dot to source the file, then it 
could be included there.

Diff attached.

--
assignee: docs@python
components: Documentation
files: python_venv_ksh
messages: 378504
nosy: docs@python, fibonacci
priority: normal
severity: normal
status: open
title: Add ksh to venv examples
type: enhancement
Added file: https://bugs.python.org/file49509/python_venv_ksh

___
Python tracker 

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



[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Do you mind to create a PR Yannick?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Henry Schreiner


Change by Henry Schreiner :


--
nosy: +Henry Schreiner

___
Python tracker 

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



[issue42011] Documentation for logging.Filter.filter reports the wrong return type

2020-10-12 Thread Vinay Sajip


Change by Vinay Sajip :


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



[issue42011] Documentation for logging.Filter.filter reports the wrong return type

2020-10-12 Thread Vinay Sajip


Vinay Sajip  added the comment:

I agree that the documentation now should use Booleans rather than ints for the 
return type. It's a hangover from the pre-bool days of Python 1.5.2 ...

> P.S. As a side note, the API for filter() is quite counter-intuitive

That depends on if you consider the "filter" operation as "filter in" or 
"filter out", but the documentation is clear on what needs to be returned for a 
particular outcome.

--

___
Python tracker 

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



[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Yannick Jadoul


New submission from Yannick Jadoul :

In Python 3.9, the line `Py_XDECREF(PyCFunction_GET_CLASS(m));` was added to 
`meth_dealloc` (in `methodobject.c`). Unfortunately for pybind11, it's inserted 
exactly two lines too low, since it accesses the `PyMethodDef` and we store the 
`PyMethodDef` instance in the capsule that's used as `self`-argument of the 
`PyCFunction`.

Result: UB, since `Py_XDECREF(m->m_self);` brings down the refcount of the 
capsule to 0 and (indirectly) frees the `PyMethodDef`, while its contents are 
now still accessed.

>From the pybind11 perspective, it would be optimal if this could be fixed in 
>CPython itself, by moving up this one `Py_XDECREF` 2 lines. This would a) be 
>more efficient than creating a workaround, and b) allow old, existing versions 
>of pybind11 to work with Python 3.9 (well, 3.9.1, then, hopefully); the user 
>base of pybind11 has grown quite a bit and now includes giants like scipy or 
>some Google libraries.
I will make a PR implementing this, soon.

If there's a different, recommended way of creating these `PyCFunctionObject`s 
dynamically and cleaning up the `PyMethodDef`, we'd be interested as well, to 
make sure these kinds of breakages are avoided in the future.

Apologies for only figuring out now how to debug this, using valgrind. Up until 
yesterday, we only saw some failures in CI on macOS, but it was hard to 
reproduce and debug locally.


- Related issue: https://bugs.python.org/issue41237
- pybind11 issue: https://github.com/pybind/pybind11/issues/2558
- pybind11 PR: https://github.com/pybind/pybind11/pull/2576

--
components: C API, Interpreter Core
messages: 378500
nosy: YannickJadoul
priority: normal
severity: normal
status: open
title: Order of decrementing reference counts in meth_dealloc
type: crash
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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Eryk Sun


Eryk Sun  added the comment:

This issue is partly due to bpo-8901, which changed the behavior of the -E and 
-I command-line options to make them ignore the default PythonPath value in the 
registry key "Software\Python\PythonCore\X.Y\PythonPath". The change itself is 
not wrong. It's just exposing an underlying problem.

The `home` path in pyvenv.cfg is from sys._base_executable. In a launcher-based 
environment that's created from the base installation, sys._base_executable is 
the real base executable. OTOH, in a symlink-based virtual environment, 
sys._base_executable is the same as sys.executable. Consequently, if a virtual 
environment is created from a symlink-based virtual environment, the `home` 
path in pyvenv.cfg refers to the creating environment instead of the base 
installation. In this case, with the current implementation, the standard 
library can only be found by falling back on the default PythonPath in the 
registry.

--

___
Python tracker 

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



[issue42004] Allow uploading files with SimpleHTTPRequestHandler

2020-10-12 Thread Javier Ayres


Javier Ayres  added the comment:

I see. To be honest I didn't know FieldStorage at all, it was the best way I 
found of dealing with file data in requests using just the standard library. If 
you think this feature makes sense and it could be included, I could look into 
removing the FieldStorage dependency.

--

___
Python tracker 

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



[issue40422] Light refactor: create a common _Py_closerange API

2020-10-12 Thread Kyle Evans


Kyle Evans  added the comment:

Excellent, thank you.

--

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2020-10-12 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



[issue42011] Documentation for logging.Filter.filter reports the wrong return type

2020-10-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue42007] Line continuation after Boolean operation

2020-10-12 Thread Eric V. Smith


Eric V. Smith  added the comment:

Agreed that this isn't likely to change.

If you have a concrete proposal for how the language parsing rules would change 
in order to support this, you should post it to the python-ideas mailing list.

If that discussion results in a consensus, then we can re-open this issue. But 
unless you have a very compelling rationale, I don't expect any language 
changes here.

--
nosy: +eric.smith
resolution:  -> rejected
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



[issue41977] ctypes array inside structure requires explicit garbage collection

2020-10-12 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



[issue42014] shutil.rmtree calls onerror with different function than failed

2020-10-12 Thread Michal Čihař

New submission from Michal Čihař :

The onerror callback is called with os.lstat when the actual failing function 
is os.open.

To reproduce create directory that can not be listed:

import os
import shutil

def onerror(func, path, exc_info):
print(func)

os.mkdir("test")
os.chmod("test", 0)
shutil.rmtree("test", onerror=onerror)

--
components: Library (Lib)
messages: 378495
nosy: nijel
priority: normal
pull_requests: 21642
severity: normal
status: open
title: shutil.rmtree calls onerror with different function than failed
type: behavior
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, 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



[issue41990] venv module clashes with pip --user ... improve coordination.

2020-10-12 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-10-12 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Eryk Sun


Change by Eryk Sun :


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

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Eryk Sun


Eryk Sun  added the comment:

> Well, actually the environment variables /should/ not matter as -I 
> implies -E.

The operative word there is "should". I was grasping for anything that might 
explain why I couldn't reproduce the issue.

> Ok, the missing link is that the python you run into needs to 
> be also a symlink venv

Thank you, that reproduces the problem for me.

--

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Bernat Gabor


Bernat Gabor  added the comment:

> We need more information about the specific environment this is triggering.

Both Gitub Actions Windows CPython3.9 or installer as downloaded from (on 
Windows 10) https://www.python.org/downloads/release/python-390/.

> PYTHONHOME should not be set all. PYTHONPATH needs to be set carefully. It 
> should never include standard-library path

The issue manifests independent of those environment variables, netiher of them 
are set.

--

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Bernat Gabor

Bernat Gabor  added the comment:

Ok, the missing link is that the python you run into needs to be also a symlink 
venv:

❯ py -m venv env --without-pip --clear --symlinks
❯ .\env\Scripts\python.exe -c "import venv, subprocess; 
venv.EnvBuilder(with_pip=False, symlinks=True).create('venv'); 
subprocess.check_call(['venv\\Scripts\\python.exe', '-Ic', 'import sys; 
print(sys.executable)'])"

Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

--
nosy:  -FFY00

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Filipe Laíns

Filipe Laíns  added the comment:

Well, actually the environment variables /should/ not matter as -I implies -E.

--

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Filipe Laíns

Filipe Laíns  added the comment:

This error most likely happens because sys.path isn't being set properly and 
the standard library isn't being included.

We need more information about the specific environment this is triggering.

Which CPython build are you using? The one from Github Actions, right?
We also need the environment variables.

--
nosy: +FFY00

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Eryk Sun


Eryk Sun  added the comment:

What about the PYTHONHOME and PYTHONPATH environment variables?

>>> 'PYTHONHOME' in os.environ
False
>>> 'PYTHONPATH' in os.environ
False

PYTHONHOME should not be set all. PYTHONPATH needs to be set carefully. It 
should never include standard-library paths.

--

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Bernat Gabor

Bernat Gabor  added the comment:

❯ py -c 'import sys; print(sys.version)'
3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]

--

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Eryk Sun


Eryk Sun  added the comment:

I can't reproduce the issue with the normal 3.9.0 distribution from python.org. 
For example:

>>> venv.EnvBuilder(with_pip=False, symlinks=True).create("venv")
>>> subprocess.check_call(["venv\\Scripts\\python.exe", "-Ic", "import sys; 
print(sys.executable)"])
C:\Temp\env\venv\Scripts\python.exe
0

Which Python version(s) and distribution(s) did you test? Do you have the 
PYTHONHOME and/or PYTHONPATH environment variables set?

--
nosy: +eryksun

___
Python tracker 

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



[issue38912] test_asyncio altered the execution environment

2020-10-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +aeros

___
Python tracker 

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



[issue21927] BOM appears in stdin when using Powershell

2020-10-12 Thread Eryk Sun

Eryk Sun  added the comment:

I'm closing this as a third-party issue with older versions of PowerShell. 
Newer versions of PowerShell set the output encoding to UTF-8 without a BOM 
preamble. For example:

PS C:\> $PSVersionTable.PSVersion

Major  Minor  Patch  PreReleaseLabel BuildLabel
-  -  -  --- --
7  0  3

PS C:\> $OutputEncoding.EncodingName
Unicode (UTF-8)

PS C:\> echo ¡¢£¤¥ | py -3 -X utf8 -c "print(ascii(input()))"
'\xa1\xa2\xa3\xa4\xa5'

It's still possible to manually set the output encoding to include a BOM 
preamble. For example:

PS C:\> $OutputEncoding = [System.Text.Encoding]::UTF8
PS C:\> $OutputEncoding.GetPreamble()
239
187
191
PS C:\> echo ¡¢£¤¥ | py -3 -X utf8 -c "print(ascii(input()))"
'\ufeff\xa1\xa2\xa3\xa4\xa5'

I don't know what would be appropriate for Python's I/O stack in terms of 
detecting and handling a UTF-8 preamble on any type of file (console/terminal, 
pipe, disk), i.e. using the "utf-8-sig" encoding instead of "utf-8", as opposed 
to just letting scripts detect and handle an initial BOM character (U+FEFF) 
however they see fit. But that discussion needs a new issue if people are 
interested in supporting new behavior.

--
resolution:  -> third party
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



[issue42008] Internal Random class calling seed() with incorrect argument

2020-10-12 Thread Amir Mohamadi


Change by Amir Mohamadi :


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

___
Python tracker 

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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Bernat Gabor


Change by Bernat Gabor :


--
components: +Windows
nosy: +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



[issue42013] venv on Windows with symlinks is broken if invoked with -I

2020-10-12 Thread Bernat Gabor


New submission from Bernat Gabor :

Here's a small reproducible, run it on a Windows OS that has symlinks enabled:

import shutil
import venv
import subprocess

shutil.rmtree("venv", ignore_errors=True)
venv.EnvBuilder(with_pip=False, symlinks=True).create("venv")

# works
subprocess.check_call(["venv\\Scripts\\python.exe", "-c", "import sys; 
print(sys.executable)"])

# fails with No module named 'encodings'
subprocess.check_call(["venv\\Scripts\\python.exe", "-Ic", "import sys; 
print(sys.executable)"])

--
messages: 378485
nosy: gaborjbernat
priority: normal
severity: normal
status: open
title: venv on Windows with symlinks is broken if invoked with -I
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



[issue42012] typing support in wsgiref

2020-10-12 Thread Sebastian Rittau


New submission from Sebastian Rittau :

In typeshed (the repository for stdlib type annotations), we have defined a 
bunch of types to support annotating WSGI interfaces. See 
https://github.com/python/typeshed/blob/master/stdlib/2and3/_typeshed/wsgi.pyi 
for the current version. Unfortunately these types are only available at type 
check time, which means that users need to do some gymnastics to use them in 
their own code.

I think it would be worthwhile to add these types directly to wsgiref or to a 
new module (e.g. wsgiref.types). On the one hand users could use them at 
runtime easily, on the other hand they serve as additional documentation WSGI 
types. In my experience, WSGI applications and middleware often slightly 
misimplement the standard, which can make interoperability difficult. Both type 
checking and concrete documentation could help alleviate this problem.

If the maintainers think this would be a good idea, I could provide a PR for 
both the types and the Python documentation.

--
components: Library (Lib)
messages: 378484
nosy: srittau
priority: normal
severity: normal
status: open
title: typing support in wsgiref
type: enhancement

___
Python tracker 

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



[issue35155] Clarify Protocol Handlers in urllib.request Docs

2020-10-12 Thread Irit Katriel


Irit Katriel  added the comment:

This seems complete, can it be closed?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue42008] Internal Random class calling seed() with incorrect argument

2020-10-12 Thread Amir Mohamadi


Amir Mohamadi  added the comment:

Can I open a PR for it?

--
nosy: +Amir

___
Python tracker 

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



[issue42010] Generic types accept indexing/subscripting, causing confusion

2020-10-12 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue42011] Documentation for logging.Filter.filter reports the wrong return type

2020-10-12 Thread Riccardo Coccioli


New submission from Riccardo Coccioli :

The documentation for the logging.Filter().filter() method states:

#-
Is the specified record to be logged? Returns 0 for no, nonzero for yes. If 
deemed appropriate, the record may be modified in-place.
#-

While its implementation returns a boolean in Lib/logging/__init__.py.
Moreover the most recent version of mypy (0.790) reports it as an error if a 
custom class inherit from logging.Filter and implement a filter() method that 
returns an int as specified in the documentation:

#-
error: Return type "int" of "filter" incompatible with return type "bool" in 
supertype "Filter"  [override]
#-

P.S. As a side note, the API for filter() is quite counter-intuitive as it 
requires the filter() method to return False to filter out the record and True 
to include it.

--
assignee: docs@python
components: Documentation
messages: 378480
nosy: Riccardo Coccioli, docs@python
priority: normal
severity: normal
status: open
title: Documentation for logging.Filter.filter reports the wrong return type
type: behavior
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, 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



[issue38912] test_asyncio altered the execution environment

2020-10-12 Thread STINNER Victor


STINNER Victor  added the comment:

Another failure on aarch64 RHEL7 Refleaks 3.9:
https://buildbot.python.org/all/#builders/122/builds/62

0:53:43 load avg: 0.97 [424/425/1] test_asyncio failed (env changed) (53 min 34 
sec) -- running: test_pydoc (29 min 2 sec)
beginning 6 repetitions
123456
../home/buildbot/buildarea/3.9.cstratak-RHEL7-aarch64.refleak/build/Lib/asyncio/sslproto.py:320:
 ResourceWarning: unclosed transport 
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Warning -- Unraisable exception
Exception ignored in: 
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.9.cstratak-RHEL7-aarch64.refleak/build/Lib/asyncio/sslproto.py",
 line 321, in __del__
self.close()
  File 
"/home/buildbot/buildarea/3.9.cstratak-RHEL7-aarch64.refleak/build/Lib/asyncio/sslproto.py",
 line 316, in close
self._ssl_protocol._start_shutdown()
  File 
"/home/buildbot/buildarea/3.9.cstratak-RHEL7-aarch64.refleak/build/Lib/asyncio/sslproto.py",
 line 590, in _start_shutdown
self._abort()
  File 
"/home/buildbot/buildarea/3.9.cstratak-RHEL7-aarch64.refleak/build/Lib/asyncio/sslproto.py",
 line 731, in _abort
self._transport.abort()
  File 
"/home/buildbot/buildarea/3.9.cstratak-RHEL7-aarch64.refleak/build/Lib/asyncio/selector_events.py",
 line 680, in abort
self._force_close(None)
  File 
"/home/buildbot/buildarea/3.9.cstratak-RHEL7-aarch64.refleak/build/Lib/asyncio/selector_events.py",
 line 731, in _force_close
self._loop.call_soon(self._call_connection_lost, exc)
  File 
"/home/buildbot/buildarea/3.9.cstratak-RHEL7-aarch64.refleak/build/Lib/asyncio/base_events.py",
 line 746, in call_soon
self._check_closed()
  File 
"/home/buildbot/buildarea/3.9.cstratak-RHEL7-aarch64.refleak/build/Lib/asyncio/base_events.py",
 line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
/home/buildbot/buildarea/3.9.cstratak-RHEL7-aarch64.refleak/build/Lib/asyncio/selector_events.py:704:
 ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=8>
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Task was destroyed but it is pending!
task: 
 wait_for=()]>>


--

___
Python tracker 

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



[issue41833] threading.Thread: use target name if the name parameter is omitted

2020-10-12 Thread STINNER Victor


STINNER Victor  added the comment:

Cool, my threading change works as expected! The name of the target function 
was logged in bpo-41739 issue.

https://buildbot.python.org/all/#/builders/509/builds/172

0:00:28 load avg: 3.58 [ 36/424/1] test_logging failed (env changed)
Warning -- threading_cleanup() failed to cleanup 2 threads (count: 2, dangling: 
3)
Warning -- Dangling thread: 
Warning -- Dangling thread: 
Warning -- Dangling thread: <_MainThread(MainThread, started 4396920310576)>

See "": the two 
leaked threads are running the removeTarget() function which come from 
MemoryHandlerTest.test_race_between_set_target_and_flush().

By the way, Serhiy was right about the name of having an unique repr() even if 
the target is the same, since it's the case here ;-) Well "4396862667024" is 
different than "4396595259664", but it's more convinient to have short numbers 
like "Thread-4" and "Thread-11".

--

___
Python tracker 

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



[issue41739] test_logging: test_race_between_set_target_and_flush() leaks threads (threading_cleanup() failed to cleanup ...)

2020-10-12 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, test_race_between_set_target_and_flush() should no longer leak dangling 
threads. I close the issue.

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



[issue41739] test_logging: test_race_between_set_target_and_flush() leaks threads (threading_cleanup() failed to cleanup ...)

2020-10-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 33057c70920787627f2c94d08eb5d33c31f8bdd9 by Miss Skeleton (bot) 
in branch '3.8':
bpo-41739: Fix test_logging.test_race_between_set_target_and_flush() (GH-22655) 
(GH-22656) (GH-22662)
https://github.com/python/cpython/commit/33057c70920787627f2c94d08eb5d33c31f8bdd9


--

___
Python tracker 

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



[issue42010] Generic types accept indexing/subscripting, causing confusion

2020-10-12 Thread Ken Jin


Ken Jin  added the comment:

I'd like to clarify the following too, currently:

(1)
>>> list[1]
list[1]

(2)
>>> list[1, 2, 3]
list[1, 2, 3]

The PR only solves (1) and not (2), is (2) intended behavior?

--

___
Python tracker 

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



[issue42010] Generic types accept indexing/subscripting, causing confusion

2020-10-12 Thread Ken Jin


Change by Ken Jin :


--
title: Generic types accepts indexing/subscripting, causing confusion -> 
Generic types accept indexing/subscripting, causing confusion

___
Python tracker 

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



[issue42010] Generic types accepts indexing/subscripting, causing confusion

2020-10-12 Thread Ken Jin


Change by Ken Jin :


--
title: GenericAlias accepts indexing/subscripting, causing confusion -> Generic 
types accepts indexing/subscripting, causing confusion

___
Python tracker 

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



  1   2   >