[issue39222] unittest.mock.Mock.parent is broken or undocumented

2020-01-10 Thread Mario Corchero


Mario Corchero  added the comment:

If you refer to https://bugs.python.org/issue35357, this issue refers to 
`parent` at the time of creation of the mock. In the init it is still 
referenced as "parent".

The question is whether we want to also mangle "parent" in the __init__, as it 
seems it is not expected to be part of the API.

--

___
Python tracker 

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



[issue39222] unittest.mock.Mock.parent is broken or undocumented

2020-01-10 Thread Chris Withers


Chris Withers  added the comment:

I thought we'd already changed this to _mock_parent in the last year or so?

--

___
Python tracker 

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



[issue39222] unittest.mock.Mock.parent is broken or undocumented

2020-01-10 Thread Mario Corchero


Mario Corchero  added the comment:

@cjw296 or @michael.foord might know why the attribute was exposed as plain 
"parent". It was added more than 8 years ago and I am unnable to follow the git 
commit history.

They should then decide whether this is intenteded to be used by the users 
(which I never have used on the init TBH) and therefore document it or whether 
it is a private name on the init and if in that case it would be worth trying 
to mangle it.

In the meantime, xtreak suggested workflow is probably the best to go.

--

___
Python tracker 

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



[issue38259] having a PriorityQueue in multiprocessing.queue module like in queue module would be a plus

2020-01-10 Thread Yair Bonastre


Change by Yair Bonastre :


--
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue34110] cPickle may raise AttributeError when loading concurrently in threads

2020-01-10 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Fixed in Python 3 with #34572.

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



[issue37527] Timestamp conversion on windows fails with timestamps close to EPOCH

2020-01-10 Thread pingchao chen


Change by pingchao chen :


--
keywords: +patch
pull_requests: +17343
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/15498

___
Python tracker 

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



[issue39287] Document UTF-8 mode in the using/windows.

2020-01-10 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue21444] __len__ can't return big numbers

2020-01-10 Thread Zac Hatfield-Dodds


Change by Zac Hatfield-Dodds :


--
pull_requests: +17341
pull_request: https://github.com/python/cpython/pull/17934

___
Python tracker 

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



[issue12159] Integer Overflow in __len__

2020-01-10 Thread Zac Hatfield-Dodds


Change by Zac Hatfield-Dodds :


--
pull_requests: +17339
pull_request: https://github.com/python/cpython/pull/17934

___
Python tracker 

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



[issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function)

2020-01-10 Thread Zac Hatfield-Dodds


Change by Zac Hatfield-Dodds :


--
pull_requests: +17340
pull_request: https://github.com/python/cpython/pull/17934

___
Python tracker 

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



[issue31829] Portability issues with pickle

2020-01-10 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue39287] Document UTF-8 mode in the using/windows.

2020-01-10 Thread Inada Naoki


New submission from Inada Naoki :

I think the UTF-8 mode is very useful for Windows users.
Let's add section for the UTF-8 mode in the using/windows.

--
assignee: docs@python
components: Documentation
messages: 359722
nosy: docs@python, inada.naoki
priority: normal
severity: normal
status: open
title: Document UTF-8 mode in the using/windows.
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



[issue28143] ASDL compatibility with Python 3 system interpreter

2020-01-10 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
resolution:  -> wont fix
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



[issue39286] Configure includes LIBS but does not pass it to distutils

2020-01-10 Thread Alex Grund


New submission from Alex Grund :

When configuring with `LIBS=-lpthread` env var set, the pthread detection 
assumes that no flag is necessary and distutils will build all extensions 
without any flag for pthreads. This will make them fail, when they use certain 
pthread symbols on certain platforms

Example: On Power9 libpthread is a linker script which does not only link in 
the dynamic library but also a static part which contains e.g. pthread_atfork. 
As the extension is linked against libpython and that is linked against 
libpthread the extension has access to all symbols from the dynamic library, 
but not to any from the static library (if one exists). This makes extensions 
fail to build on Power9.

Related issue as an example: https://github.com/scipy/scipy/issues/11323

EasyBuild is one example that builds Python with that env var set: 
https://github.com/easybuilders/easybuild-framework/issues/3154

Very related to https://bugs.python.org/issue31769 as the issue is similar: 
Flag passed during configure not used by distutils.

--
components: Build, Distutils
messages: 359721
nosy: Alex Grund, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: Configure includes LIBS but does not pass it to distutils
versions: Python 2.7, 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



[issue39279] Don't allow non-Ascii digits in platform.py

2020-01-10 Thread Ram Rachum


Ram Rachum  added the comment:

My approach is that any input that's unexpected by the developer but accepted 
by the program could cause either a bug or a security problem, and should be 
rejected by the program. I don't have a specific example for this case.

If you think I need to come up with a specific example where this can be 
misused, or show that there are no computers in the world that willingly use 
the version number with non-Ascii digits, I'll let this issue go.

--

___
Python tracker 

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



[issue39279] Don't allow non-Ascii digits in platform.py

2020-01-10 Thread Ezio Melotti


Ezio Melotti  added the comment:

