[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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

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



[issue39259] poplib.POP3/POP3_SSL should reject timeout = 0 (non-blocking mode)

2020-01-10 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +17344
pull_request: https://github.com/python/cpython/pull/17936

___
Python tracker 

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



[issue39259] poplib.POP3/POP3_SSL should reject timeout = 0 (non-blocking mode)

2020-01-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c39b52f1527868c7ada9385669c38edf98858921 by Victor Stinner 
(Dong-hee Na) in branch 'master':
bpo-39259: poplib now rejects timeout = 0 (GH-17912)
https://github.com/python/cpython/commit/c39b52f1527868c7ada9385669c38edf98858921


--

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

Similar issue in HHVM:

* https://github.com/facebook/hhvm/issues/5932
* https://github.com/PPC64/hhvm/commit/7cdb76b4f495aa7aa40a696379862916c27f5828

--

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

Paul Ganssle  added the comment:

> Yes, but not within the same format. If someone were to choose the format 
> '2014-04-10T24:00:00', they would have a reasonable expectation that there is 
> only one unique string that corresponds with that datetime

That's a particularly bad example, because it's exactly the same as another 
string with the exact same format:

  2014-04-11T00:00:00

Since ISO 8601 allows you to specify midnight (and only midnight) using 
previous day + 24:00. Admittedly, that is the only ambiguity I know of offhand 
(though it's a huge spec) *for a given format*, but also ISO 8601 does not 
really have a concept of format specifiers, so it's not like there's a way to 
unambiguously specify the format you are intending to use.

Either way, I think we can explicitly dispense with "there will be an exact 
mapping between a given (format_str, datetime_str) pair and the datetime it 
produces" as a goal here. I can't think of any good reason you'd want that 
property, nor have we made any indication that I can see that we provide it 
(probably the opposite, since there are some formats that explicitly ignore 
whitespace).

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

I wouldn't go that far. I think I am +0 or +1 on this change, I just wanted to 
be absolutely clear *why* we're doing this. I don't want someone pointing at 
this thread in the future and saying, "Core dev says that it's a bug in their 
code if they don't follow X standard / if more than one string produces the 
same datetime / etc".

I think the strongest argument for making this or a similar change is that I'm 
fairly certain that we don't have the bandwidth to handle internationalized 
dates and I don't think we have much to gain by doing a sort of half-assed 
version of that by accepting unicode transliterations of numerals and calling 
it a day. I think there are tons of edge cases here that could bite people, and 
if we don't support this *now* I'd rather give people an error message early in 
the process and try to point people at a library that is designed to handle 
datetime localization issues. If all we're going to do is switch [0-9] to \d 
(which won't work for the places where it's actually [1-9], mind you), I think 
people will get a better version of that with something like:

  def normalize_dt_str(dt_str):
  return "".join(str(int(x)) if x.isdigit() else x
 for x in dt_str)

There are probably more robust and/or faster versions of this, but it's 
probably roughly equivalent to what we'd be doing here *anyway*, and at least 
people would have to opt-in to this.

I am definitely open to us supporting non-ASCII digits in strptime if it would 
be useful at the level of support we could provide, but given that it's 
currently broken for any reasonable use case and as far as I know no one has 
complained, we're better off resolving the inconsistency by requiring ASCII 
digits and considering non-ASCII support to be a separate feature request.

CC-ing Inada on this as unicode guru and because he might have some intuition 
about how useful non-ASCII support might be. The only place I've seen non-ASCII 
dates is in Japanese graveyards, and those tend to use Chinese numerals (which 
don't match \d anyway), though Japanese and Korean also tends to make heavier 
use of "full-width numerals" block, so maybe parsing something like 
"2020-02-02" is an actual pain point that would be improved by this change 
(though, again, I suspect that this is just the beginning of the required 
changes and we may never get a decent implementation that supports unicode 
numerals).

--
nosy: +inada.naoki

___
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 Steven D'Aprano


Steven D'Aprano  added the comment:

> If all we're going to do is 
> switch [0-9] to \d (which won't work for the places where it's 
> actually [1-9], mind you)

Ah, that's a good point.

[...]
> we're better off resolving the 
> inconsistency by requiring ASCII digits and considering non-ASCII 
> support to be a separate feature request.

This seems reasonable.

--

___
Python tracker 

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



[issue39288] Add math.nextafter(a, b)

2020-01-10 Thread STINNER Victor


New submission from STINNER Victor :

Linux manual page of nextafter():
"""
The nextafter() function return the next representable floating-point  value 
following x in the direction of y.  If y is less than x, these functions will 
return the largest representable number less than x.

If x equals y, the functions return y.
"""

I used this function to round an integer towards zero when casting a float to 
an integer in bpo-39277. Example in C:

#include 
#include 
#include 
int main()
{
int64_t int64_max = 9223372036854775807LL;
double d = (double)int64_max;  /* ROUND_HALF_EVEN */
double d2 = nextafter(d, 0.0);
printf("i = %ld\n", int64_max);
printf("d = %.0f\n", d);
printf("d2 = %.0f\n", d2);
printf("d - d2 = %.0f\n", d - d2);
return 0;
}

Output:

i = 9223372036854775807
d = 9223372036854775808
d2 = 9223372036854774784
d - d2 = 1024

The function exists in numpy:

numpy.nextafter(x1, x2, /, out=None, *, where=True, casting='same_kind', 
order='K', dtype=None, subok=True[, signature, extobj]) = 

Return the next floating-point value after x1 towards x2, element-wise.

https://docs.scipy.org/doc/numpy/reference/generated/numpy.nextafter.html


Attached PR adds math.nextafter().

--
components: Library (Lib)
messages: 359731
nosy: vstinner
priority: normal
severity: normal
status: open
title: Add math.nextafter(a, b)
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



[issue39288] Add math.nextafter(a, b)

2020-01-10 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +3.3regression
nosy: +lemburg, mark.dickinson, rhettinger, stutzbach

___
Python tracker 

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



[issue39288] Add math.nextafter(a, b)

2020-01-10 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue18233] SSLSocket.getpeercertchain()

2020-01-10 Thread Chris Burr


Change by Chris Burr :


--
pull_requests: +17346
pull_request: https://github.com/python/cpython/pull/17938

___
Python tracker 

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



[issue39289] crypt.crypt crashes on 3.9 where it didn't on 3.8

2020-01-10 Thread Vinay Sajip


New submission from Vinay Sajip :

The following script (cryptest.py):

import crypt

for salt in ('foo', 
'$2a$04$5BJqKfqMQvV7nS.yUguNcueVirQqDBGaLXSqj.rs.pZPlNR0UX/HK'):
t = 'test'
h = crypt.crypt(t, salt)
print("'%s' with '%s' -> %s" % (t, salt, h))

crashes in 3.9, whereas it doesn't in earlier versions:

$ python2.7 cryptest.py 
'test' with 'foo' -> foy6TgL.HboTE
'test' with '$2a$04$5BJqKfqMQvV7nS.yUguNcueVirQqDBGaLXSqj.rs.pZPlNR0UX/HK' -> 
None
$ python3.7 cryptest.py 
'test' with 'foo' -> foy6TgL.HboTE
'test' with '$2a$04$5BJqKfqMQvV7nS.yUguNcueVirQqDBGaLXSqj.rs.pZPlNR0UX/HK' -> 
None
$ python3.8 cryptest.py 
'test' with 'foo' -> foy6TgL.HboTE
'test' with '$2a$04$5BJqKfqMQvV7nS.yUguNcueVirQqDBGaLXSqj.rs.pZPlNR0UX/HK' -> 
None
$ python3.9 cryptest.py 
'test' with 'foo' -> foy6TgL.HboTE
Traceback (most recent call last):
  File "/home/vinay/projects/scratch/cpython/cryptest.py", line 5, in 
h = crypt.crypt(t, salt)
  File "/home/vinay/.local/lib/python3.9/crypt.py", line 82, in crypt
return _crypt.crypt(word, salt)
OSError: [Errno 22] Invalid argument

This is on Ubuntu 18.04, 64-bit.

--
components: Library (Lib)
keywords: 3.9regression
messages: 359732
nosy: vinay.sajip
priority: normal
severity: normal
status: open
title: crypt.crypt crashes on 3.9 where it didn't on 3.8
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



[issue39289] crypt.crypt crashes on 3.9 where it didn't on 3.8

2020-01-10 Thread STINNER Victor


STINNER Victor  added the comment:

I fail to reproduce the issue on the master branch of Python on Fedora 31.

--
nosy: +vstinner

___
Python tracker 

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



[issue39289] crypt.crypt fail with OSError "[Errno 22] Invalid argument" on 3.9 where it didn't on 3.8

2020-01-10 Thread STINNER Victor


Change by STINNER Victor :


--
title: crypt.crypt crashes on 3.9 where it didn't on 3.8 -> crypt.crypt fail 
with OSError "[Errno 22] Invalid argument" on 3.9 where it didn't on 3.8

___
Python tracker 

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



[issue39289] crypt.crypt fail with OSError "[Errno 22] Invalid argument" on 3.9 where it didn't on 3.8

2020-01-10 Thread Dong-hee Na


Dong-hee Na  added the comment:

I also fail to reproduce the issue on the master branch of Python on macOS.

--
nosy: +corona10

___
Python tracker 

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



[issue13305] datetime.strftime("%Y") not consistent for years < 1000

2020-01-10 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

In issue39103, I filed a bug relating to this issue.

I'd like for Python to provide a portable implementation of strftime instead of 
just documenting that the version isn't portable.

Given that this ticket assigned to 'docs' suggests that a portable version is 
out of the question. Can we expand the scope of this issue to actually 
providing a portable version?

--
nosy: +jaraco

___
Python tracker 

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



[issue39200] Fix inaccurate TypeError messages when calling with insufficient arguments

2020-01-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset abdc634f337ce4943cd7d13587936837aac2ecc9 by Victor Stinner 
(Dong-hee Na) in branch 'master':
bpo-39200: Correct the error message for min/max builtin function (GH-17814)
https://github.com/python/cpython/commit/abdc634f337ce4943cd7d13587936837aac2ecc9


--
nosy: +vstinner

___
Python tracker 

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



[issue39200] Fix inaccurate TypeError messages when calling with insufficient arguments

2020-01-10 Thread STINNER Victor


STINNER Victor  added the comment:

Dong-hee, Pablo: Should we backport the two fixes to 3.7 and 3.8 branches? IMHO 
yes, we should backport.

--

___
Python tracker 

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



[issue39200] Fix inaccurate TypeError messages when calling with insufficient arguments

2020-01-10 Thread Dong-hee Na


Dong-hee Na  added the comment:

Victor: Changes are only correcting the message.
I am +1 on backporting :)

--

___
Python tracker 

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



[issue39200] Fix inaccurate TypeError messages when calling with insufficient arguments

2020-01-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17347
pull_request: https://github.com/python/cpython/pull/17940

___
Python tracker 

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



[issue39200] Fix inaccurate TypeError messages when calling with insufficient arguments

2020-01-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17349
pull_request: https://github.com/python/cpython/pull/17942

___
Python tracker 

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



[issue39200] Fix inaccurate TypeError messages when calling with insufficient arguments

2020-01-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17348
pull_request: https://github.com/python/cpython/pull/17941

___
Python tracker 

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



[issue39200] Fix inaccurate TypeError messages when calling with insufficient arguments

2020-01-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17350
pull_request: https://github.com/python/cpython/pull/17943

___
Python tracker 

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



[issue39200] Fix inaccurate TypeError messages when calling with insufficient arguments

2020-01-10 Thread STINNER Victor


STINNER Victor  added the comment:

Backport PRs are ready for 3.7 and 3.8. Question: is there a risk of breaking 
the backward compatibility if a project unit test rely on the exact error 
message? If yes, maybe it's better to reject the backports and close this issue 
(only change the error message in 3.9).

--

___
Python tracker 

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



[issue39259] poplib.POP3/POP3_SSL should reject timeout = 0 (non-blocking mode)

2020-01-10 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +17351
pull_request: https://github.com/python/cpython/pull/17939

___
Python tracker 

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



[issue13305] datetime.strftime("%Y") not consistent for years < 1000

2020-01-10 Thread STINNER Victor


STINNER Victor  added the comment:

> I'd like for Python to provide a portable implementation of strftime instead 
> of just documenting that the version isn't portable.

If someone wants to do that, I suggest to first start with a project on PyPI. 
It sounds like a tricky project. Date, time, locales and localization are hard 
problems!

--

___
Python tracker 

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



[issue39241] Popen of python3.6 hangs on os.read(errpipe_read, 50000)

2020-01-10 Thread Xu


Xu  added the comment:

Thanks Stinner.

Do you have some clues about this issue ?
In my case, our test system use Popen to start a few infrastructure processes 
for tests going. After tests done we will kill all processes and start again 
for new round.

Most of time it works fine.  However we have some chances where one Popen hangs 
on "os.read(errpipe_read, 5) forever.

The close_fd is always true.

I guess there is some subtle issue here.

--

___
Python tracker 

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



[issue39290] lib2to3.fixes.fix_import: support imports_as_name in traverse_imports

2020-01-10 Thread Batuhan


New submission from Batuhan :

I've been working on custom lib2to3 fixers and I use some of the already 
definied utilites inside the fixers. But traverse_imports can't traverse from 
import names, which is pretty simple and straight forward to implement.

--
messages: 359742
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: lib2to3.fixes.fix_import: support imports_as_name in traverse_imports

___
Python tracker 

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



[issue39241] Popen of python3.6 hangs on os.read(errpipe_read, 50000)

2020-01-10 Thread STINNER Victor


STINNER Victor  added the comment:

I have no clue. Try to attach a debugger and try to inspect the Python frames. 
You can use gdb with python-gdb.py for that, for example. Or play with 
faulthandler, especially faulthandler.dump_traceback_later().

--

___
Python tracker 

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



[issue39290] lib2to3.fixes.fix_import: support imports_as_name in traverse_imports

2020-01-10 Thread Batuhan


Change by Batuhan :


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

___
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 Eric V. Smith


Eric V. Smith  added the comment:

Please discuss this idea on the python-ideas mailing list first. It would also 
certainly require a PEP.

But I don't want to get your hopes up: there's almost no chance that this would 
be accepted.

I'm going to close this issue. If the idea gains any traction, we can re-open 
it.

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



[issue39291] "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage

2020-01-10 Thread Rockmizu


New submission from Rockmizu :

Python version: Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC 
v.1916 64 bit (AMD64)] on win32

