[issue37685] Fix equality checks for some types

2019-08-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Łukasz, are you fine with backporting PR 14952 to 3.8?

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue34775] pathlib.PurePath division raises TypeError instead of returning NotImplemented

2019-08-07 Thread miss-islington


Change by miss-islington :


--
keywords: +patch
pull_requests: +14904
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/15172

___
Python tracker 

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



[issue37685] Fix equality checks for some types

2019-08-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7d44e7a4563072d0fad00427b76b94cad61c38ae by Serhiy Storchaka in 
branch 'master':
bpo-37685: Use singletons ALWAYS_EQ and NEVER_EQ in more tests. (GH-15167)
https://github.com/python/cpython/commit/7d44e7a4563072d0fad00427b76b94cad61c38ae


--

___
Python tracker 

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



[issue37685] Fix equality checks for some types

2019-08-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 662db125cddbca1db68116c547c290eb3943d98e by Serhiy Storchaka in 
branch 'master':
bpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952)
https://github.com/python/cpython/commit/662db125cddbca1db68116c547c290eb3943d98e


--

___
Python tracker 

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



[issue34775] pathlib.PurePath division raises TypeError instead of returning NotImplemented

2019-08-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4c69be22df3852f17873a74d015528d9a8ae92d6 by Serhiy Storchaka 
(aiudirog) in branch 'master':
bpo-34775: Return NotImplemented in PurePath division. (GH-9509)
https://github.com/python/cpython/commit/4c69be22df3852f17873a74d015528d9a8ae92d6


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue21261] Teach IDLE to Autocomplete dictionary keys

2019-08-07 Thread Kyle Stanley


Kyle Stanley  added the comment:

> I have not yet thoroughly tested it though, and would like some feedback on 
> it.

I performed some testing on Linux and it looks good as far as I can tell. I 
added a few minor suggestions, but the auto-complete seems to be functioning as 
desired.

--
nosy: +aeros167

___
Python tracker 

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



[issue35712] Make NotImplemented unusable in boolean context

2019-08-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not have a strong opinion, so I suggest to not mention neither TypeError, 
nor RuntimeWarning. After some time of using a DeprecationWarning we can have 
have some information about whether there is a code which can't be fixed if 
bool(NotImplemented) will raise an error.

--

___
Python tracker 

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



[issue18236] str.isspace should use the Unicode White_Space property

2019-08-07 Thread Ma Lin


Ma Lin  added the comment:

Greg, could you try this code after your patch?

>>> import re
>>> re.match(r'\s', '\x1e')
  # <- before patch

--
nosy: +Ma Lin

___
Python tracker 

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



[issue37760] Refactor makeunicodedata.py: dedupe parsing, use dataclass

2019-08-07 Thread Greg Price


Change by Greg Price :


--
pull_requests: +14903
pull_request: https://github.com/python/cpython/pull/15171

___
Python tracker 

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



[issue18236] str.isspace should use the Unicode White_Space property

2019-08-07 Thread Greg Price


Greg Price  added the comment:

I've gone and made a patch for this change:
https://github.com/gnprice/cpython/commit/7dab9d879

Most of the work happens in the script Tools/unicode/makeunicode.py , and along 
the way I made several changes there that I found made it somewhat nicer to 
work on, and I think will help other people reading that script too.  So I'd 
like to try to merge those improvements first.

I've filed #37760 for those preparatory changes, and posted several PRs 
(GH-15128, GH-15129, GH-15130) as bite-sized pieces.  These PRs can go in in 
any order.

Please take a look! Reviews appreciated.

--
nosy: +Greg Price
versions: +Python 3.9 -Python 3.5

___
Python tracker 

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



[issue37774] Micro-optimize vectorcall using PY_LIKELY

2019-08-07 Thread Ma Lin


Ma Lin  added the comment:

How about write a suggestion on when to use them in the comment?

For example:
> You should use it only in cases when the likeliest branch is
> very very very likely, or when the unlikeliest branch is very
> very very unlikely. 
from https://kernelnewbies.org/FAQ/LikelyUnlikely

Another discussion about them:
https://lwn.net/Articles/420019/

--
nosy: +Ma Lin

___
Python tracker 

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



[issue37790] subprocess.Popen() is extremely slow

2019-08-07 Thread Alexander Pyhalov


Alexander Pyhalov  added the comment:

I've tried to rewrite subporcess.getstatusoutput() usage with 
subprocess.Popen() and switch to shell=False, it didn't help, so I doubti it 
getstatusoutput() overhead, it's Popen() issue.

--

___
Python tracker 

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



[issue37496] Support annotations in signature strings.

2019-08-07 Thread Guido van Rossum


Guido van Rossum  added the comment:

> 1. Should I create a new function in the `ast` module that exposes that C 
> function in Python in order to use it in `Lib/inspect.py`?
> 2. Would it be better to just re-use the _AST to string_ implementation in 
> `Tools/unparse.py`?

I would vote for #1. If it is not up to the task that probably points to a flaw 
anyway.

--

___
Python tracker 

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



[issue37786] Doesn't delete PATH from System Variables (uninstallation)

2019-08-07 Thread Paul Francis


Change by Paul Francis :


--
resolution: duplicate -> 
status: closed -> open

___
Python tracker 

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



[issue37786] Doesn't delete PATH from System Variables (uninstallation)

2019-08-07 Thread Paul Francis


Paul Francis  added the comment:

This is regarding the GUI uninstall program that is accessedd via Programs & 
Features (formerly known as Add/Remove Programs) in Control Panel. Sorry I 
didn't make this clear.

That "duplicate" report seems to be for a Command Line method of uninstalling 
the program.

--

___
Python tracker 

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



[issue37774] Micro-optimize vectorcall using PY_LIKELY

2019-08-07 Thread Inada Naoki


Inada Naoki  added the comment:

I'm conservative about adding public APIs.
But in this case, LIKELY/UNLIKELY macros are battle-tested in the world already.
So I think it's safe to make it public.

But I'll wait to merge for a week for other core dev's comments.

--

___
Python tracker 

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



[issue37790] subprocess.Popen() is extremely slow

2019-08-07 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Have you tried switching to using Popen itself (or run, which keeps it to one 
layer of convenience wrapping)?

