[issue12849] Cannot override 'connection: close' in urllib2 headers

2020-03-09 Thread henrik242


henrik242  added the comment:

Correction: My problem in Issue 39875 was not related to Connection: Close, but 
with weird POST handling in Solr.

--

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +18229
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/18871

___
Python tracker 

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



[issue39909] Assignment expression in assert causes SyntaxError

2020-03-09 Thread Михаил Кыштымов

New submission from Михаил Кыштымов :

Assignment expression in assert causes SyntaxError

Minimal case:
```
assert var := None
```

Error:
```
  File "", line 1
assert var := None
   ^
SyntaxError: invalid syntax
```

Workaround:
```
assert (var := None)
```

My use case:
```
my_dict = dict()
assert value := my_dict.get('key')
```

--
components: Interpreter Core
messages: 363698
nosy: Михаил Кыштымов
priority: normal
severity: normal
status: open
title: Assignment expression in assert causes SyntaxError
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



[issue39909] Assignment expression in assert causes SyntaxError

2020-03-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

I believe this is by design, as is the same restriction on statement-level 
assignment expressions. And if requiring parens discourages the use of 
assignment expressions in asserts, I think that's a good thing.

Why not just use the workaround you've already identified?

--
nosy: +eric.smith

___
Python tracker 

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



[issue39909] Assignment expression in assert causes SyntaxError

2020-03-09 Thread Михаил Кыштымов

Михаил Кыштымов  added the comment:

if this is by design i'm fine with somebody closing this issue.

i've not found mention of such case in pep so i though it's not by design.
docs say `assert` just takes "expression" and "assignment expression" has 
"expression" in it's name.
https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement

workaraund does not look as cool because of parentheses.

again, if this is "as intended" i'm fine with closing issue.

--

___
Python tracker 

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



[issue39909] Assignment expression in assert causes SyntaxError

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> assert var := None

It's good that this syntax is rejected: it looks like a typo (assert var == 
None). Moreover, it's part of of the PEP 572 design.
https://www.python.org/dev/peps/pep-0572/#exceptional-cases

Python works as expected, I suggest to close the issue as not a bug.

--
nosy: +vstinner

___
Python tracker 

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



[issue39909] Assignment expression in assert causes SyntaxError

2020-03-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm going to close this, since I can't imagine this restriction being relaxed.

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



[issue39909] Assignment expression in assert causes SyntaxError

2020-03-09 Thread Михаил Кыштымов

Михаил Кыштымов  added the comment:

ok

--

___
Python tracker 

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