The usage of symlink_to() is link.symlink_to(target)
while the usage of link_to() is target.link_to(link).
This could be confusing.

Here is an example:

>>> import pathlib
>>> target = pathlib.Path('target.txt')
>>> p1 = pathlib.Path('symlink.txt')
>>> p2 = pathlib.Path('hardlink.txt')
>>> p1.symlink_to(target)
>>> p2.link_to(target)  # expected usage
Traceback (most recent call last):
  File "", line 1, in 
  File "D:\Program Files\Python38\lib\pathlib.py", line 1346, in link_to
self._accessor.link_to(self, target)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 
'hardlink.txt' -> 'target.txt'
>>> target.link_to(p2)  # current usage
>>>

Since os.symlink() and os.link() have the same argument order,

>>> import os
>>> os.symlink('target.txt', 'symlink.txt')
>>> os.link('target.txt', 'hardlink.txt')
>>>

it would be nicer if the pathlib has the same argument order too.

--
components: Library (Lib)
messages: 359745
nosy: Rockmizu
priority: normal
severity: normal
status: open
title: "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed 
usage
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue39292] syslog constants behind rfc

2020-01-10 Thread Ryan


New submission from Ryan :

When using the SysLogHandler 
(https://docs.python.org/3/library/logging.handlers.html#logging.handlers.SysLogHandler)
 the supported facilities appear to be lagging the RFC (5454 ?), or at least 
what is being supported in other mainstream languages. I Specifically need 
LOG_AUDIT and LOG_NTP but there are a couple others. The syslog "openlog" 
function takes an INT but not sure how to get an INT through the python 
SysLogHandler because it's based on a static list of names and symbolic values.
Wikipedia (https://en.wikipedia.org/wiki/Syslog#Facility) suggests LOG_AUTH and 
LOG_NTP are in the RFC. 
This is my first ticket here so hopefully this is the right place for it. Maybe 
there is a workaround or some re-education needed on my part...

--
components: Library (Lib)
messages: 359746
nosy: tryanunderw...@gmail.com
priority: normal
severity: normal
status: open
title: syslog constants behind rfc
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



[issue39291] "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage

2020-01-10 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pitrou

___
Python tracker 

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



[issue39292] syslog constants behind rfc

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



[issue39292] syslog constants behind rfc

2020-01-10 Thread SilentGhost


Change by SilentGhost :


--
type:  -> behavior
versions:  -Python 2.7, 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



[issue39291] "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage

2020-01-10 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Ahah. Nice catch!

Well, it's a pity this got overlooked when we added Path.link_to().  But I'm 
afraid it's late to change it now, since this has been released, and changing 
the argument order would break existing code in potentially dangerous ways.

Note the original issue where this was added was issue26978.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue39291] "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage

2020-01-10 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Closing as won't fix.  If you feel strongly about this, I would suggest to 
bring the discussion on python-dev: 
https://mail.python.org/mailman3/lists/python-dev.python.org/

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



[issue39204] Automate adding Type Annotations to Documentation

2020-01-10 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue39292] syslog constants behind rfc