subprocess.getstatusoutput is three layers of wrapping (it calls check_output, 
which in turn calls run, which in turn calls Popen), and (unlike Python 2) has 
to decode all the output. run would avoid two layers of wrapping, can 
optionally receive the raw bytes instead of decoding to str, and avoids needing 
to wrap the whole thing in a shell (which system, older popen, and 
getstatusoutput all do).

Beyond that, it looks like when 3.8 releases, Popen should get *much* faster if 
the call meets certain conditions, see 
https://docs.python.org/3.8/whatsnew/3.8.html#optimizations for details. If you 
can make your use cases conform to those requirements (e.g. by using 
shutil.which to determine the absolute paths to your utilities instead of 
relying on PATH lookup), the speed up should eliminate (or more than eliminate) 
the performance regression you're seeing (per #35537, on macOS, which got the 
least benefit, it was still a 1.7x improvement; on other OSes, the multiplier 
hits 61x or 106x).

--
nosy: +josh.r

___
Python tracker 

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



[issue37633] Py_CompileString and PyParser_SimpleParseString not exported in python38.dll

2019-08-07 Thread Ashwin Ramaswami


Ashwin Ramaswami  added the comment:

I can take this up.

--
nosy: +epicfaace

___
Python tracker 

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



[issue37772] zipfile.Path.iterdir() outputs sub directories many times or not at all

2019-08-07 Thread Srinivas Nyayapati


Srinivas Nyayapati  added the comment:

I just submitted my PR.

--

___
Python tracker 

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



[issue37774] Micro-optimize vectorcall using PY_LIKELY

2019-08-07 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Is the intent to make these macros public? If not, shouldn't they be prefixed 
with an underscore, like _Py_SIZE_ROUND_DOWN/_Py_SIZE_ROUND_UP in the same 
header?

--

___
Python tracker 

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



[issue35712] Make NotImplemented unusable in boolean context

2019-08-07 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

In the docs for my PR, I mention using NotImplemented in a boolean context is 
deprecated, raising DeprecationWarning, and will raise TypeError in a future 
version of Python. Serhiy has suggested the end state might be RuntimeWarning 
instead of TypeError. I'm in favor of it ending up as an error, but not rigid 
on it. Does anyone else have a strong opinion among the following options?

1. DeprecationWarning, documented as eventual TypeError (current PR)
2. DeprecationWarning, documented as eventual RuntimeWarning
3. Immediate RuntimeWarning, no DeprecationWarning period (since a warning only 
causes stderr output by default, it doesn't prevent working code from working 
unless warnings are explicitly configured to become exceptions)

--

___
Python tracker 

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



[issue37772] zipfile.Path.iterdir() outputs sub directories many times or not at all

2019-08-07 Thread Srinivas Nyayapati


Change by Srinivas Nyayapati :


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

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-08-07 Thread My Tran


My Tran  added the comment:

I looked at the job at https://travis-ci.com/epicfaace/cpython/jobs/223345147 
and its running py3.6.

--

___
Python tracker 

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



[issue37772] zipfile.Path.iterdir() outputs sub directories many times or not at all

2019-08-07 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
assignee:  -> jaraco

___
Python tracker 

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



[issue37772] zipfile.Path.iterdir() outputs sub directories many times or not at all

2019-08-07 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Please do.

--

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-08-07 Thread My Tran


My Tran  added the comment:

Reproduced on 3.7.4

Looks like this started happening after this commit: 
https://github.com/python/cpython/commit/dc20fc4311dece19488299a7cd11317ffbe4d3c3#diff-19171ae20182f6759204a3436475ddd1

--

___
Python tracker 

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



[issue21261] Teach IDLE to Autocomplete dictionary keys

2019-08-07 Thread Tal Einat


Tal Einat  added the comment:

Raymond, your with may just come true!

I've just created PR GH-15169 with a new implementation of my own, complete 
with tests.  I have not yet thoroughly tested it though, and would like some 
feedback on it.

--

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-08-07 Thread Ashwin Ramaswami


Ashwin Ramaswami  added the comment:

I also can't reproduce this on 3.7: 
https://github.com/epicfaace/cpython/runs/188005822

--

___
Python tracker 

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



[issue37790] subprocess.Popen() is extremely slow

2019-08-07 Thread Alexander Pyhalov


New submission from Alexander Pyhalov :

We've moved illumos-gate wsdiff python tool from Python 2 to Python 3.
The tool does the following - for each file from old and new proto area 
compares file attributes to find differences in binary otput (spawning elfdump, 
dump and other utilities). 
Performance has degraded in two times when commands.getstatusoutput() was 
replaced by subprocess.getstatusoutput().
os.popen() now is Popen() wrapper, so it also has poor performance.
Even naive popen() implementation using os.system() and os.mkstemp() behaved 
much more efficiently (about two times faster e.g. 20 minuts vs 40 minutes for 
single tool pass).

--
components: Library (Lib)
messages: 349197
nosy: Alexander.Pyhalov
priority: normal
severity: normal
status: open
title: subprocess.Popen() is extremely slow
versions: Python 3.5

___
Python tracker 

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



[issue21261] Teach IDLE to Autocomplete dictionary keys

2019-08-07 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +14901
pull_request: https://github.com/python/cpython/pull/15169

___
Python tracker 

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



[issue37764] email.Message.as_string infinite loop

2019-08-07 Thread Ashwin Ramaswami


Ashwin Ramaswami  added the comment:

I can't reproduce this on 3.9: 
https://github.com/epicfaace/cpython/runs/187997615

--
nosy: +epicfaace

___
Python tracker 

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



[issue21762] update the import machinery to only use __spec__

2019-08-07 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue24413] Inconsistent behavior between set and dict_keys/dict_items: for non-iterable object x, set().__or__(x) returns NotImplemented, but {}.keys().__or__(x) raises TypeError

2019-08-07 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue24413] Inconsistent behavior between set and dict_keys/dict_items: for non-iterable object x, set().__or__(x) returns NotImplemented, but {}.keys().__or__(x) raises TypeError

2019-08-07 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger
versions: +Python 3.9 -Python 2.7, 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