[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

Antoine: "I agree with Serhiy.  If you hit a rare situation that you don't want 
to handle, use Py_FatalError(), not Py_UNREACHABLE()."

Py_UNREACHABLE() documentation still says "Use this when you have a code path 
that you do not expect to be reached." and "Use this in places where you might 
be tempted to put an assert(0) or abort() call."

https://docs.python.org/dev/c-api/intro.html#c.Py_UNREACHABLE

Can we clarify when Py_UNREACHABLE() must *not* be used?

I understand that there are two cases:

* Code path very unlikely to reach, but can be reached in some exceptional 
case. If it's reached, Python must report an error. Example: 
_PyTime_GetSystemClock().
* Code path which cannot be technically reached: compiler complains but it's a 
compiler/linter false alarm. Example: lookdict_index().

I propose to rephrase the Py_UNREACHABLE() macro documentation:

"Use this when you have a code path that cannot be reached by design. For 
example, in the default: clause in a switch statement for which all possible 
values are covered in case statements. Use this in places where you might be 
tempted to put an assert(0) or abort() call.

Don't use this macro for very unlikely code path if it can be reached under 
exceptional case. For example, under low memory condition or if a system call 
returns a value out of the expected range."

I suggest to update the doc as part of PR 16329.

--

___
Python tracker 

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



[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

The GCC documentation contains a good example:
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

"""
Another use for __builtin_unreachable is following a call a function that never 
returns but that is not declared __attribute__((noreturn)), as in this example:

void function_that_never_returns (void);

int g (int c)
{
  if (c)
{
  return 1;
}
  else
{
  function_that_never_returns ();
  __builtin_unreachable ();
}
}
"""

This example is more explicit than a function which gets an "unexpected" value: 
such case should use Py_FatalError() if I understand correctly.

By the way, Py_FatalError() should be avoided: it's always better to report the 
failure to the caller :-)

--

___
Python tracker 

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



[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

"""
Use this when you have a code path that cannot be reached by design. For 
example, in the default: clause in a switch statement for which all possible 
values are covered in case statements. Use this in places where you might be 
tempted to put an assert(0) or abort() call.

In release mode, the macro helps the compiler to optimize the code, and avoids 
a warning about unreachable code. For example, the macro is implemented with 
__builtin_unreachable() on GCC in release mode.

An use for Py_UNREACHABLE() is following a call a function that never returns 
but that is not declared _Py_NO_RETURN.

If a code path is very unlikely code but can be reached under exceptional case, 
this macro must not be used. For example, under low memory condition or if a 
system call returns a value out of the expected range. In this case, it's 
better to report the error to the caller. If the error cannot be reported to 
caller, :c:func:`Py_FatalError` can be used.
"""

--

___
Python tracker 

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



[issue14126] Speed up list comprehensions by preallocating the list where possible

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> Isn't this the same as https://bugs.python.org/issue36551 ?

Yes.

--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> So it isn't valid to skip calling the cleanup functions just because md_state 
> is NULL - we have no idea what Py_mod_create might have done that needs to be 
> cleaned up.

In your example, I don't see what m_clear/m_free would be supposed to 
clear/free.

I don't see how a module can store data without md_state which would require 
m_clear/m_free to clear/free such data. module_clear() continue to clear Python 
objects of the PyModuleObject structure with PR 18738.

Would you mind to elaborate?

The intent of PR 18738 is to simplify the implementation of C extension modules 
which implements the PEP 489 and uses a module state (md_state > 0).

--

___
Python tracker 

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



[issue39905] Cannot load sub package having a 3-dot relative import

2020-03-09 Thread Mark Dickinson


Change by Mark Dickinson :


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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2020-03-09 Thread Владимир Мартьянов

Владимир Мартьянов  added the comment:

I have Python 3.7.4 and have the same exception:
print (socket.gethostbyaddr("127.0.0.1"))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 6: invalid 
continuation byte

My OS is Win7 and my computer name contains cyrillic characters.

--
nosy: +Владимир Мартьянов

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18230
pull_request: https://github.com/python/cpython/pull/18872

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2020-03-09 Thread Steve Dower


Steve Dower  added the comment:

Looks like what was actually applied was changed to PyUnicode_DecodeFSDefault, 
which was later changed on Windows to be always UTF-8.

They'll need to be normalised throughout Modules/socketmodule.c (I can't tell 
at a quick glance which need updating). We should also figure out some kind of 
test that can catch this sort of issue.

Sorry for guiding you wrong a few years ago, Victor!

--
resolution: fixed -> 
stage:  -> test needed
status: closed -> open
versions: +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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> AttributeError: module 'subprocess' has no attribute 'check_output'

I wrote PR 18872 to implement it for setup.py.

Michael Felt: Can you please test it on AIX?

--

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2020-03-09 Thread Steve Dower


Steve Dower  added the comment:

If someone wants to do the extra work to use the native Windows socket 
functions on Windows instead of the POSIX-ey wrappers, that should happen under 
a new issue. This bug is for a regression that we ought to fix back as far as 
we can.

--
priority: normal -> high

___
Python tracker 

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



[issue23592] SIGSEGV on interpreter shutdown, with daemon threads running wild

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

I believe that this issue cannot occur in Python 3.8 thanks for bpo-36475.

According to the backtrace, a thread does crash in PyEval_EvalFrameEx(). I 
understand that it's a daemon thread. To execute PyEval_EvalFrameEx(), a daemon 
thread must hold the GIL. With bpo-36475, a daemon thread now exits immediately 
instead of taking the GIL.

--
nosy: +vstinner
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
superseder:  -> PyEval_AcquireLock() and PyEval_AcquireThread() do not handle 
runtime finalization properly.

___
Python tracker 

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



[issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly.

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-23592 as duplicate of this issue.

--

___
Python tracker 

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



[issue30519] [threading] Add daemon argument to Timer

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

Daemon threads are very fragile by design. I would prefer to not promote their 
usage. See for example bpo-39877 for a recent example. I would prefer to remove 
support for daemon threads, rather than adding more daemon threads!

I reject the issue.

Moreover, PR 1878 has been closed.

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



[issue26037] Crash when reading sys.stdin.buffer in a daemon thread

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

The problem is that Py_FinalizeEx() tries to close the sys.stdin object in 
_PyImport_Cleanup(), but closing the buffered object requires the object lock 
which is hold by _thread(). _thread() is blocked on waiting for a newline 
character.

I suggest to use non-blocking read in a loop, to be able to properly stop your 
thread at Python exit. You may want to give a try using the asyncio module.

Python works as expected. I don't see any bug here. I close the issue.

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



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> I'm reducing the severity from release blocker to high and keep the ticket in 
> pending to give Eric a change to review the commits.

Python 3.8.0 is released with the fix. It's now time to close the issue.

--
stage: commit 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



[issue39910] os.ftruncate on Windows should be sparse

2020-03-09 Thread Mingye Wang


New submission from Mingye Wang :

Consider this interaction:

cmd> echo > 1.txt
cmd> python -c "__import__('os').truncate('1.txt', 1024 ** 3)"
cmd> fsutil sparse queryFlag 1.txt

Not only takes a long time as is typical for a zero-write, but also reports 
non-sparse as an actual write would suggest. This is because internally, 
_chsize_s and friends enlarges files using a loop.[1]
  [1]: https://github.com/leelwh/clib/blob/master/c/chsize.c

On Unix systems, ftruncate for enlarging is described as "... as if the extra 
space is zero-filled", but this is not to be taken literally. In practice, 
sparse files are used whenever available (GNU dd expects that) and people do 
expect the operation to be very fast without a lot of real writes. A FreeBSD 
bug exists around how ftruncate is too slow on UFS.

The aria2 downloader gives a good example of how to truncate into a sparse file 
on Windows.[2] First a FSCTL_SET_SPARSE control is issued, and then a seek + 
SetEndOfFile would finish the job. Of course, a lseek to the end would be 
required to first determine the size of the file, so we know whether we are 
enlarging (sparse) or shrinking (don't sparse).
  [2]: https://github.com/aria2/aria2/blob/master/src/AbstractDiskWriter.cc#L507

--
components: Library (Lib)
messages: 363717
nosy: Artoria2e5, steve.dower
priority: normal
severity: normal
status: open
title: os.ftruncate on Windows should be sparse
versions: 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



[issue13077] Windows: Unclear behavior of daemon threads on main thread exit

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

I can only reproduce the behavior (other thread continues to run after CTRL+C) 
on Windows, not on Linux.

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, vstinner, zach.ware
title: Unclear behavior of daemon threads on main thread exit -> Windows: 
Unclear behavior of daemon threads on main thread exit

___
Python tracker 

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



[issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fc72ab6913f2b5337ae7fda711f2de846d38f479 by idomic in branch 
'master':
bpo-38691: importlib ignores PYTHONCASEOK if -E is used (GH-18627)
https://github.com/python/cpython/commit/fc72ab6913f2b5337ae7fda711f2de846d38f479


--

___
Python tracker 

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



[issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This optimisation was also hinted at 
https://bugs.python.org/issue26032#msg257653

--
nosy: +pitrou, serhiy.storchaka, xtreak

___
Python tracker 

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



[issue39659] pathlib calls `os.getcwd()` without using accessor

2020-03-09 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



[issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()`

2020-03-09 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



[issue39893] Add set_terminate() to logging

2020-03-09 Thread wyz23x2


Change by wyz23x2 :


--
versions: +Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18231
pull_request: https://github.com/python/cpython/pull/18873

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is not so easy. There was reason why it was not done earlier. scandir() 
wastes more limited resource than memory -- file descriptors. It should also be 
properly closed and do not depend on the garbage collector.

Consider the example:

def traverse(path, visit):
for child in path.iterdir():
if child.is_dir():
traverse(path, visit)
else:
visit(child)

With your optimization it may fail with OSError: Too many open files.

--

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> So I changed 'pthread_cond_timedwait' to 'take_gil' and this didn't seem to 
> have an effect on the unit test.

Maybe you forgot to run "make" to copy Tools/gdb/libpython.py as python-gdb.py.

Anyway, I wrote PR 18873 and I tested manually that it does fix test_gdb on 
FreeBSD. I tested "GNU gdb (GDB) 8.3.1 [GDB v8.3.1 for FreeBSD]" on FreeBSD 
12.1-RELEASE-p2.

--

___
Python tracker 

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



[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 88944a44aa84b0f3674939019b1befbc7a9dc874 by Serhiy Storchaka in 
branch 'master':
bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850)
https://github.com/python/cpython/commit/88944a44aa84b0f3674939019b1befbc7a9dc874


--

___
Python tracker 

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



[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18233
pull_request: https://github.com/python/cpython/pull/18875

___
Python tracker 

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



[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread miss-islington


miss-islington  added the comment:


New changeset 80be9c344f9fa619c24712c699b70126fc202315 by Miss Islington (bot) 
in branch '3.7':
bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850)
https://github.com/python/cpython/commit/80be9c344f9fa619c24712c699b70126fc202315


--

___
Python tracker 

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



[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread miss-islington


miss-islington  added the comment:


New changeset 97bbdb28b4ab9519780f924e3267ac70af1cd5b8 by Miss Islington (bot) 
in branch '3.8':
bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850)
https://github.com/python/cpython/commit/97bbdb28b4ab9519780f924e3267ac70af1cd5b8


--

___
Python tracker 

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



[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39822] Use NULL instead of None for empty attrib in C implementation of Element

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset dccd41e29fb9e75ac53c04ed3b097f51f8f65c4e by Serhiy Storchaka in 
branch 'master':
bpo-39822: Use NULL instead of None for empty attrib in Element. (GH-18735)
https://github.com/python/cpython/commit/dccd41e29fb9e75ac53c04ed3b097f51f8f65c4e


--

___
Python tracker 

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



[issue39822] Use NULL instead of None for empty attrib in C implementation of Element

2020-03-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39893] Add set_terminate() to logging

2020-03-09 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



[issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
title: Problems with /usr/lib64 builds. -> Add sys.platlibdir to use /usr/lib64 
on Fedora and SuSE

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

lib64_tests-2.py: Updated test for PR 18381. It now uses sys.platlibdir and it 
tests also Makefile LIBPL variable.

--
Added file: https://bugs.python.org/file48962/lib64_tests-2.py

___
Python tracker 

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



[issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


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



[issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore

2020-03-09 Thread STINNER Victor


New submission from STINNER Victor :

"AMD64 Windows7 SP1 3.x" buildbot worker fails to build Python. It should 
either be fixed, or the worker should be removed.

--
components: Build, Tests
messages: 363729
nosy: pablogsal, steve.dower, vstinner
priority: normal
severity: normal
status: open
title: "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore
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



[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6012f30beff7fa8396718dfb198ccafc333c565b by Pablo Galindo in 
branch 'master':
bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866)
https://github.com/python/cpython/commit/6012f30beff7fa8396718dfb198ccafc333c565b


--

___
Python tracker 

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



[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18234
pull_request: https://github.com/python/cpython/pull/18876

___
Python tracker 

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



[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18235
pull_request: https://github.com/python/cpython/pull/18877

___
Python tracker 

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



[issue39893] Add set_terminate() to logging

2020-03-09 Thread Vinay Sajip


Vinay Sajip  added the comment:

There's no need for a method to do this. You can do any of:

1. Set the terminator attribute to whatever you need in logging.StreamHandler 
(if all code you ever use must use a different terminator).

2. Set it in individual instances of StreamHandler.

3. Set it in a subclass of StreamHandler which you then use instead of 
StreamHandler.

Since only a few cases will want a different terminator, there's no need to add 
a special mechanism to override it, when you can just use an assignment 
statement.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
versions:  -Python 3.5, Python 3.6, 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



[issue39912] warnings.py should not raise AssertionError when validating arguments

2020-03-09 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

Currently simplefilter() and filterwarnings() don't validate their arguments 
when using -O and AssertionError is not the most appropriate exception to raise.

I will post a PR shortly.

--
components: Library (Lib)
messages: 363732
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: warnings.py should not raise AssertionError when validating arguments
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



[issue39912] warnings.py should not raise AssertionError when validating arguments

2020-03-09 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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

___
Python tracker 

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



[issue39321] AMD64 FreeBSD Non-Debug 3.x: main regrtest process killed by SIGKILL (Signal 9)

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> If it fails again in the same manner, please re-open

The issue is back. Two examples.

--

Today: https://buildbot.python.org/all/#/builders/214/builds/405

(...)
0:15:40 load avg: 3.11 [366/420] test_pickletools passed -- running: 
test_multiprocessing_forkserver (2 min 43 sec), test_multiprocessing_fork (1 
min 17 sec)
0:15:40 load avg: 3.11 [367/420] test_webbrowser passed -- running: 
test_multiprocessing_forkserver (2 min 43 sec), test_multiprocessing_fork (1 
min 18 sec)
0:15:42 load avg: 3.11 [368/420] test_codecmaps_hk passed -- running: 
test_multiprocessing_forkserver (2 min 45 sec), test_multiprocessing_fork (1 
min 19 sec)
fetching http://www.pythontest.net/unicode/BIG5HKSCS-2004.TXT ...
0:15:43 load avg: 3.11 [369/420] test_pprint passed -- running: 
test_multiprocessing_forkserver (2 min 45 sec), test_multiprocessing_fork (1 
min 20 sec)
*** Signal 9

--

1 day ago: https://buildbot.python.org/all/#/builders/214/builds/395

(...)
0:14:53 load avg: 3.29 [269/420/1] test_keywordonlyarg passed -- running: 
test_multiprocessing_forkserver (2 min 25 sec)
0:15:00 load avg: 2.94 [270/420/1] test_pprint passed -- running: 
test_multiprocessing_forkserver (2 min 31 sec)
0:15:00 load avg: 2.94 [271/420/2] test_io crashed (Exit code -9) -- running: 
test_multiprocessing_forkserver (2 min 31 sec)
0:15:05 load avg: 2.87 [272/420/2] test_positional_only_arg passed -- running: 
test_multiprocessing_forkserver (2 min 37 sec)
*** Signal 9

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Barney Gale


Barney Gale  added the comment:

Ah, right you are! The globbing helpers call `list(os.scandir(...))` - perhaps 
we should do the same here?

--

___
Python tracker 

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



[issue39913] Document warnings.WarningMessage ?

2020-03-09 Thread daniel hahler


New submission from daniel hahler :

I've noticed that `warnings.WarningMessage` is not documented, i.e. it does not 
show up in the intersphinx object list.

I'm not sure how to document it best, but maybe just describing its attributes?

Ref: 
https://github.com/blueyed/cpython/blob/598d29c51c7b5a77f71eed0f615eb0b3865a4085/Lib/warnings.py#L398-L417

--
assignee: docs@python
components: Documentation
messages: 363735
nosy: blueyed, docs@python
priority: normal
severity: normal
status: open
title: Document warnings.WarningMessage ?

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It would be slower and less reliable implementation of os.listdir().

--

___
Python tracker 

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



[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 2235e04170503673471d5ec2e7c693cdadcbdc65 by Pablo Galindo in 
branch '3.7':
[3.7] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) 
(GH-18877)
https://github.com/python/cpython/commit/2235e04170503673471d5ec2e7c693cdadcbdc65


--

___
Python tracker 

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



[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue39850] multiprocessing.connection.Listener fails to close with null byte in AF_UNIX socket name.

2020-03-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 3ede1bc794a575a73c6cc74addb5586f4e33a1f5 by Pablo Galindo in 
branch '3.8':
[3.8] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) 
(GH-18876)
https://github.com/python/cpython/commit/3ede1bc794a575a73c6cc74addb5586f4e33a1f5


--

___
Python tracker 

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



[issue39913] Document warnings.WarningMessage ?

2020-03-09 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

warnings.WarningMessage was added in https://bugs.python.org/issue26568 at the 
same time than _showwarnmsg_impl() and _formatwarnmsg_impl().

The goal was to have public functions that took them instead of multiple 
arguments so it could be easily extended in the future. It looks like it never 
happened and as of today there is no way to use warnings.WarningMessage in user 
code.

Maybe it is time to bikeshed the names and add them?

--
nosy: +remi.lapeyre, vstinner

___
Python tracker 

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



[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

I guess it's similar to the 'return' vs. 'returns' issue, but I feel much
stronger about it here.

I would have written that as "make the spam module more spammy". Just read
a bunch of commits using e.g. `git log --oneline` to see what the
prevailing style is.

--

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Barney Gale


Barney Gale  added the comment:

Less reliable how? Doesn't appear any slower:

barney.gale@heilbron:~$ python3 -m timeit -s "import os; 
os.listdir('/usr/local')"
1 loops, best of 3: 0.0108 usec per loop
barney.gale@heilbron:~$ python3 -m timeit -s "import os; 
list(os.scandir('/usr/local'))"
1 loops, best of 3: 0.00919 usec per loop

--

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This is not how timeit works, you just measured the time taken by an empty 
loop, you can look at `python3 -m timeit -h` to get help how to call it. I 
think a correct invocation would be:

(venv) ➜  ~ python3 -m timeit -s 'from os import scandir' 
"list(scandir('/usr/local'))"
1 loops, best of 5: 24.3 usec per loop
(venv) ➜  ~ python3 -m timeit -s 'from os import listdir' 
"listdir('/usr/local')"
1 loops, best of 5: 22.2 usec per loop

so it looks like scandir as a small overhead when accumulating all results and 
not using the extra info it returns.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue35775] Add a general selection function to statistics

2020-03-09 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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



[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-03-09 Thread Julin


Julin  added the comment:

Can't this be implemented? This is something that a user would expect. 
Intuitive. And it looks as if it is an easy change to make that doesn't disturb 
anything else.

--
nosy: +ju-sh

___
Python tracker 

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



[issue39914] logging.config: '.' (dot) as a key is not documented

2020-03-09 Thread Yuta Okamoto


New submission from Yuta Okamoto :

I noticed that Configurators in logging.config module accepts '.' (dot) as a 
key to fill attributes for filters, formatters, and handlers directly like the 
following:

handlers:
syslog:
class: logging.handlers.SysLogHandler
.:
ident: 'app-name: '

https://github.com/python/cpython/blob/46abfc1416ff8e450999611ef8f231ff871ab133/Lib/logging/config.py#L742

But it seems this functionality is not documented in 
https://docs.python.org/3/library/logging.config.html

--
assignee: docs@python
components: Documentation
messages: 363744
nosy: Yuta Okamoto, docs@python
priority: normal
severity: normal
status: open
title: logging.config: '.' (dot) as a key is not documented
type: enhancement
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



[issue39914] logging.config: '.' (dot) as a key is not documented

2020-03-09 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



[issue39829] __len__ called twice in the list() constructor

2020-03-09 Thread Eric Snow


Eric Snow  added the comment:

FWIW, I encouraged Kim to file this.  Thanks Kim!

While it isn't part of any specification, it is an unexpected change in 
behavior that led to some test failures.  So I figured it would be worth 
bringing up. :)  I did find it surprising that we were not caching the result, 
but don't think that's necessarily a problem.

All that said, the change did not actually break anything other than some tests 
(not the code they were testing).  So I don't have a problem with closing this.

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



[issue39829] __len__ called twice in the list() constructor

2020-03-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks Kim and Eric!

I think it still makes sense to do some quick benchmarking and research on 
passing down the calculated length. I can try to produce a draft PR so we can 
discuss with something more tangible.

--

___
Python tracker 

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



[issue39829] __len__ called twice in the list() constructor

2020-03-09 Thread Eric Snow


Eric Snow  added the comment:

I'm not opposed. :)  I just don't want to impose on your time.

--
assignee:  -> pablogsal
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue39915] AsyncMock doesn't work with asyncio.gather

2020-03-09 Thread Mads Sejersen


New submission from Mads Sejersen :

When calling asyncio.gather the await_args_list is not correct. In the attached 
minimal example it contains only the latest call and not each of the three 
actual calls.

Expected output:
[call(0), call(1), call(2)]
[call(1), call(2), call(3)]  # or any permutation hereof

Actual output:
[call(0), call(1), call(2)]
[call(3), call(3), call(3)]

--
components: asyncio
files: fail.py
messages: 363748
nosy: Mads Sejersen, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: AsyncMock doesn't work with asyncio.gather
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48963/fail.py

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread Michael Felt


Michael Felt  added the comment:

Almost. The command is run, but not enough of the bootstrap is finished - it 
seems.

  File "/data/prj/python/git/python3-3.9/Lib/_aix_support.py", line 54, in 
_aix_bosmp64
out = out.decode("utf-8").strip().split(":")  # type: ignore
AttributeError: 'str' object has no attribute 'decode'

Just skipping the subprocess bit (which is what the original does, waiting for 
better moments) is sufficient for the bootstrap phase.

--

___
Python tracker 

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



[issue39916] More reliable use of scandir in Path.glob()

2020-03-09 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Path.glob() uses os.scandir() in the following code.

entries = list(scandir(parent_path))

It properly closes the internal file descriptor opened by scandir() if success 
because it is automatically closed closed when the iterator is exhausted. But 
if it was interrupted (by KeyboardInterrupt, MemoryError or OSError), the file 
descriptor will be closed only when the iterator be collected by the garbage 
collector. It is unreliable on implementations like PyPy and emits a 
ResourceWarning.

The proposed code uses more reliable code

with scandir(parent_path) as scandir_it:
entries = list(scandir_it)

which is used in other sites (in the shutil module). I have no idea why I did 
not write it in this form at first place.

--
components: Library (Lib)
messages: 363750
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: More reliable use of scandir in Path.glob()
type: resource usage
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



[issue39916] More reliable use of scandir in Path.glob()

2020-03-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore

2020-03-09 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

Well, it only doesn't build on 3.9+ (master) due to not being supported going 
forward.  The *buildmaster* needs to be fixed to stop submitting those jobs to 
unsupported platforms.

We need to continue testing 3.7 and 3.8 on Win7 until they go EOL to ensure 
that no platform breaking changes get backported.  This same issue will come up 
again (on different builders) as Win8 becomes unsupported (3.10, I believe).

As to this builder directly, I am working on a replacement machine that will 
have the latest tooling installed which should be done before before 3.9 goes 
gold (real-life permitting, of course).

--
nosy: +jkloth

___
Python tracker 

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



[issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

Ah, "x86 Windows7 3.x" worker has the same issue: 
https://buildbot.python.org/all/#/builders/150/builds/434

--

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> Less reliable how?

See issue39916.

> so it looks like scandir as a small overhead when accumulating all results 
> and not using the extra info it returns.

Try with larger directories. The difference may be not so small.

$ python3 -m timeit -s 'from os import scandir' "list(scandir('/usr/include'))"
1 loops, best of 3: 176 usec per loop
$ python3 -m timeit -s 'from os import listdir' "listdir('/usr/include')"
1 loops, best of 3: 114 usec per loop

--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> AttributeError: 'str' object has no attribute 'decode'

Oops, it should now be fixed by my second commit. Please retry PR 18872.

--

___
Python tracker 

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



[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-03-09 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-03-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

If we introduce a PEG-based parser, we can do this without hacking the 
tokenizer. See https://github.com/gvanrossum/pegen/issues/229

I'd propose to aim for Python 3.10 (if the PEG parser happens).

--
nosy: +gvanrossum

___
Python tracker 

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



[issue39915] AsyncMock doesn't work with asyncio.gather

2020-03-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +lisroach, xtreak

___
Python tracker 

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



[issue34822] Simplify AST for slices

2020-03-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm going to review the actual code next.

Regarding the omission of parentheses in various contexts, I am all for that, 
but I consider it a separate issue (as it only pertains to ast.unparse()). The 
fix in https://github.com/python/cpython/pull/17892 should go in regardless.

--

___
Python tracker 

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



[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 413f01352a8268fb62bb47bde965462d7b82a06a by Serhiy Storchaka in 
branch 'master':
bpo-39904: Move handling of one-argument call of type() from type.__new__() to 
type.__call__(). (GH-18852)
https://github.com/python/cpython/commit/413f01352a8268fb62bb47bde965462d7b82a06a


--

___
Python tracker 

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



[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e5ccc94bbb153431698b2391df625e8d47a93276 by Serhiy Storchaka in 
branch 'master':
bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called 
with invalid base. (GH-18863)
https://github.com/python/cpython/commit/e5ccc94bbb153431698b2391df625e8d47a93276


--

___
Python tracker 

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



[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6d0ee60740f2862a878f009671b1aaa75aeb0c2a by Victor Stinner in 
branch 'master':
bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)
https://github.com/python/cpython/commit/6d0ee60740f2862a878f009671b1aaa75aeb0c2a


--

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18239
pull_request: https://github.com/python/cpython/pull/18882

___
Python tracker 

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



[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset eebaa9bfc593d5a46b293c1abd929fbfbfd28199 by Serhiy Storchaka in 
branch 'master':
bpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release 
mode. (GH-16329)
https://github.com/python/cpython/commit/eebaa9bfc593d5a46b293c1abd929fbfbfd28199


--

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington


miss-islington  added the comment:


New changeset 5854d451cb35ac38bc07b95afeb077e8a35d5c7d by Miss Islington (bot) 
in branch '3.8':
bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)
https://github.com/python/cpython/commit/5854d451cb35ac38bc07b95afeb077e8a35d5c7d


--

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington


miss-islington  added the comment:


New changeset 1695836123609a8ae97f2cfbe180a028dcd650a3 by Miss Islington (bot) 
in branch '3.7':
bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)
https://github.com/python/cpython/commit/1695836123609a8ae97f2cfbe180a028dcd650a3


--

___
Python tracker 

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



[issue36184] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
keywords:  -easy
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on 
FreeBSD -> test_gdb.test_threads() is specific to _POSIX_THREADS, fail on 
FreeBSD

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Barney Gale


Change by Barney Gale :


--
resolution:  -> not a bug
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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Barney Gale

Barney Gale  added the comment:

Thanks Rémi and Serhiy! Closing this ticket as the patch doesn't provide any 
sort of improvement.

--

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18240
pull_request: https://github.com/python/cpython/pull/18883

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3225b9f9739cd4bcca372d0fa939cea1ae5c6402 by Victor Stinner in 
branch 'master':
bpo-39877: Remove useless PyEval_InitThreads() calls (GH-18883)
https://github.com/python/cpython/commit/3225b9f9739cd4bcca372d0fa939cea1ae5c6402


--

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18241
pull_request: https://github.com/python/cpython/pull/18884

___
Python tracker 

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



  1   2   >