2020-01-10 Thread Vinay Sajip


Change by Vinay Sajip :


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

___
Python tracker 

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



[issue39257] contextvars.Context.run hangs forever in ProccessPoolExecutor

2020-01-10 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue39257] contextvars.Context.run hangs forever in ProccessPoolExecutor

2020-01-10 Thread Yury Selivanov


Yury Selivanov  added the comment:

> This throws 'cannot pickle Context' 

Yes, this is expected. contextvars are not compatible with multiprocessing.

>  This hangs forever *

This hanging part is weird, and most likely hints at a bug in multiprocessing.

--

___
Python tracker 

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



[issue39292] syslog constants behind rfc

2020-01-10 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset ce54519aa09772f4173b8c17410ed77e403f3ebf by Vinay Sajip in branch 
'master':
bpo-39292: Add missing syslog facility codes. (GH-17945)
https://github.com/python/cpython/commit/ce54519aa09772f4173b8c17410ed77e403f3ebf


--

___
Python tracker 

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



[issue39289] crypt.crypt fail with OSError "[Errno 22] Invalid argument" on 3.9 where it didn't on 3.8

2020-01-10 Thread Vinay Sajip


Vinay Sajip  added the comment:

I can also reproduce it on Ubuntu 16.04.6 LTS (the first Ubuntu was the Linux 
Mint version based on Ubuntu 18.04).