[issue37774] Micro-optimize vectorcall using PY_LIKELY

2019-08-07 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
nosy: +josh.r

___
Python tracker 

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



[issue24413] Inconsistent behavior between set and dict_keys/dict_items: for non-iterable object x, set().__or__(x) returns NotImplemented, but {}.keys().__or__(x) raises TypeError

2019-08-07 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

To be clear, set().__or__(x) returns NotImplemented, it doesn't raise 
NotImplementedError. I've edited the title to match.

One major problem that gets in the way of a fix is that the interface of set 
and dict views doesn't match, because dict views only provide the interface of 
collections.abc.Set, and collections.abc.Set *only* requires the operator 
overloads, not the named equivalent methods. And because the named equivalents 
don't exist, the operator overloads were made more liberal, to accept any 
iterable, not just set or set-like things.

set's rules are:

1. Named methods take varargs, and accept any iterable(s)
2. Operator overloads take only one argument, which must be a set/frozenset

dict view's rules are:

1. There are no named methods (aside from isdisjoint, which has no operator 
equivalent)
2. Operator overloads take only one argument, which can be any iterable

So fixing this is problematic so long as we want to keep a simple 
implementation; right now, all the methods simplify to:

1. Convert to set
2. Call named, in-place method on resulting set to get liberal behavior

Fixing this would involve either:

1. Rewriting all the dict views operator overloads to do the work themselves, 
including the logic to reject non-iterables by returning NotImplemented like 
set's operators do.

Pro: Not a hack. Resulting code would be more efficient in many cases (e.g. 
dict view's __and__ could make a new empty set [currently makes set with a copy 
of the view's values], and iterate the right hand side while performing 
membership tests in the underlying dict before inserting into the result set, 
avoiding the need to make a large set that will almost certainly shrink, 
possibly requiring rehashes)

Con: Lots of new code to maintain. Would not benefit from any algorithmic 
improvements to equivalent set code without mirroring them manually.

2. Checking for TypeError from the set method and explicitly returning 
NotImplemented.

Pro: Easy, code remains maintainable, benefits from any future 
optimizations to set

Cons: Can't distinguish fundamental problems that should be TypeErrors 
(right hand side contains unhashable objects) from simple case that should 
return NotImplemented (right hand side isn't iterable). Potentially fixable by 
explicitly performing the conversion to iterator on the dict view's side 
(though you'd only do it to confirm it's possible; you'd want to pass the 
original object unmodified for the common case where it's a set/frozenset and 
could be processed more efficiently). Also makes failure case even slower than 
it already is (exception is raised, then ignored, then NotImplemented is 
returned, then right-hand side is checked, and odds are, the right-hand side 
won't know what to do either, so it'll return NotImplemented anyway, and a 
TypeError gets thrown after more work).

3. Refactor the set API to expose (private, C level) helpers for the operator 
overloads (specifically, the *in-place* versions like __ior__, since we're 
always making a new true set to call it on anyway, and it seems silly to use 
__or__ which would make yet another set, and force us to throw away the first 
set we made) that are less strict about their arguments.

Pros: Roughly the same as #2, plus a minor per-call (not per item) 
performance boost: C helpers could be called directly, avoiding overhead of 
calling Python level methods via _PyObject_CallMethodIdOneArg(result, 
_update, other); invoking dict lookups and the like when we know we just 
made a true set object, so there is no possibility of update being overridden, 
so a direct C level call would save time. Continues to benefit from any 
optimizations to set's code (since 95% of the code remains the same).

Con: More code churn than #2; unfortunately, unlike list (which has type 
loose in-place operator overloads), set's in-place operator overloads are still 
type strict; alist += {1,2,3} works, but aset |= [1,2,3] does not, so we can't 
just call set's __ixor__ unmodified, we'd need a _PySet_IXorIterable separate 
from the existing set_ior, where both of them might be implemented in terms of 
set_update_internal, but _PySet_IXorIterable only checks that the argument is 
iterable to return NotImplemented.

#1 and #3 seem to be the only fully correct options; #1 could squeeze out more 
performance, but requires a *lot* more new code, #3 requires a lot less new 
code, and gets a tiny performance boost.

I don't see explicit calls to __or__ being all that common though, and I have a 
hard time envisioning a class that would hit this case without explicitly 
calling __or__; for `{}.keys() | x` the only time you'd see a behavioral 
difference from `set() | x` is when:

1. x is not iterable, and
2. x defines a __ror__ that can do something meaningful with a set

I'd personally assume anything that meets criterion #2 would be iterable; 
anyone have a counter-example? If this is 

[issue18578] Rename and document test.bytecode_helper as test.support.bytecode_helper

2019-08-07 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
pull_requests: +14900
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15168

___
Python tracker 

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



[issue37789] Update doc strings for test.bytecode_helper

2019-08-07 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

*supposed not supported.

--

___
Python tracker 

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



[issue37789] Update doc strings for test.bytecode_helper

2019-08-07 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
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



[issue37789] Update doc strings for test.bytecode_helper

2019-08-07 Thread Joannah Nanjekye


New submission from Joannah Nanjekye :

I want to believe there is a mistake in the doc strings for these methods:

def assertInBytecode(self, x, opname, argval=_UNSPECIFIED):
"""Returns instr if op is found, otherwise throws AssertionError"""
for instr in dis.get_instructions(x):
if instr.opname == opname:
if argval is _UNSPECIFIED or instr.argval == argval:
return instr
disassembly = self.get_disassembly_as_string(x)
if argval is _UNSPECIFIED:
msg = '%s not found in bytecode:\n%s' % (opname, disassembly)
else:
msg = '(%s,%r) not found in bytecode:\n%s'
msg = msg % (opname, argval, disassembly)
self.fail(msg)

def assertNotInBytecode(self, x, opname, argval=_UNSPECIFIED):
"""Throws AssertionError if op is found"""
for instr in dis.get_instructions(x):
if instr.opname == opname:
disassembly = self.get_disassembly_as_string(x)
if argval is _UNSPECIFIED:
msg = '%s occurs in bytecode:\n%s' % (opname, disassembly)
elif instr.argval == argval:
msg = '(%s,%r) occurs in bytecode:\n%s'
msg = msg % (opname, argval, disassembly)
self.fail(msg)