Can you elaborate on the rational for this proposed change?  I'm not sure if 
there cases where the digits are non-ASCII, but if there are, is rejecting them 
the right thing to do?
In the code there's a comment that mentions that the Windows version can be 
localized, so if the version number uses non-ASCII digits and we change the 
regex to only accept [0-9], those version strings won't be accepted/recognized 
anymore.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS

2020-01-10 Thread George Hickman


George Hickman  added the comment:

I came across this today with the same timeout behaviour on macOS 10.14.6.

After some digging I tracked it down to the Search Domains setting of my local 
network, this was set to "local", removing that immediately fixed the issue.

--
nosy: +ghickman

___
Python tracker 

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



[issue39285] PurePath.match indicates case-sensitive nature and presents a case-insensitive example

2020-01-10 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.match

Under PurePath.match there is a statement that case-sensitivity is followed but 
presents an example in Windows where case insensitive match returns True. This 
is confusing since match internally uses fnmatch.fnmatchcase that doesn't 
normalize case but in Windows files are case insensitive. Either the doc could 
be clarified that it's platform dependent or present a PosixPath example or 
present two examples with one for Linux and one for Windows that it's platform 
dependent.

As with other methods, case-sensitivity is observed:

>>> PureWindowsPath('b.py').match('*.PY')
True

--
assignee: docs@python
components: Documentation
messages: 359717
nosy: docs@python, pitrou, serhiy.storchaka, xtreak
priority: normal
severity: normal
status: open
title: PurePath.match indicates case-sensitive nature and presents a 
case-insensitive example
type: behavior
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



[issue39277] _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t

2020-01-10 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39283] Add ability to inherit unittest arguement parser

2020-01-10 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Can you please post the unittest script and the desired behavior? Are you 
testing your own argument parser created using argparse or want to write 
something replacing the argument parser of the unittest module like creating a 
custom unittest runner?

--
nosy: +xtreak

___
Python tracker 

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



[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-10 Thread Ram Rachum


Ram Rachum  added the comment:

Okay, since it seems like I'm the only one who wants this change, I'll let it 
go. Thanks for your input.

--

___
Python tracker 

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



[issue39166] Python 3.9.0a2 changed how "async for" traces its final iteration

2020-01-10 Thread Mark Shannon


Mark Shannon  added the comment:

I think this is now fixed.

Ned, feel free to reopen if it still isn't fixed.

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



[issue39166] Python 3.9.0a2 changed how "async for" traces its final iteration

2020-01-10 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 4c53e63cc966f98e141a09bc435b9f9c713b152d by Mark Shannon (Pablo 
Galindo) in branch 'master':
bpo-39166: Fix trace of last iteration of async for loops (#17800)
https://github.com/python/cpython/commit/4c53e63cc966f98e141a09bc435b9f9c713b152d


--

___
Python tracker 

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



[issue39284] Flexible indentation

2020-01-10 Thread aggu

New submission from aggu :

Indentation should not be "too strict", any number of leading whitespaces 
greater that its "parent" or "peer" should be allowed. For example, the 
following code should be allow:

a = 1
# step 1
# step 1.1
a = a + 1
# step 1.2
a = a * 2
# step 2
# …

, which is more readable, I think, than:

a = 1
# step 1
# step 1.1
a = a + 1
# step 1.2
a = a * 2
# step 2
# …

.

--
messages: 359712
nosy: aggu
priority: normal
severity: normal
status: open
title: Flexible indentation
type: enhancement

___
Python tracker 

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



[issue34311] locale.format() and locale.format_string() cast Decimals to float

2020-01-10 Thread Cédric Krier

Cédric Krier  added the comment:

For me, the name was natural as it is the reverse operation of the existing 
delocalize method.

--

___
Python tracker 

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



[issue39277] _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t

2020-01-10 Thread STINNER Victor


STINNER Victor  added the comment:

_PyTime_FromDouble() checks if!(_Py_DoubleInIntegralTypeRange(_PyTime_t, d)) 
with the macro:

#define _Py_InIntegralTypeRange(type, v) (_Py_IntegralTypeMin(type) <= v && v 
<= _Py_IntegralTypeMax(type))

and _Py_IntegralTypeMax(type)=2**63-1.

"v <= _Py_IntegralTypeMax(type)" compares a C double to a C int64_t: the 
compiler casts the C int64_t to a C double.

The problem is that 2**63-1 casted to a C double rounds using ROUND_HALF_EVEN 
rounding mode which gives a number *greater* than 2**63-1: we get 2**63.

To implement "v <= max", we have to round max towards zero (ROUND_DOWN), not 
round it using ROUND_HALF_EVEN.

I didn't find a way to control the rounding mode of casting C int64_t to C 
double, but we can round it *afterwards* using nextafter(max, 0.0) (ROUND_DOWN).

--

___
Python tracker 

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



[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If somebody want to backport tests to 3.8, he must check manually all end 
positions.

--
resolution:  -> fixed
stage: patch review -> 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



[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 850a8856e120f8cba15e557a0e791f93b43d6989 by Serhiy Storchaka in 
branch 'master':
bpo-39235: Check end_lineno and end_col_offset of AST nodes. (GH-17926)
https://github.com/python/cpython/commit/850a8856e120f8cba15e557a0e791f93b43d6989


--

___
Python tracker 

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



[issue39280] Don't allow datetime parsing to accept non-Ascii digits

2020-01-10 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



<    1   2