--

___
Python tracker 

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



[issue39289] crypt.crypt fail with OSError "[Errno 22] Invalid argument" on 3.9 where it didn't on 3.8

2020-01-10 Thread Vinay Sajip


Vinay Sajip  added the comment:

Another data point: both failing machines were VMware virtual machines.

--

___
Python tracker 

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



[issue39288] Add math.nextafter(a, b)

2020-01-10 Thread Mark Dickinson


Mark Dickinson  added the comment:

I'm not opposed to some form of this by any means, but I fear there's some 
bikeshedding to go through, both on the name and the functionality (one 
function with two arguments, or two functions each taking a single argument?).

C 99 prescribes "nextafter" and "nexttoward" (which is pretty much the same as 
"nextafter" if you don't care about the distinction between float, double and 
long double).

IEEE 754, on the other hand, requires instead nextUp and nextDown, which take a 
single argument and move towards +inf or -inf (respectively).

Python's Decimal type has a two-argument next_toward method.

NumPy has nextafter.

Java provides all three of nextUp, nextDown and nextAfter.

For sure implementing nextafter is easiest, since we can just wrap the C 
version. That doesn't *necessarily* make it the right variant to go for.

(Annoyingly enough, none of these is actually what I tend to want in practice, 
which is "next larger" and "next smaller" functions, or more precisely, 
nextAwayFromZero and nextTowardsZero functions. nextTowardsZero is of course a 
special case of nextafter, but nextAwayFromZero doesn't match any of these.)

--
nosy: +tim.peters

___
Python tracker 

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



[issue34297] Windows py.exe launcher fail to handle quote correctly

2020-01-10 Thread Maxime Belanger


Change by Maxime Belanger :


--
nosy: +Maxime Belanger

___
Python tracker 

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



[issue1531415] parsetok.c emits warnings by writing to stderr

2020-01-10 Thread Brett Cannon


Brett Cannon  added the comment:

Pablo, is this still a thing to care about?

--
nosy: +pablogsal

___
Python tracker 

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



[issue1596321] KeyError at exit after 'import threading' in other thread

2020-01-10 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue1674555] sys.path in tests contains system directories