It is supported to refer to *opname* not *op*. Either the method signatures or 
the doc strings have to be updated. I stand to be corrected If wrong though.

--
messages: 349193
nosy: nanjekyejoannah
priority: normal
severity: normal
status: open
title: Update doc strings for test.bytecode_helper

___
Python tracker 

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



[issue37734] Registry keys for Windows Store package have wrong executable

2019-08-07 Thread miss-islington


miss-islington  added the comment:


New changeset 84d31bbf1f7e10bde1ceadcfa0d83d30a04313d5 by Miss Islington (bot) 
in branch '3.8':
bpo-37734: Remove unnecessary brace escapes in PC/layout script (GH-15165)
https://github.com/python/cpython/commit/84d31bbf1f7e10bde1ceadcfa0d83d30a04313d5


--

___
Python tracker 

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



[issue35786] get_lock() method is not present for Values created using multiprocessing.Manager()

2019-08-07 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Reading the docs, I'd definitely expect multiprocessing.Manager().Value to obey 
the same interface as multiprocessing.Value. The SyncManager docs say:

> Its methods create and return Proxy Objects for a number of commonly used 
> data types to be synchronized across processes.

It does also say (under the linked definition for Proxy Objects):

> A proxy object has methods which invoke corresponding methods of its referent 
> (although not every method of the referent will necessarily be available 
> through the proxy).

which implies the proxy might be more limited, but in fact the proxy is 
wrapping a completely different underlying class, 
multiprocessing.managers.Value (that has nothing to do with the class you'd get 
from calling multiprocessing.Value or multiprocessing.sharedctypes.Value).

It looks like there was, at some point, an attempt to make certain interfaces 
match; multiprocessing.managers.Value's initializer has a prototype of:

def __init__(self, typecode, value, lock=True):

(documented prototype excludes the lock argument), but AFAICT, lock is 
completely ignored, and typecode is stored as _typecode on the underlying 
Value, but otherwise ignored; the multiprocessing.managers.ValueProxy object 
returned by manager.Value() doesn't expose it (except insofar as you can call 
._getvalue() on it to retrieve a copy of the underlying Value), and even if you 
get the unwrapped object, all _typecode does is change the repr; it's not used 
anywhere else.

It seems like SyncManager.Value is just the worst of all possible worlds; it 
has a prototype that (roughly) matches 
multiprocessing.Value/multiprocessing.sharedctypes.Value, and the limited 
documentation implies it serves the same function, but:

1. It effectively ignores every argument aside from value (which is the second 
argument, so you're stuck passing the first argument even though nothing uses 
it)
2. It doesn't actually use ctypes to achieve efficient storage/IPC 
communication (updating value involves pickling it, not just sending the raw 
data of a C array/struct)
3. It doesn't provide any of the interface of the other Value, so you can't use 
get_lock (or use a with statement to lock it, or manually call acquire or 
release) or get_obj.

I'm not sure what to do about it though; the manager version of Value is much 
more flexible, and I'm sure there is existing code that takes advantage of 
that, so we can't rewrite to make it ctypes backed. The 
multiprocessing.managers code is too new/complex for me to determine if any 
easy solution exists to expand multiprocessing.managers.ValueProxy to support 
context management/get_lock/get_obj to match the behavior of the class returned 
by multiprocessing.Value/multiprocessing.sharedctypes.Value, but it seems like, 
if we're going to let the docs imply a relationship, we ought to at least try 
to make the API of the two classes roughly match.

--
nosy: +josh.r

___
Python tracker 

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



[issue37734] Registry keys for Windows Store package have wrong executable

2019-08-07 Thread Steve Dower


Steve Dower  added the comment:

Going to leave this open in commit review for now. I believe this will 
significantly improve the reliability, but depending on which Windows bugs 
people run into there may still be more things we can do.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue37778] Windows Store package uses wrong icons for file association

2019-08-07 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue37685] Fix equality checks for some types

2019-08-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +14899
pull_request: https://github.com/python/cpython/pull/15167

___
Python tracker 

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



[issue37734] Registry keys for Windows Store package have wrong executable

2019-08-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14898
pull_request: https://github.com/python/cpython/pull/15166

___
Python tracker 

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



[issue37734] Registry keys for Windows Store package have wrong executable

2019-08-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset 0378d98678f3617fd44d9a6266e7c17ebce62755 by Steve Dower in branch 
'master':
bpo-37734: Remove unnecessary brace escapes in PC/layout script (GH-15165)
https://github.com/python/cpython/commit/0378d98678f3617fd44d9a6266e7c17ebce62755


--

___
Python tracker 

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



[issue37778] Windows Store package uses wrong icons for file association

2019-08-07 Thread miss-islington


miss-islington  added the comment:


New changeset dc6653fd06598f42b107dcffcd089d7ee2b1cd44 by Miss Islington (bot) 
in branch '3.8':
bpo-37778: Fixes the icons used for file associations to the Microsoft Store 
package (GH-15150)
https://github.com/python/cpython/commit/dc6653fd06598f42b107dcffcd089d7ee2b1cd44


--
nosy: +miss-islington

___
Python tracker 

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



[issue37734] Registry keys for Windows Store package have wrong executable

2019-08-07 Thread miss-islington


miss-islington  added the comment:


New changeset eab76c3c75a572566862200728cc8d05b3298f12 by Miss Islington (bot) 
in branch '3.8':
bpo-37734: Fix use of registry values to launch Python from Microsoft Store app 
(GH-15146)
https://github.com/python/cpython/commit/eab76c3c75a572566862200728cc8d05b3298f12


--
nosy: +miss-islington

___
Python tracker 

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



[issue11165] Document PyEval_Call* functions

2019-08-07 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

These functions are now officially deprecated, see PR 14804. So I think that 
this issue can be closed.

--
nosy: +jdemeyer

___
Python tracker 

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



[issue15987] Provide a way to compare AST nodes for equality recursively

2019-08-07 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

> If consensus has been reached on this, I am willing to do the work.

It looks like there is already an active PR 
https://github.com/python/cpython/pull/14970, there are some non-implemented 
comments from a core review.

--

___
Python tracker 

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



[issue37734] Registry keys for Windows Store package have wrong executable

2019-08-07 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +14897
pull_request: https://github.com/python/cpython/pull/15165

___
Python tracker 

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



[issue37496] Support annotations in signature strings.

2019-08-07 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

> I have a couple of questions about how to use `ast_unparse.c`'s 
> `expr_as_unicode` function:

> 1. Should I create a new function in the `ast` module that exposes that C 
> function in Python in order to use it in `Lib/inspect.py`?
> 2. Would it be better to just re-use the _AST to string_ implementation in 
> `Tools/unparse.py`?

Hm, TBH I am not sure which one is better, I am leaning towards option 1, but I 
add more people to get some opinions.

--
nosy: +gvanrossum, lukasz.langa

___
Python tracker 

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



[issue37778] Windows Store package uses wrong icons for file association

2019-08-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14896
pull_request: https://github.com/python/cpython/pull/15164

___
Python tracker 

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



[issue37778] Windows Store package uses wrong icons for file association

2019-08-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset 87ce9588ceb4b4dd625913344844390f0b991b0c by Steve Dower in branch 
'master':
bpo-37778: Fixes the icons used for file associations to the Microsoft Store 
package (GH-15150)
https://github.com/python/cpython/commit/87ce9588ceb4b4dd625913344844390f0b991b0c


--

___
Python tracker 

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



[issue37734] Registry keys for Windows Store package have wrong executable

2019-08-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset 1fab9cbfbaf19a7bc79cef382136fcf9491e3183 by Steve Dower in branch 
'master':
bpo-37734: Fix use of registry values to launch Python from Microsoft Store app 
(GH-15146)
https://github.com/python/cpython/commit/1fab9cbfbaf19a7bc79cef382136fcf9491e3183


--

___
Python tracker 

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



[issue37734] Registry keys for Windows Store package have wrong executable

2019-08-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14895
pull_request: https://github.com/python/cpython/pull/15163

___
Python tracker 

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



[issue37787] Minimum denormal or ** bug

2019-08-07 Thread Steve Dower


Steve Dower  added the comment:

Only half serious ;)

I'd settle for "reliable, consistent and easy to explain rounding", which is 
unfortunately not what IEEE 754 provides (unless you assume significant amounts 
of CS background that most Python users do not have). But then, nothing else 
really provides it either, so it's more of a dream than a plan :)

--

___
Python tracker 

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



[issue37787] Minimum denormal or ** bug

2019-08-07 Thread Tim Peters


Tim Peters  added the comment:

Since this depends on the platform libm implementation of pow(), I'm closing 
this as "won't fix".

Steve, on the chance you're serious ;-) , there are implementations of the 
"constructive reals", which indeed act like infinite-precision floats.  But 
they tend to be very slow, and, e.g., testing two of them for equality is, in 
general, undecidable even in theory.  Here's one such:

https://www.chiark.greenend.org.uk/~sgtatham/spigot/

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
versions:  -Python 3.7

___
Python tracker 

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



[issue35484] Segmentation fault due to faulthandler on Solaris

2019-08-07 Thread Peter Edwards


Peter Edwards  added the comment:

This is likely a duplicate of issue 21131

--
nosy: +peadar

___
Python tracker 

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



[issue37718] 2to3 exception handling

2019-08-07 Thread hai shi


hai shi  added the comment:

1. the message property of PyBaseExceptionObject(Exception) have been cancelled.

[1] https://github.com/python/cpython/blob/2.7/Include/pyerrors.h#L13
[2] https://github.com/python/cpython/blob/master/Include/cpython/pyerrors.h#L18

2. `except Exception, e` is a python2.x behavior, pls use `except Exception as 
e` in python3.x

--
nosy: +shihai1991

___
Python tracker 

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



[issue37787] Minimum denormal or ** bug

2019-08-07 Thread Steve Dower


Steve Dower  added the comment:

I have nothing to contribute here. Tim's right.

(I would love Python to have infinite precision float by default...)

--

___
Python tracker 

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



[issue37786] Doesn't delete PATH from System Variables (uninstallation)

2019-08-07 Thread Steve Dower


Steve Dower  added the comment:

Duplicate of issue28576

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Uninstalling Py352 x86 with /uninstall option does not remove 
prepended paths

___
Python tracker 

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



[issue37745] 3.8b3 - windows install gui/ inconsistent options

2019-08-07 Thread Steve Dower


Steve Dower  added the comment:

> recommend we change "install launcher" to "install py launcher" to be 
> explicit.

To be clear, you mean we change "Install launcher for all users" to "Install py 
launcher for all users"? You get the launcher by default regardless, the only 
choice here is whether _everyone_ on your machine gets it (and you need to be 
an admin).

> Long term - it would be cleaner if the user had only 'default' and customize 
> installation on this screen, with all configurations either bundled under 
> Default, or moved to other screens for 'Customized' installs.  We could add 
> notes under default that we're installing python for all users, py launcher, 
> adding Python to PATH, etc.

This is where we started, and the notes are already there. What changed is:
* we don't add Python to PATH by default (because it's bad), and people 
couldn't find the option
* we had to replace the 3.4 py.exe launcher, which was always for all users, 
while making it easy for non-admins to install Python

> If a user does not have admin privileges, it may not be helpful to them to 
> present choices they can't install.  For a default install - we could test if 
> user has admin privileges and install for all users, or fall back to 'user' 
> only install.

This is not possible. Most users do not start with admin privileges, but when 
prompted can provide them (via UAC). What we have here is the best we can offer 
without requiring complicated leaps of understanding for every type of user.

> recommend we move "for all users" to screen 3, since this screen is about 
> features to add, while the following screen is about how they are configured 
> on the system.

To clarify, we add an "Install py launcher for all users" checkbox on screen 3 
and remove it from screen 2? What gets removed from screen 3 to make space for 
it?

> 1. changing current "py launcher" checkbox to "upgrade py launcher"

But this is incorrect. If you don't select the checkbox, you don't get the 
launcher. It's a choice to have or not-have, not a choice to upgrade or 
not-upgrade.