2020-01-10 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue2636] Adding a new regex module (compatible with re)

2020-01-10 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue4347] Circular dependency causes SystemError when adding new syntax

2020-01-10 Thread Brett Cannon


Change by Brett Cannon :


--
resolution: wont fix -> 

___
Python tracker 

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



[issue4347] Circular dependency causes SystemError when adding new syntax

2020-01-10 Thread Brett Cannon


Brett Cannon  added the comment:

Pablo, is this still an issue?

--
nosy: +pablogsal

___
Python tracker 

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



[issue39293] Windows 10 64-bit needs reboot

2020-01-10 Thread Tony


New submission from Tony :

After installing python 3.8.1 64-bit, on Windows 10 64-bit version 1909, the 
system needs to be rebooted to validate all settings in the registry. Otherwise 
will cause a lot of exceptions, like Path not found etc.

--
components: Installation
messages: 359756
nosy: ToKa
priority: normal
severity: normal
status: open
title: Windows 10 64-bit needs reboot
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue39247] dataclass defaults and property don't work together

2020-01-10 Thread Juan Arrivillaga


Juan Arrivillaga  added the comment:

So, after glancing at the source code:
https://github.com/python/cpython/blob/ce54519aa09772f4173b8c17410ed77e403f3ebf/Lib/dataclasses.py#L869