> 2. moving "for all users" to next line down - looks like we have space
> 3. changing "for all users" to "py launcher for all users"

This is feasible, but not high priority. PRs welcome.

> 1. change "install for all users" to "install python for all users"

Trivial - the string is in one of the .wxl files in Tools/msi/bundle (I forget 
which one right now).

> 2. insert checkbox for "install py launcher for all users" as 2nd item in 
> list.  This would then be directly above the existing "Associate files with 
> Python" checkbox

Instead of the "for all users" on the previous page? This should be 
straightforward as well, as the enable/disable logic should be the same as for 
the current one. A change to one of the .thm files, IIRC.


But all this is going to take someone motivated enough to contribute and test 
it. Right now, I have higher priority issues to spend my limited volunteer time 
on than the traditional installer. I can review PRs though (ideally including 
real screenshots so I don't also have to do the manual testing myself).

--

___
Python tracker 

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



[issue37745] 3.8b3 - windows install gui/ inconsistent options

2019-08-07 Thread Christopher Brousseau


Christopher Brousseau  added the comment:

Ah - I didn't realize the nuances here - thank you for clearing that up for me. 
 Understand the design goal of keeping window size and using only checkboxes - 
simple.  Also agree some text changes may help, here are some suggestions for 
your consideration:

screen 1 - install python
recommend we change "install launcher" to "install py launcher" to be explicit.

Long term - it would be cleaner if the user had only 'default' and customize 
installation on this screen, with all configurations either bundled under 
Default, or moved to other screens for 'Customized' installs.  We could add 
notes under default that we're installing python for all users, py launcher, 
adding Python to PATH, etc.

If a user does not have admin privileges, it may not be helpful to them to 
present choices they can't install.  For a default install - we could test if 
user has admin privileges and install for all users, or fall back to 'user' 
only install.

screen 2 - optional features
recommend we move "for all users" to screen 3, since this screen is about 
features to add, while the following screen is about how they are configured on 
the system.  

If this isn't possible in this release, consider 
1. changing current "py launcher" checkbox to "upgrade py launcher"
2. moving "for all users" to next line down - looks like we have space
3. changing "for all users" to "py launcher for all users"

screen 3 - advanced options
two recommendations:
1. change "install for all users" to "install python for all users"
2. insert checkbox for "install py launcher for all users" as 2nd item in list. 
 This would then be directly above the existing "Associate files with Python" 
checkbox

--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-08-07 Thread Anselm Kruis


New submission from Anselm Kruis :

Starting with commit 468e5fec (bpo-36402: Fix threading._shutdown() race 
condition (GH-13948)) the following trivial test case leaks one reference and 
one memory block.

class MiscTestCase(unittest.TestCase):
def test_without_join(self):
# Test that a thread without join does not leak references.
# Use a debug build and run "python -m test -R: test_threading"
threading.Thread().start()

Attached is a patch, that adds this test case to Lib/test/test_threading.py. 
After you apply this patch "python -m test -R: test_threading" leaks one 
(additional) reference. This leak is also present in Python 3.7.4 and 3.8.

I'm not sure, if it correct not to join a thread, but it did work flawlessly 
and didn't leak in previous releases.
I didn't analyse the root cause yet.

--
components: Library (Lib)
files: threading-leak-test-case.diff
keywords: patch
messages: 349173
nosy: anselm.kruis
priority: normal
severity: normal
status: open
title: fix for bpo-36402 (threading._shutdown() race condition) causes 
reference leak
type: resource usage
versions: Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48534/threading-leak-test-case.diff

___
Python tracker 

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



[issue37004] SequenceMatcher.ratio() noncommutativity not well-documented

2019-08-07 Thread Tim Peters


Change by Tim Peters :


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



[issue37787] Minimum denormal or ** bug

2019-08-07 Thread Tim Peters


Tim Peters  added the comment:

Python delegates exponentiation with a Python float result to the platform C's 
double precision `pow()` function.  So this is just what the Windows C pow(2.0, 
-1075.0) returns.  All native floating point operations are subject various 
kinds of error, and this is one.

>>> import math
>>> math.pow(2.0, -1075.0)
5e-324
>>> math.pow(2.0, -1074.0) # same thing
5e-324

To avoid intermediate libm rounding errors, use ldexp instead:

>>> math.ldexp(1, -1074) # 2.0 ** -1074
5e-324
>>> math.ldexp(1, -1075) # 2.0 ** -1075
0.0

--
nosy: +tim.peters

___
Python tracker 

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



[issue37787] Minimum denormal or ** bug

2019-08-07 Thread SilentGhost


SilentGhost  added the comment:

This seems like a Windows-specific issues. Using the same version of python 
built with gcc 8.3, I get the results inline with your expectations and all the 
comparisons yield exactly opposite values.

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



[issue37004] SequenceMatcher.ratio() noncommutativity not well-documented

2019-08-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 7dafbe81bd0afb8bd67bc3a4c851a6c728fd87fe by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.7':
bpo-37004: Documented asymmetry of string arguments in difflib.SequenceMatcher 
for ratio method (GH-13482) (#15158)
https://github.com/python/cpython/commit/7dafbe81bd0afb8bd67bc3a4c851a6c728fd87fe


--

___
Python tracker 

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



[issue37004] SequenceMatcher.ratio() noncommutativity not well-documented

2019-08-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 1a3a40c1cb582e436d568009fae2b06c0b1978ed by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.8':
bpo-37004: Documented asymmetry of string arguments in difflib.SequenceMatcher 
for ratio method (GH-13482) (#15157)
https://github.com/python/cpython/commit/1a3a40c1cb582e436d568009fae2b06c0b1978ed


--
nosy: +terry.reedy

___
Python tracker 

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



[issue37787] Minimum denormal or ** bug

2019-08-07 Thread Kevin Braun


New submission from Kevin Braun :

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit 
(AMD64)]

I believe 2**-1074 is the smallest denormalized number for Python on my system 
(Windows), so I would expect 2**-1075 to yield 0.0, but it does not.  Instead:
>>> 2**-1074==2**-1075
True
>>> (2**-1074).hex()
'0x0.1p-1022'
>>> (2**-1075).hex()
'0x0.1p-1022'

And, the above is not consistent with the following:
>>> (2**-1074)/2
0.0
>>> (2**-1074)/2 == 2**-1075
False
>>> 1/2**1075
0.0
>>> 1/2**1075 == 2**-1075
False

Given the above observations, I suspect there is a bug in **.

--
components: Interpreter Core
messages: 349168
nosy: Kevin Braun
priority: normal
severity: normal
status: open
title: Minimum denormal or ** bug
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2019-08-07 Thread Łukasz Langa

Change by Łukasz Langa :


--
nosy: +lukasz.langa, ned.deily
priority: normal -> release blocker

___
Python tracker 

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



[issue37786] Doesn't delete PATH from System Variables (uninstallation)

2019-08-07 Thread Paul Francis


New submission from Paul Francis :

Neither the 32bit nor the 64bit version of Python 3.7.4 will remove the PATH 
variables from the System Environment Variables of the O/S even though the 
uninstallation screen explicitly displays a message that infers it is doing so.

Windows 10 Pro x64 v1903

--
components: Windows
messages: 349167
nosy: Paul Francis, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Doesn't delete PATH from System Variables (uninstallation)
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue15371] test_cmd_line_script should include namespace package tests

2019-08-07 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue37438] ConfigParser.set() docs should mention allow_no_value

2019-08-07 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue37785] argparse uses %s in gettext calls causing xgettext warnings

2019-08-07 Thread Jakub Kulik


Change by Jakub Kulik :


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

___
Python tracker 

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



[issue14019] Unify tests for str.format and string.Formatter

2019-08-07 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue37785] argparse uses %s in gettext calls causing xgettext warnings

2019-08-07 Thread Jakub Kulik


Change by Jakub Kulik :


--
title: argparse uses %s in gettext calls -> argparse uses %s in gettext calls 
causing xgettext warnings

___
Python tracker 

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



[issue37785] argparse uses %s in gettext calls

2019-08-07 Thread Jakub Kulik


New submission from Jakub Kulik :

Running xgettext on argparse.py (of any currently supported Python 3.x) return 
following warning:

./Lib/argparse.py: warning: 'msgid' format string with unnamed arguments cannot 
be properly localized: The translator cannot reorder the arguments. Please 
consider using a format string with named arguments, and a mapping instead of a 
tuple for the arguments.

Same problem was already partially fixed here: 
https://bugs.python.org/issue10528. I guess that this occurrence was either 
missed or is new since.

It would be nice to have this backported to all supported releases but 
considering incompatibility worries in issue linked above, it may be fixed only 
in 3.8+ (which is still nice).

--
components: Library (Lib)
messages: 349166
nosy: kulikjak
priority: normal
severity: normal
status: open
title: argparse uses %s in gettext calls
versions: 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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-07 Thread Joannah Nanjekye

Joannah Nanjekye  added the comment:

I think you can build on the story in the quick start section.

You can build on from the last section that starts with the paragraph:

Now that we have created and saved a configuration file, let’s read it back and 
explore the data it holds.

As it has some examples on read().

--

___
Python tracker 

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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-07 Thread Joannah Nanjekye

Joannah Nanjekye  added the comment:

@Stéphane, thanks for suggesting the above documentation.

Feel free to open a pull request here: https://github.com/python/cpython with 
this draft for review.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue35829] datetime: parse "Z" timezone suffix in fromisoformat()

2019-08-07 Thread Mark Haase


Mark Haase  added the comment:

Defining isoformat() and fromisoformat() as functional inverses is misguided. 
Indeed, it's not even true:

```
Python 3.7.2 (default, Dec 28 2018, 14:27:11)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> s = '2019-08-07t10:44:00+00:00'
>>> assert s == datetime.isoformat(datetime.fromisoformat(s))
Traceback (most recent call last):
  File "", line 1, in 
AssertionError
```

I agree with rdb that not parsing "Z" is inconvenient and counter intuitive. We 
have the same use case: parsing ISO strings created by JavaScript (or created 
by systems that interoperate with JavaScript). We have also memorized the same 
`.replace("Z", "+00:00")` hack, but this feels like a missing battery in the 
stdlib.

As Paul points out the legacy of isoformat() complicates the situation. A new 
pair of functions for RFC-3339 sounds reasonable to me, either 
rfcformat()/fromrfcformat() or more boldly inetformat()/frominetformat(). The 
contracts for these functions are simple: fromrfcformat() parses RFC-3339 
strings, and rfcformat() produces an RFC-3339 string. The docs for the ISO 
functions should be updated to point towards the RFC-compliant functions.

I'd be willing to work on a PR, but a change of this size probably needs to 
through python-ideas first?

--
nosy: +mehaase

___
Python tracker 

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



[issue37784] Compiling Python 3 with sqlite impossible when sqlite installation is in a non standard directory

2019-08-07 Thread Emmanuel Coirier


New submission from Emmanuel Coirier :

When compiling sqlite with a specific prefix, Python compilation process is 
unable to find sqlite despite CFLAGS and LDFLAGS environment variable correctly 
set.

The problem is in the setup.py, in the detect_modules function or the 
detect_sqlite function.

The sqlite_inc_paths list variable (line 1351) only contains well known places 
for sqlite, but there is no way to include others pathes (except by modifying 
the source code). The inc_dirs variable is also checked. But since it is not 
initialized with CFLAGS env_var, the CFLAGS -I pathes are not included, then 
not checked for a sqlite header file.

This behavior forbids compiling and installing sqlite in a specific directory. 
Adding the sqlite3.h path in the detect_sqlite function allows sqlite to be 
included in the final python compilation and install and is a possible 
workaround.

There should be a way to add this path to the detect_sqlite without having to 
edit the file on the fly in order to have a working sqlite module with a non 
standard sqlite install directory.

On a side note, why installing sqlite in some random directory ? People don't 
always have right to write in /usr/lib and /usr/local/lib.

--
components: Build, Extension Modules
messages: 349162
nosy: manuco
priority: normal
severity: normal
status: open
title: Compiling Python 3 with sqlite impossible when sqlite installation is in 
a non standard directory
type: compile error
versions: 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



[issue37783] int returns error (SystemError)

2019-08-07 Thread Philippe Négrel