During this processing of fields, couldn't you just special case 
property/descriptor objects?

--
nosy: +juanpa.arrivillaga

___
Python tracker 

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



[issue39292] syslog constants behind rfc

2020-01-10 Thread Batuhan


Batuhan  added the comment:

@vinay.sajip PR 17945 looks resolved this, can this issue be closed?

--
nosy: +BTaskaya

___
Python tracker 

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



[issue19557] ast - docs for every node type are missing

2020-01-10 Thread Batuhan


Batuhan  added the comment:

@pablogsal is working on documenting nodes (not every node type that exists, 
the ones that aren't deprecated) in PR 17812

--
nosy: +BTaskaya, pablogsal

___
Python tracker 

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



[issue39292] syslog constants behind rfc

2020-01-10 Thread Vinay Sajip


Vinay Sajip  added the comment:

> can this issue be closed?

Not quite yet. Waiting for feedback from the original reporter as to whether 
this change meets the requirements. I've also treated this as an enhancement 
rather than a bug, and so I am not currently planning to back-port these 
changes. I will close this issue once I get feedback.

--

___
Python tracker 

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



[issue39289] crypt.crypt fail with OSError "[Errno 22] Invalid argument" on 3.9 where it didn't on 3.8

2020-01-10 Thread Vinay Sajip


Vinay Sajip  added the comment:

It appears that a check for the return value from the crypt/crypt_r primitives 
was added to fix bpo-38402. So, this is expected behaviour in Python 3.9. 
Change was in

https://github.com/python/cpython/commit/0d3fe8ae4961bf551e7d5e42559e2ede1a08fd7c

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



[issue39294] zipfile.ZipInfo objects contain invalid 'extra' fields.

2020-01-10 Thread Bram Stolk


New submission from Bram Stolk :

This has been tested with Windows Python 2.7 and Python 3.8

If you get the ZipInfo objects of a ZIP file that is larger than 2GiB, then all 
the ZipInfo entries with a header offset > 2G will report phantom 'extra' data.

import zipfile
zipname = "reallybig.zip"
z = zipfile.ZipFile( zipname )
zi = z.infolist()
for inf in zi:
  print( inf.filename, inf.header_offset, inf.extra )  

And observe that:
* All entries with offset < 2G will report no extra field.
* All entries with offset > 2G will report extra field.

It's hard to package this up as a self-contained test, because it requires a 
very large zip to test.

--
components: IO
messages: 359762
nosy: Bram Stolk
priority: normal
severity: normal
status: open
title: zipfile.ZipInfo objects contain invalid 'extra' fields.
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-10 Thread Matthew Newville


New submission from Matthew Newville :

We have a library (https://github.com/pyepics/pyepics) that wraps several C 
structures for a communication protocol library that involves many C->Python 
callbacks.  One of the simpler structures we wrap with ctypes is defined with

typedef struct ca_access_rights {
unsignedread_access:1;
unsignedwrite_access:1; } caar;

struct  access_rights_handler_args {
long  chanId; /* channel id */
caar  access; /* access rights state */
};

which we had wrapped (perhaps naively) as 

class access_rights_handler_args(ctypes.Structure):
"access rights arguments"
_fields_ = [('chid', ctypes.c_long),
('read_access', ctypes.c_uint, 1),
('write_access', ctypes.c_uint, 1)]

which we would then this structure as the function argument of a callback 
function that the underlying library would call, using

_Callback = ctypes.CFUNCTYPE(None, 
ctypes.POINTER(access_rights_handler_args))(access_rights_handler)

and the python function `access_righte_handler` would be able to unpack and use 
this structure.  This worked for Python 2.7, 3.3 - 3.7.5 on 64-bit Linux, 
Windows, and MacOS.  This code was well-tested and was used in production code 
on very many systems. It did not cause segfaults.

With Python 3.7.6 this raises an exception at the ctypes.CFUNCTYPE() call with


./lib/python3.7/ctypes/__init__.py", line 99, in CFUNCTYPE
class CFunctionType(_CFuncPtr):
TypeError: item 1 in _argtypes_ passes a struct/union with a bitfield by value, 
which is unsupported.


We were able to find a quick work-around this by changing the structure 
definition to be

class access_rights_handler_args(ctypes.Structure):
"access rights arguments"
_fields_ = [('chid', ctypes.c_long),
('access', ctypes.c_ubyte)]

and then explicitly extract the 2 desired bits from the byte. Of course, that 
byte is more data than is being sent in the structure, so there is trailing 
garbage.

This change seems to have been related to https://bugs.python.org/issue16576.

Is there any way to restore the 
no-really-I'm-not-making-it-up-it-was-most-definitely-working-for-us behavior 
of Python 3.7.5 and earlier?  

If this is not possible, what would be the right way to wrap this sort of 
structure? Thanks

--
components: ctypes
messages: 359763
nosy: Matthew Newville
priority: normal
severity: normal
status: open
title: usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6
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



[issue39247] dataclass defaults and property don't work together

2020-01-10 Thread Juan Arrivillaga


Juan Arrivillaga  added the comment:

Actually, couldn't the following be a workaround, just set the property on the 
class after the class definition:


import dataclasses
import typing
@dataclasses.dataclass
class FileObject:
uploaded_by:typing.Optional[None]=None

def _uploaded_by_getter(self):
return self._uploaded_by

def _uploaded_by_setter(self, uploaded_by):
print('Setter Called with Value ', uploaded_by)
self._uploaded_by = uploaded_by

FileObject.uploaded_by = property(
FileObject._uploaded_by_getter,
FileObject._uploaded_by_setter
)
p = FileObject()
print(p)
print(p.uploaded_by)

--

___
Python tracker 

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



[issue17013] Allow waiting on a mock

2020-01-10 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue38567] urllib.parse.unquote_plus raises incorrect error message when string parameter is bytes

2020-01-10 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +orsenthil

___
Python tracker 

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



[issue39296] Windows register keys

2020-01-10 Thread Tony


New submission from Tony :

It would be more practical to name the Windows main registry keys 'python', 
with for example 'python32' or 'python64'. This would make searching the 
registry for registered python versions (single and/or multi users) a lot 
easier.

--
components: Windows
messages: 359765
nosy: ToKa, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows register keys
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



[issue32021] Brotli encoding is not recognized by mimetypes

2020-01-10 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Now that two years have passed, is there any additional info as to whether this 
should be added or not?  It does seem that the format is active 
(https://github.com/google/brotli).

--
nosy: +cheryl.sabella
versions: +Python 3.8, Python 3.9 -Python 2.7, 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



[issue38901] [venv] Add a CLI flag to venv to use the pwd basename as the prompt

2020-01-10 Thread Vinay Sajip


Change by Vinay Sajip :


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

___
Python tracker 

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



[issue36556] Trashcan causing duplicated __del__ calls

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



[issue36516] Python Launcher can not recognize pyw file as Python GUI Script file type correctly.

2020-01-10 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue17254] add thai encoding aliases to encodings.aliases

2020-01-10 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
versions: +Python 3.9 -Python 3.4

___
Python tracker 

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



[issue39207] concurrent.futures.ProcessPoolExecutor does not properly reap jobs and spawns too many workers

2020-01-10 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +bquinlan, pitrou

___
Python tracker 

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



[issue38330] httplib specifies content-length when transfer-encoding present

2020-01-10 Thread apmatthews


apmatthews  added the comment:

ping :)

--

___
Python tracker 

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



[issue39217] GC of a ctypes object causes application crash

2020-01-10 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

"Is this a bug" questions are often better asked on python-list.  (I don't 
know.)  If so, the bug needed to be tested on the current development version 
(3.9 now).  Likely, someone on python-list will try given reproducible code.


2.7 has reach EOL.

--
nosy: +terry.reedy
versions: +Python 3.9 -Python 2.7, Python 3.7

___
Python tracker 

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



  1   2   >