Philippe Négrel  added the comment:

My bad the compilation Error came from the panda3d engine, which affected in 
some way the int class, issue solved, sry for wasting your time X)

--
resolution: third party -> not a bug
stage: test needed -> resolved
status: pending -> closed

___
Python tracker 

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



[issue37783] int returns error (SystemError)

2019-08-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

This looks like a problem in pandas.

If you can distill this down to a short python program that doesn't include any 
third party libraries, then we can take a look at it.

Otherwise, I suggest reporting it on the pandas bug tracker.

--
components: +Interpreter Core -Windows
nosy: +eric.smith
resolution:  -> third party
stage:  -> test needed
status: open -> pending
type: compile error -> crash

___
Python tracker 

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



[issue37782] typing.NamedTuple default parameter type issue

2019-08-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

example_text is not a field, since you're not giving it a type. It's just a 
normal class member.

The only field in the NamedTuple is example_int. You can't specify any other 
field in the call to MyTestedTuple().

To see this, help(MyTestedTuple) starts with:

class MyTestedTuple(builtins.tuple)
 |  MyTestedTuple(example_int: int = 3)

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



[issue37783] int returns error (SystemError)

2019-08-07 Thread Philippe Négrel

New submission from Philippe Négrel :

Whenever I compile the code, I get this error:

Exception has occurred: SystemError
 returned a result with an error set

This issue occured at line 32 of the file "SaveTools.py" in this github branch:
https://github.com/l3alr0g/Wave-simulator/tree/python-bug-report
(sry I couldn't get the 'Github PR' option to work)

--
components: Windows
messages: 349158
nosy: Philippe Négrel, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: int returns error (SystemError)
type: compile error
versions: Python 3.7

___
Python tracker 

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



[issue37782] typing.NamedTuple default parameter type issue

2019-08-07 Thread PBrudny


New submission from PBrudny :

There is an issue when NamedTuple parameter with default, which has not 
explicitly declared type is changed by keyword. Is that an expected behavior 
(no info 
https://docs.python.org/3.7/library/collections.html#collections.namedtuple)

Used python release:
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit 
(AMD64)] on win32

test.py:

from typing import NamedTuple


class MyTestedTuple(NamedTuple):
example_text = "default_text"
example_int: int = 3


if __name__ == '__main__':
print(MyTestedTuple().example_text)
fault_tuple = MyTestedTuple(example_text="text_from_call")
print(fault_tuple.example_text)

Call:

python test.py

default_text

Traceback (most recent call last):
  File "test.py", line 11, in 
fault_tuple = MyTestedTuple(example_text="text_from_call")
TypeError: __new__() got an unexpected keyword argument 'example_text'

--
components: Library (Lib)
files: test.py
messages: 349157
nosy: PBrudny
priority: normal
severity: normal
status: open
title: typing.NamedTuple default parameter type issue
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48533/test.py

___
Python tracker 

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



[issue35786] get_lock() method is not present for Values created using multiprocessing.Manager()

2019-08-07 Thread Dávid Nemeskey

Dávid Nemeskey  added the comment:

OK, actually: trying to create a multiprocessing.Value object and sharing it 
between a Pool of processes results in "RuntimeError: Synchronized objects 
should only be shared between processes through inheritance". So the only way 
seems to be through a Manager, but its Value() is of a different class?

--

___
Python tracker 

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



[issue35786] get_lock() method is not present for Values created using multiprocessing.Manager()

2019-08-07 Thread Dávid Nemeskey

Dávid Nemeskey  added the comment:

Nothing in the documentation says that multiprocessing.Value and the object 
returned by manager.Value() is any different. Nor is it clear why they should 
be.

It is perfectly understandable to expect that manager.Value() is actually of 
type multiprocessing.Value. It is also a valid assumption that the "canonical" 
way to acquire such objects are from a Manager, not directly. An example that 
reinforces this assumption is that of the Queue class, which HAS to be created 
through a Manager, lest we get "RuntimeError: Queue objects should only be 
shared between processes through inheritance".

In conclusion, I think this is definitely a valid issue. What I am not so sure 
about is if it is (just) an issue in the documentation or the API itself.

--
nosy: +nemeskeyd
versions: +Python 3.7

___
Python tracker 

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



[issue31388] Provide a way to defer SIGINT handling in the current thread

2019-08-07 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Another idea I had is to somehow deal with this in PyErr_WriteUnraisable: 
whenever PyErr_WriteUnraisable is called for a KeyboardInterrupt, defer that 
exception to a later time, for example when _PyEval_EvalFrameDefault() is 
called.

--

___
Python tracker 

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



[issue36338] urlparse of urllib returns wrong hostname

2019-08-07 Thread Xianbo Wang


Xianbo Wang  added the comment:

Python2 urlparse.urlparse and urllib2.urlparse.urlparse have a similar IPv6 
hostname parsing bug.

>>> urlparse.urlparse('http://nevil.com[]').hostname
>>> 'evil.com['

This is less practical to exploit since the parsed domain contains a '[' in the 
end.

Do I need to create a separate issue for this Python2 bug?

I think the way PR 14896 fix the python3 bug can also be applied to this.


Also, do we need a CVE ID for the python3 bug? As it may lead to some security 
issues in some Python apps, e.g., open-redirect. I have found such a case in a 
private bug bounty program.

--

___
Python tracker 

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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-07 Thread SilentGhost


Change by SilentGhost :


--
components: +Cross-Build -Library (Lib)
nosy: +Alex.Willmer
stage:  -> needs patch
type: enhancement -> 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



[issue37779] configparser: add documentation about several read() behaviour

2019-08-07 Thread SilentGhost


Change by SilentGhost :


--
assignee:  -> docs@python
components: +Documentation -Cross-Build
nosy: +docs@python -Alex.Willmer

___
Python tracker 

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



[issue24413] Inconsistent behavior between set and dict_keys/dict_items: for non-iterable object x, set().__or__(x) raises NotImplementedError, but {}.keys().__or__(x) raises TypeError

2019-08-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

set.update() accepts arbitrary iterable, but set.__or__() requires a set or 
frozenset.

--
nosy: +serhiy.storchaka

___
Python tracker 

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