[issue38436] Improved performance for list addition.

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

How often do you need to add three or more lists in comparison with other uses 
of the "+" operator?

How larger is the benefit of this optimization?

How much it slows down other uses of the "+" operator?

Would be nice if you provide some numbers.

More efficient way of concatenating several lists in single expression is:

[*a, *b, *c, *d, ...]

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38441] failing to build the Documentation

2019-10-11 Thread Aurora


New submission from Aurora :

I'm failing to build the cpython/Doc dir.

The full build log is as follows:

mkdir -p build
Building NEWS from Misc/NEWS.d with blurb
PATH=./venv/bin:$PATH sphinx-build -b epub -d build/doctrees -D 
latex_elements.papersize=  -W . build/epub 
Running Sphinx v2.2.0
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [epub]: targets for 476 source files that are out of date
updating environment: [new config] 476 added, 0 changed, 0 removed
reading sources... [100%] whatsnew/index

 

Warning, treated as error:
/home/aurora/A.Code/Python/Reference/python/cpython/Doc/library/email.message.rst:4:duplicate
 object description of email.message, other instance in 
library/email.compat32-message, use :noindex: for one of them
make: *** [Makefile:46: build] Error 2


Running on Debian Experimental kernel v5.3

--
assignee: docs@python
components: Documentation
messages: 354425
nosy: aurora, docs@python
priority: normal
severity: normal
status: open
title: failing to build the Documentation
type: compile error
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



[issue38440] Possible new issues with IDLE

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

(Just FYI: the version of Tcl/Tk, 8.6.8, we are shipping with the python.org 
installers for macOS is unchanged since 3.7.2 a year ago, 2.7.16 (in March), 
and has not changed during the 3.8.0 pre-release cycle.  We did try to update 
to 8.6.9 for 3.7.2rc1 but there were too many new regressions so we reverted to 
8.6.8 and have stuck with it awaiting a release of 8.7.10.)

--
title: Possible news issues with IDLE -> Possible new issues with IDLE

___
Python tracker 

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



[issue38441] failing to build the Documentation

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report.  That problem was fixed on the master branch by 
141da44bb45bc182886303fce92cbbae5631cb4c on 2019-06-03.  Suggest you build from 
a more recent source release or updated git repo.

--
nosy: +ned.deily
resolution:  -> out of date
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



[issue38442] Doc/whatsnew/3.8.rst has an execution bit

2019-10-11 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

It likely happened when it was edited on Windows.

--
assignee: docs@python
components: Documentation
messages: 354428
nosy: docs@python, lukasz.langa, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Doc/whatsnew/3.8.rst has an execution bit
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



[issue38442] Doc/whatsnew/3.8.rst has an execution bit

2019-10-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue38443] unavailable --with-universal-archs= macOS confgure options fail cryptically

2019-10-11 Thread Ned Deily


New submission from Ned Deily :

./configure's --with-universal-archs= supports a number of different CPU 
architecture combinations.  However most of them are no longer supported on 
current macOS systems.  If you choose an option with archs not available in the 
build tool chain in use, the configure script fails in various cryptic ways, 
usually with multiple configure test failures like:

checking dlfcn.h presence... yes
configure: WARNING: dlfcn.h: present but cannot be compiled
configure: WARNING: dlfcn.h: check for missing prerequisite headers?
configure: WARNING: dlfcn.h: see the Autoconf documentation
configure: WARNING: dlfcn.h: section "Present But Cannot Be Compiled"
configure: WARNING: dlfcn.h: proceeding with the compiler's result
configure: WARNING: ## --- ##
configure: WARNING: ## Report this to https://bugs.python.org/ ##
configure: WARNING: ## --- ##

./configure should be more user-friendly here.  At a minimum, it should report 
near the beginning exactly which archs are going to be tested; it already 
reports the --with-universal-archs value.  Even better it should explicitly 
test for support of each arch in the build tool chain in use and stop if any of 
the requested archs are not available.

--
components: Build, macOS
messages: 354429
nosy: ned.deily, ronaldoussoren
priority: normal
severity: normal
stage: needs patch
status: open
title: unavailable --with-universal-archs= macOS confgure options fail 
cryptically
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



[issue38443] unavailable --with-universal-archs= macOS confgure options fail cryptically

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

Also note that, on current macOS systems, specifying just --enable-universalsdk 
to ./configure results in an implicit --with-universal-archs of intel (which 
implies both x86_64 and i386).

checking for --enable-universalsdk... /
checking for --with-universal-archs... intel

With macOS 10.15 Catalina and Xcode 11, i364 arch is no longer supported and 
that results in another cryptic ./configure failure:

checking size of size_t... configure: error: in `/Users/sysadmin/cpython':
configure: error: cannot compute sizeof (size_t)
See `config.log' for more details

--

___
Python tracker 

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



[issue38014] ./configure on recent macOS versions can fail with multiple "present but cannot be compiled" messages

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

Going and back and looking closer at the original failure, I see now that the 
root cause of the configure failures *is* using --with-universal-archs=64-bit.  
As noted in the Mac/README file, "64-bit" means compile for both "ppc64" and 
"x86_64" architectures; the configure tests fail because the Apple-supplied 
build tools (via Xcode or the Command Line Tools) have not supported either ppc 
or ppc64 for many years (since 10.7, I believe).  In more recent releases prior 
to macOS 10.15 Catalina, macOS still supported running programs in either 
intel-32 (i386) or intel-64 (x86_64) so there was still some use for 
--with-universal-archs=intel, which compiles for both x64_64 and i386.  But 
10.15 Catalina no longer includes 32-bit libraries and frameworks, so it is not 
possible to run 32-bit executables natively anymore.  Thus the only 
architecture option that is of use on 10.15 is the default, x86_64.  So my 
original suggestion, to remove the --enable-universalsdk and 
--with-universal-arch op
 tions from your ./configure command should solve the problems you are seeing.  
I also verified that --enable-optimizations without --wiht-universal-arch and 
--enable-universalsdk resulted in a successful build (after following the 
Devguide's recommendations to install missing libraries using Homebrew).

That said, ./configure should be less cryptic about these kinds of problems.  
I've opened Issue38443 to suggest that ./configure be enhanced to give better 
error messages when a CPU arch is not available to build.

I was unable to reproduce the different failure reported by Bill Minasian in 
msg351312.  If that problem can be reproduced with the stable release of 10.15 
and Xcode 11, please open a new issue for it with details on how to reproduce.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: Python 3.7 does not compile -> ./configure on recent macOS versions can 
fail with multiple "present but cannot be compiled" messages

___
Python tracker 

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



[issue38014] ./configure on recent macOS versions can fail with multiple "present but cannot be compiled" messages

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

Going back and looking closer at the original failure, I see now that the root 
cause of the configure failures *is* using --with-universal-archs=64-bit.  As 
noted in the Mac/README file, "64-bit" means compile for both "ppc64" and 
"x86_64" architectures; the configure tests fail because the Apple-supplied 
build tools (via Xcode or the Command Line Tools) have not supported either ppc 
or ppc64 for many years (since 10.7, I believe).  In more recent releases prior 
to macOS 10.15 Catalina, macOS still supported running programs in either 
intel-32 (i386) or intel-64 (x86_64) so there was still some use for 
--with-universal-archs=intel, which compiles for both x64_64 and i386.  But 
10.15 Catalina no longer includes 32-bit libraries and frameworks, so it is not 
possible to run 32-bit executables natively anymore.  Thus the only 
architecture option that is of use on 10.15 is the default, x86_64.  So my 
original suggestion, to remove the --enable-universalsdk and 
--with-universal-arch option
 s from your ./configure command should solve the problems you are seeing.  I 
also verified that --enable-optimizations without --wiht-universal-arch and 
--enable-universalsdk resulted in a successful build (after following the 
Devguide's recommendations to install missing libraries using Homebrew).

That said, ./configure should be less cryptic about these kinds of problems.  
I've opened Issue38443 to suggest that ./configure be enhanced to give better 
error messages when a CPU arch is not available to build.

I was unable to reproduce the different failure reported by Bill Minasian in 
msg351312.  If that problem can be reproduced with the stable release of 10.15 
and Xcode 11, please open a new issue for it with details on how to reproduce.

--

___
Python tracker 

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



[issue38014] ./configure on recent macOS versions can fail with multiple "present but cannot be compiled" messages

2019-10-11 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue38440] Possible new issues with IDLE

2019-10-11 Thread Ned Deily

Ned Deily  added the comment:

(“8.7.10” should be “8.6.10”)

--

___
Python tracker 

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



[issue38442] Doc/whatsnew/3.8.rst has an execution bit

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset cbb548130caf24275fa16100bccc537570cb46df by Serhiy Storchaka in 
branch 'master':
bpo-38442: Remove an execution bit from Doc/whatsnew/3.8.rst. (GH-16715)
https://github.com/python/cpython/commit/cbb548130caf24275fa16100bccc537570cb46df


--

___
Python tracker 

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



[issue38442] Doc/whatsnew/3.8.rst has an execution bit

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Strange, it was only in master.

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



[issue12271] panel.h is not found even if it's installed on various flavours of SUSE

2019-10-11 Thread Fabrice BAUZAC


Fabrice BAUZAC  added the comment:

I have been hit by the same issue today.
Kenneth's patch seems fine.  Why not integrate it?

--
nosy: +fbauzac

___
Python tracker 

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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Shmuel H.


New submission from Shmuel H. :

Currently, `dataclasses.dataclass` will generate `__init__` only where the user 
has not defined one. 

However, sometimes, with frozen classes or dataclasses with a lot of members, 
redefinition of this function is not trivial,
especially if the only purpose is to change the default behaviour for only one 
member:
```python
from dataclasses import dataclass

@dataclass(frozen=True)
class Dataclass:
#...big list of members
member20: int

def __init__(self, member20: str, **kwargs):
# self.member20 = int(member20)
object.__setattr__(self, "member20", int(member20))
# Now we have to trivially initialize 
# 20 other members like that :[
```
My idea is to generate the default `__init__` into `__default_init__` even, if 
the user has defined their own version.
That will allow them to use it like that:
 ```python
from dataclasses import dataclass

@dataclass(frozen=True)
class Dataclass:
#...big list of members
member20: int

def __init__(self, member20: str, **kwargs):
# Oh, that's better :)
self.__default_init__(member20=int(member20), **kwargs)
```

Implementing that is pretty trivial (I can do that if this change will be 
approved). 
Please let me know what you think about that.

--
components: Library (Lib)
messages: 354437
nosy: Shmuel H.
priority: normal
severity: normal
status: open
title: dataclass: always generate default __init__ on __default_init__
type: enhancement
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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith
nosy: +eric.smith

___
Python tracker 

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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

This would be a 3.9 feature only, so changing the versions.

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



[issue38435] Start the deprecation cycle for subprocess preexec_fn

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

> We cannot provide a general do everything replacement and should not try. It 
> not possible.

Well, I proposed a solution at:
https://bugs.python.org/issue38417#msg354242

I know that this solution has multiple flaws, but a bad solution may be better 
than no solution: breaking applications when upgrading to Python 3.11.

--

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread Nika


New submission from Nika :

os.path.exists() accepts either True or False as argument and returns True.
Reproducible on Windows, e. g.,  in jupyter notebook or in Eclipse, although 
not in IDLE, which returns False, as expected.

import os
print(os.path.exists(False))

--
messages: 354440
nosy: Nika
priority: normal
severity: normal
status: open
title: os.path.exists() takes bool as argument and returns True
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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Doesn't __post_init__ address this use case?

--

___
Python tracker 

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



[issue38446] Ambiguous signature for builtins.__build_class__

2019-10-11 Thread Dan Snider


New submission from Dan Snider :

The function has the following signature documented:

__build_class__(func, name, *bases, metaclass=None, **kwds) 

This implies that `func` and `name` are not positional only parameters when in 
fact, they are. Another problem with that signature is that None is not a valid 
value for the metaclass parameter.

--
messages: 354442
nosy: bup
priority: normal
severity: normal
status: open
title: Ambiguous signature for builtins.__build_class__

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread Mariano Anaya


Mariano Anaya  added the comment:

Hi, I would like to take a look at this issue. Could someone please assign it 
to me? Thanks

--
nosy: +Mariano Anaya

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread Eryk Sun


Eryk Sun  added the comment:

Note that the underlying stat call supports file descriptors, which are 
non-negative integers. This is a supported and tested capability for 
genericpath.exists (see GenericTest.test_exists_fd in 
Lib/test/test_genericpath.py).

False and True are integers with the values 0 and 1: 

>>> issubclass(bool, int)
True
>>> False + 0
0
>>> True + 0
1

That can be useful, but there may be cases where we don't want to conflate 
bools and integers. IMO, a bool should not be supported as a file descriptor. 
It's likely a bug that should be caught early instead of meaninglessly 
propagated. 

A high-level solution would check for bool instances in genericpath.exists. A 
low-level solution, to make this policy consistent in general, would be to 
modify _fd_converter in Modules/posixmodule.c to disallow bool instances.

--
nosy: +eryksun

___
Python tracker 

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



[issue32561] Add API to io objects for cache-only reads/writes

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Here a proof-of-concept of an asynchronous io module reusing the existing 
blocking io module: it implements AsyncBufferedReader.readline() using existing 
_pyio.BufferedReader.readline().

The approach seems to work, but only if bpo-13322 is fixed first: 
BufferedReader, TextIOWrapper & friends must return None if the underlying 
object ("raw" and "buffer" objects) return None.

--

My PoC uses 3 classes:

* AsyncFileIO: similar to io.FileIO but uses "async def"
* AsyncBufferedReader: similar to io.BufferedReader but uses "async def"
* FileIOSandwich: glue between asynchronous AsyncFileIO and blocking 
io.BufferedReader

At the first read, FileIOSandwich.read(n) call returns None, but it stores the 
request read size (n).

If AsyncBufferedReader gets None, is calls FileIOSandwich._prepare_read() 
*asynchronously*/

Then FileIOSandwich.read(n) is called again, and this time it no longer blocks, 
since data has been already read.

--

Since bpo-13322 is not fixed, my PoC uses _pyio since it's easier to fix. It 
needs the following fix for _pyio.BufferedReader.readline():

diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index c1bdac7913..e90742ec43 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -557,6 +557,8 @@ class IOBase(metaclass=abc.ABCMeta):
 res = bytearray()
 while size < 0 or len(res) < size:
 b = self.read(nreadahead())
+if b is None and not res:
+return None
 if not b:
 break
 res += b


---

Example:

$ ./python poc_aio.py poc_aio.py 
data: b'import asyncio\n'

Internally, _prepare_read() reads 8 KiB.

--
Added file: https://bugs.python.org/file48656/poc_aio.py

___
Python tracker 

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



[issue32561] Add API to io objects for cache-only reads/writes

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to leave not attempt to put "async or "await" in the io module to 
keep it a "simple" as possible, but fix bpo-13322 (in io and _pyio modules).

Instead, I suggest to write a new module only providing asynchronous methods, 
maybe even for open() and close(). But the new module can reuse the existing io 
module to avoid having to write complex algorithm like read-ahead, buffering, 
etc.

Well, I'm not 100% sure that it's doable, since io is hiding many 
implementation details, there are complex issues like multithreading, locks, 
interlaced read and write operations, etc.

Note: The io module doesn't fully suppored interlaced read and write :-) See 
bpo-12215 for example.

--

___
Python tracker 

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



[issue38447] test_multiprocessing_spawn: Dangling processes: {} on AMD64 RHEL7 Refleaks 3.7

2019-10-11 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 RHEL7 Refleaks 3.7:
https://buildbot.python.org/all/#/builders/311/builds/22

0:15:09 load avg: 12.21 [311/416/1] test_multiprocessing_spawn failed (env 
changed) (14 min 39 sec) -- running: test_shelve (5 min 11 sec), test_sqlite (1 
min), test_cmd_line_script (1 min 26 sec), test_asyncio (3 min 13 sec), test_io 
(8 min 6 sec), test_pickle (53.8 sec), test_concurrent_futures (12 min 52 sec)
beginning 6 repetitions
123456
Warning -- Dangling processes: {}
Warning -- Dangling processes: {}
.Warning -- Dangling processes: {}
.

--
components: Tests
messages: 354447
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn: Dangling processes: 
{} on AMD64 RHEL7 Refleaks 3.7
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



[issue38448] test_concurrent_futures: reap_children() reaped child process 26487 on AMD64 RHEL8 Refleaks 3.x

2019-10-11 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 RHEL8 Refleaks 3.x:
https://buildbot.python.org/all/#/builders/272/builds/23

0:27:13 load avg: 4.88 [416/419/1] test_concurrent_futures failed (env changed) 
(17 min 11 sec) -- running: test_capi (7 min 28 sec), test_gdb (8 min 49 sec), 
test_asyncio (23 min 23 sec)
beginning 6 repetitions
123456
.Warning -- reap_children() reaped child process 26487
.
Warning -- multiprocessing.process._dangling was modified by 
test_concurrent_futures
  Before: set()
  After:  {}

--
components: Tests
messages: 354448
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_concurrent_futures: reap_children() reaped child process 26487 on 
AMD64 RHEL8 Refleaks 3.x
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



[issue37980] regression when passing numpy bools to sorted(..., reverse=r)

2019-10-11 Thread Thomas Caswell


Thomas Caswell  added the comment:

Any update on resolving this?

--

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-11 Thread Brandt Bucher

Brandt Bucher  added the comment:

I’m happy to write one. This seems like a pretty straightforward fix.

--

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2b7dc40b2af6578181808ba73c1533fc114e55df by Victor Stinner 
(Ruediger Pluem) in branch 'master':
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)
https://github.com/python/cpython/commit/2b7dc40b2af6578181808ba73c1533fc114e55df


--

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16295
pull_request: https://github.com/python/cpython/pull/16718

___
Python tracker 

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



[issue37415] Error build Python with Intel compiler: doesn't provide atomic_uintptr_t

2019-10-11 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue37415] Error build Python with Intel compiler: doesn't provide atomic_uintptr_t

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 16717 which uses a similar approach than python.patch.

--
components: +Build
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



[issue37415] Error build Python with Intel compiler: doesn't provide atomic_uintptr_t

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Can someone please test PR 16717 with ICC?

--

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16296
pull_request: https://github.com/python/cpython/pull/16719

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread miss-islington


miss-islington  added the comment:


New changeset 73665b41470532f873315d5ae39906160192320d by Miss Islington (bot) 
in branch '3.8':
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)
https://github.com/python/cpython/commit/73665b41470532f873315d5ae39906160192320d


--
nosy: +miss-islington

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Yaroslav Halchenko


New submission from Yaroslav Halchenko :

Our tests in DataLad started to fail while building on Debian with Python 
3.7.5rc1 whenever they passed just fine previously with 3.7.3rc1. Analysis 
boiled down to mimetypes

$> ./python3.9 -c 'import mimetypes; mimedb = 
mimetypes.MimeTypes(strict=False); print(mimedb.guess_type(";1.tar.gz"))'   

(None, None)

$> ./python3.9 -c 'import mimetypes; mimedb = 
mimetypes.MimeTypes(strict=False); print(mimedb.guess_type("1.tar.gz"))' 
('application/x-tar', 'gzip')

$> git describe
v3.8.0b1-1174-g2b7dc40b2af


Ref: 

- original issue in DataLad: https://github.com/datalad/datalad/issues/3769

--
components: Library (Lib)
messages: 354455
nosy: Yaroslav.Halchenko
priority: normal
severity: normal
status: open
title: regression - mimetypes guess_type is confused by ; in the filename
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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Yaroslav Halchenko


Yaroslav Halchenko  added the comment:

FWIW, our more complete test filename is 

# python3 -c 'import patoolib.util as ut; print(ut.guess_mime(r" \"\`;b&b&c 
|.tar.gz"))'
(None, None)

which works fine with older versions

--

___
Python tracker 

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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Shmuel H.


Shmuel H.  added the comment:

I think it was designed to. However, it is not very usable in production for a 
number of reasons:
1. It won't work with frozen instances (you'll have to call 
`object.__setattr__` directly).
2. It gets very messy with more than one or two `InitVar`s which makes it very 
hard to differentiate between "real"
 values, `InitVar`s and the init logic:
```python
from dataclasses import dataclass, InitVar
@dataclass
class DataClass:
member0_init: InitVar[str] = None
member1_init: InitVar[list] = None

member0: int = None
member1: dict = None

def __post_init__(self, member0_init: str, member1_init: list):
if member0_init is not None and self.member0 is None:
self.member0 = int(member0_init)
if member1_init is not None and self.member1 is None:
self.member1 = dict(member1_init)
```
That code should be equivalent to:
```python
from dataclasses import dataclass
from typing import Union
@dataclass
class DataClass:
member0: int
member1: dict

def __init__(self, member0: Union[int, str], member1: Union[dict, list]):
if isinstance(member0, str):
member0 = int(member0)
if isinstance(member1, list):
member1 = dict(member1)

self.__default_init__(member0=member0, member1=member1)
```
Which is much closer to regular python code to someone new for dataclasses.

I would be happy to hear if you have a better solution; I just think it is 
pretty simple and straight-forward.

--

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Bob, as OP you get first dibs on a PR.
Brandt, you're next in line :-)

--

___
Python tracker 

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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'll try and think of something better.

I know I'm guilty of sending to python-ideas all the time, but discussing 
proposed design decisions like this are what that list is all about.

If you want to bring it up there, I'd focus on making the problem description 
crystal clear, and not so much on any proposed solution. At least for starters.

And, someone will ask what attrs or other projects do to solve this problem, so 
you should research that.

--

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

2019-10-11 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



[issue1294959] Problems with /usr/lib64 builds.

2019-10-11 Thread Matej Cepl


Change by Matej Cepl :


--
nosy: +mcepl

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

2019-10-11 Thread Matej Cepl


Change by Matej Cepl :


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



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

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Copy of wmanley's comment:
https://github.com/python/cpython/pull/13948#issuecomment-541076882
"""
This caused a regression for people overriding Thread.join to implement custom 
thread interruption. See 
https://stackoverflow.com/questions/50486083/ending-non-daemon-threads-when-shutting-down-an-interactive-python-session
"""

--

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ed189ce49423f15ba8774ff174c15d03d12bc807 by Victor Stinner in 
branch '3.7':
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536) 
(GH-16719)
https://github.com/python/cpython/commit/ed189ce49423f15ba8774ff174c15d03d12bc807


--

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Ruediger Pluem: I merged your change into master and backported to 3.8 
and 3.7. For the 3.7 backport, I skipped tests.

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



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

2019-10-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Hummmis this really a regression? The docs say:

> No other methods (except for the constructor) should be overridden in a 
> subclass. In other words, only override the __init__() and run() methods of 
> this class.

So if someone is overriding join() they are out of contract

--
nosy: +pablogsal

___
Python tracker 

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



[issue38450] 3.8 Release Notes: IDLE section dupe

2019-10-11 Thread Sebastian Rittau


New submission from Sebastian Rittau :

In the 3.8 release notes (https://docs.python.org/3.8/whatsnew/3.8.html), the 
section "IDLE and idlelib" is duplicated as "idlelib and IDLE". Also, the 
section "gc" and "gzip" between them are not sorted alphabetically like the 
rest of the list.

--
assignee: docs@python
components: Documentation
messages: 354464
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: 3.8 Release Notes: IDLE section dupe
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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Kyle Meyer


Kyle Meyer  added the comment:

I've performed a bisect the issue with the following script:

#!/bin/sh
make -j3 || exit 125
./python <<\EOF || exit 1
import sys
import mimetypes
res = mimetypes.MimeTypes(strict=False).guess_type(";1.tar.gz")
if res[0] is None:
sys.exit(1)
EOF

That points to 87bd2071c7 (bpo-22347: Update mimetypes.guess_type to allow 
proper parsing of URLs (GH-15522), 2019-09-05).  That commit was included in 
3.7.5rc1 when it was cherry picked by 8873bff287.

--
nosy: +kyleam

___
Python tracker 

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



[issue34632] Port importlib_metadata to Python 3.8

2019-10-11 Thread Arne Recknagel


Arne Recknagel  added the comment:

Is there a reason the object returned by importlib.metadata.metadata is an 
EmailMessage and not a dict? If it quacks like a duck it should be a duck, no?

--
nosy: +arne

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-11 Thread Nick Timkovich


Nick Timkovich  added the comment:

The `[arg [arg ...]]` feels a bit more formal to me, and I might prefer it in 
the example shown where the arg name is fairly short. That said, `man mv` shows 
something like:

mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...

--
nosy: +nicktimko

___
Python tracker 

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



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2019-10-11 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

> Should I update the Status and Resolution of the issue here, or wait for some 
> kind of confirmation?

The status is changed after the patch is merged. The person that merges will 
usually change the status of the issue or If he/she forgets, anyone with 
developer role can update the status too.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue34632] Port importlib_metadata to Python 3.8

2019-10-11 Thread Arne Recknagel


Arne Recknagel  added the comment:

I just learned that metadata is stored as an email, and changing the format was 
rejected in PEP 426. Be that as it may, if it isn't too much of an issue it 
might still be something that should be hidden from users of the module. Noone 
wants to know that this particular duck is actually powered by fins under the 
surface, right?

--

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

Marking as regression release blocker for 3.7.5 final and 3.8.0 final.

--
keywords: +3.7regression
nosy: +lukasz.langa, martin.panter, ned.deily, vstinner
priority: normal -> release blocker

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

This change introduces a potential 3.7 regression; see Issue38449.

--
nosy: +ned.deily

___
Python tracker 

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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Shmuel H.


Shmuel H.  added the comment:

The only other solution I could think about was to change setattr's behaviour 
dynamically so that it would be valid to call it from frozen instance's 
`__init__`, but I think it is somehow even worst.

However, thanks for your help, I think we can close this one for now and I'll 
hopefully write that mail in the next day or two.

As for other projects, I doubt I'll find any big projects that use frozen 
dataclasses internally, but I'll try my best to come with one.

(Only now I realize that your the one behind python's dataclasses, keep up the 
good work!).

--

___
Python tracker 

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



[issue35826] Typo in example for async with statement with condition

2019-10-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16297
pull_request: https://github.com/python/cpython/pull/16720

___
Python tracker 

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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks. I'm always looking for ways to make dataclasses easier to use, while 
keeping within the original goals. I'll close this for now.

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I have repeated the benchmark in the speed.python.org server with CPU isolation 
+ PGO + LTO:

Slower (21):
- xml_etree_iterparse: 127 ms +- 2 ms -> 131 ms +- 2 ms: 1.03x slower (+3%)
- xml_etree_parse: 195 ms +- 1 ms -> 200 ms +- 2 ms: 1.03x slower (+3%)
- pickle_list: 5.62 us +- 0.05 us -> 5.76 us +- 0.06 us: 1.03x slower (+3%)
- pickle: 13.2 us +- 0.1 us -> 13.5 us +- 0.1 us: 1.02x slower (+2%)
- scimark_lu: 185 ms +- 3 ms -> 188 ms +- 5 ms: 1.02x slower (+2%)
- scimark_fft: 427 ms +- 2 ms -> 434 ms +- 2 ms: 1.02x slower (+2%)
- sympy_integrate: 25.0 ms +- 0.2 ms -> 25.3 ms +- 0.2 ms: 1.01x slower (+1%)
- spectral_norm: 166 ms +- 3 ms -> 169 ms +- 1 ms: 1.01x slower (+1%)
- scimark_sor: 246 ms +- 6 ms -> 249 ms +- 4 ms: 1.01x slower (+1%)
- sympy_sum: 203 ms +- 2 ms -> 205 ms +- 2 ms: 1.01x slower (+1%)
- chaos: 138 ms +- 1 ms -> 139 ms +- 1 ms: 1.01x slower (+1%)
- json_loads: 37.2 us +- 1.0 us -> 37.5 us +- 0.3 us: 1.01x slower (+1%)
- xml_etree_process: 91.0 ms +- 1.1 ms -> 91.7 ms +- 1.8 ms: 1.01x slower (+1%)
- sympy_str: 315 ms +- 2 ms -> 317 ms +- 2 ms: 1.01x slower (+1%)
- sqlalchemy_declarative: 210 ms +- 3 ms -> 211 ms +- 3 ms: 1.01x slower (+1%)
- regex_compile: 214 ms +- 1 ms -> 215 ms +- 1 ms: 1.01x slower (+1%)
- regex_dna: 268 ms +- 1 ms -> 270 ms +- 1 ms: 1.01x slower (+1%)
- logging_format: 11.2 us +- 0.1 us -> 11.3 us +- 0.2 us: 1.01x slower (+1%)
- unpickle_pure_python: 392 us +- 4 us -> 394 us +- 4 us: 1.00x slower (+0%)
- sympy_expand: 492 ms +- 2 ms -> 493 ms +- 3 ms: 1.00x slower (+0%)
- pidigits: 236 ms +- 1 ms -> 236 ms +- 1 ms: 1.00x slower (+0%)

Faster (21):
- unpack_sequence: 73.9 ns +- 1.3 ns -> 69.3 ns +- 1.0 ns: 1.07x faster (-6%)
- 2to3: 405 ms +- 2 ms -> 393 ms +- 2 ms: 1.03x faster (-3%)
- float: 146 ms +- 1 ms -> 142 ms +- 2 ms: 1.03x faster (-3%)
- scimark_sparse_mat_mult: 5.46 ms +- 0.02 ms -> 5.34 ms +- 0.06 ms: 1.02x 
faster (-2%)
- unpickle: 17.1 us +- 0.1 us -> 16.7 us +- 0.2 us: 1.02x faster (-2%)
- regex_effbot: 3.89 ms +- 0.11 ms -> 3.82 ms +- 0.03 ms: 1.02x faster (-2%)
- json_dumps: 15.9 ms +- 0.1 ms -> 15.7 ms +- 0.1 ms: 1.01x faster (-1%)
- python_startup: 12.4 ms +- 0.1 ms -> 12.3 ms +- 0.0 ms: 1.01x faster (-1%)
- go: 320 ms +- 4 ms -> 316 ms +- 3 ms: 1.01x faster (-1%)
- pathlib: 25.4 ms +- 0.4 ms -> 25.1 ms +- 0.3 ms: 1.01x faster (-1%)
- mako: 19.6 ms +- 0.2 ms -> 19.4 ms +- 0.1 ms: 1.01x faster (-1%)
- fannkuch: 598 ms +- 7 ms -> 591 ms +- 4 ms: 1.01x faster (-1%)
- hexiom: 12.2 ms +- 0.2 ms -> 12.1 ms +- 0.1 ms: 1.01x faster (-1%)
- richards: 85.9 ms +- 1.3 ms -> 85.0 ms +- 1.3 ms: 1.01x faster (-1%)
- python_startup_no_site: 9.18 ms +- 0.05 ms -> 9.09 ms +- 0.02 ms: 1.01x 
faster (-1%)
- genshi_xml: 74.8 ms +- 0.6 ms -> 74.2 ms +- 0.9 ms: 1.01x faster (-1%)
- nbody: 157 ms +- 2 ms -> 155 ms +- 2 ms: 1.01x faster (-1%)
- unpickle_list: 5.89 us +- 0.03 us -> 5.85 us +- 0.04 us: 1.01x faster (-1%)
- genshi_text: 36.7 ms +- 0.4 ms -> 36.5 ms +- 0.3 ms: 1.01x faster (-1%)
- dulwich_log: 80.5 ms +- 0.5 ms -> 80.0 ms +- 0.5 ms: 1.01x faster (-1%)
- regex_v8: 28.9 ms +- 0.1 ms -> 28.9 ms +- 0.1 ms: 1.00x faster (-0%)

Benchmark hidden because not significant (15): chameleon, crypto_pyaes, 
deltablue, logging_silent, logging_simple, meteor_contest, nqueens, 
pickle_dict, pickle_pure_python, raytrace, scimark_monte_carlo, 
sqlalchemy_imperative, sqlite_synth, telco, xml_etree_generate
Ignored benchmarks (3) of json/2019-09-16_14-25-master-89b8933bb537.json.gz: 
django_template, html5lib, tornado_http

--

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

For backward compatibility with 2 metavars, the two-name form should still be 
possible. Just pass metavar=("FOO", "FOO").

--

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't think it's any more precise. It just seems verbose and confusing to me, 
while conveying the same information.

`[arg [arg ...]]` to me means "optionally, an arg followed by one or more 
optional args".

While `[arg ...]` to  me means "optionally, one or more args".

So, I'd vote for the simpler version, especially since we're presumably trying 
to communicate with people who aren't BNF or regex experts!

--

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +vstinner

___
Python tracker 

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



[issue38451] Datetime definition does not work in function definition as list definition

2019-10-11 Thread Pouria


Change by Pouria :


--
components: Library (Lib)
nosy: Pouria_ff
priority: normal
severity: normal
status: open
title: Datetime definition does not work in function definition as list 
definition
type: behavior
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



[issue38432] ZeroDivisionError when inf is expected

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See https://en.wikipedia.org/wiki/Denormal_number.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38451] Datetime definition does not work in function definition as list definition

2019-10-11 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Can you please add an example of the issue and the actual/expected behavior?

--
nosy: +xtreak

___
Python tracker 

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

Thanks, Pablo, for providing that. So the changes look like mostly a wash on 
these benchmarks. 

Serhiy:

I do not see any significant change in + operator timing on my machine (again, 
just a rough test):

$ ./python.exe -m timeit -s z=0 z+0  # master
1000 loops, best of 5: 21.3 nsec per loop

$ ./python.exe -m timeit -s z=0 z+0  # list-add
1000 loops, best of 5: 21.2 nsec per loop

I'm aware that unpacking is "better". With that said, adding a list literal (or 
a slice of any list, or a list comprehension) to another list is a fairly 
common operation (I count several dozen examples in the stdlib). Even though 
these cases only have two operands, they will still see the speed-up.

And the speed-up is good, even in these cases. You can compare using the new 
code:

$ ./python.exe -m timeit -s l=[0,1,2,3] [0,1,2,3]+l  # Hits new branch
500 loops, best of 5: 87.9 nsec per loop

$ ./python.exe -m timeit -s l=[0,1,2,3] l+[0,1,2,3]  # Hits old branch
500 loops, best of 5: 92.5 nsec per loop

--

___
Python tracker 

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



[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-11 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



[issue38424] typing.Generator shorthand

2019-10-11 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



[issue38446] Ambiguous signature for builtins.__build_class__

2019-10-11 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

If you would like to propose a doc fix, then please go ahead and make a PR.

--

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Eryk, I think testing for bool in _fd_converter and issuing a warning is a good 
idea. Do you want to create a PR?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

...and obviously the gains are more pronounced for more/longer lists.

In general I'm not married to this change, though. If the consensus is "not 
worth it", I get it.

But it seems like too easy of a win to me.

--

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is already documented, with examples. I do not think the documentation can 
be made better.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Actually Serhiy is right, I just checked and found this sentence:
```
Alternatively, annotate your generator as having a return type of either 
Iterable[YieldType] or Iterator[YieldType]
```

--
resolution:  -> works for me
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



[issue36229] Avoid unnecessary copies for list, set, and bytearray ops.

2019-10-11 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +16298
pull_request: https://github.com/python/cpython/pull/16705

___
Python tracker 

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> I do not see any significant change in + operator timing on my machine 
> (again, just a rough test):

Because the time includes the time of iterating, which can be significant in 
comparison with adding two integers. Please use the pyperf module with 
--duplicate=1000.

> I'm aware that unpacking is "better". With that said, adding a list literal 
> (or a slice of any list, or a list comprehension) to another list is a fairly 
> common operation (I count several dozen examples in the stdlib).

Could you provide any numbers? For example you can patch ceval.c to count these 
BINARY_ADD for which your optimization works and these for which it does not 
work and output counts at the exit of Python. Run several Python programs with 
the modified interpreter. Tests are bad example, but better than nothing. 
Something like hg would be better. You are free to find programs that would 
benefit the most from your optimization.

> And the speed-up is good, even in these cases.

5%. It is not impressive for optimizing a single rare operation.

--

___
Python tracker 

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



[issue36229] Avoid unnecessary copies for list, set, and bytearray ops.

2019-10-11 Thread Armin Rigo


Change by Armin Rigo :


--
nosy:  -arigo

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread Rüdiger Plüm

Rüdiger Plüm  added the comment:

Welcome Victor Stinner. Any chance to get it also backported to 3.6 as I guess 
this would increase the chance to see it in RedHat 8 where I hit the issue?

--

___
Python tracker 

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

Serhiy, here are the better performance measurements:


$ ./python.exe -m pyperf timeit --duplicate=1000 -s z=0 z+0  # list-add
.
Mean +- std dev: 17.3 ns +- 0.3 ns

$ ./python.exe -m pyperf timeit --duplicate=1000 -s z=0 z+0  # master
.
Mean +- std dev: 17.2 ns +- 0.3 ns

$ ./python.exe -m pyperf timeit --duplicate=1000 -s l=[0,1,2,3] [0,1,2,3]+l  # 
New branch
.
Mean +- std dev: 92.6 ns +- 1.7 ns

$ ./python.exe -m pyperf timeit --duplicate=1000 -s l=[0,1,2,3] l+[0,1,2,3]  # 
Old branch
.
Mean +- std dev: 99.8 ns +- 1.4 ns


Honestly, I'll defer to you here. If you feel like pursuing this is a total 
waste of time, I'll just close the issue/PR. Otherwise I can explore how often 
the branch is hit in production code, as you suggested.

--

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Abhilash Raj


Abhilash Raj  added the comment:

I am looking into the issue.

--
nosy: +maxking

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-10-11 Thread Caris Moses


Caris Moses  added the comment:

Hello,
I am still running into this issue. I have tested the following code with 
Python 3.7.4, 3.7.5rc1 , and 3.8.0rc1.

from unittest import TestCase
from unittest.mock import patch, Mock, call

class MyObject:
def __init__(self):
self.foo = 0
self.bar = 0

def set_foo(self, value):
self.foo = value

def set_bar(self, value):
self.bar = value

def do_something():
o = MyObject()
o.set_foo(3)
o.set_bar(4)
return 'something unrelated'

class MyObjectTest(TestCase):

@patch('test_mock.MyObject.set_bar', autospec=True)
@patch('test_mock.MyObject.set_foo', autospec=True)
def test_do_something(self, mock_set_foo, mock_set_bar):
manager = Mock()
manager.attach_mock(mock_set_foo, 'set_foo_func')
manager.attach_mock(mock_set_bar, 'set_bar_func')
do_something()
assert manager.mock_calls == [call.set_foo_func(3), 
call.set_bar_func(4)]

--
nosy: +Caris Moses

___
Python tracker 

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



[issue38395] proxy_contains (weakref.proxy) can access an object with 0 refcount

2019-10-11 Thread miss-islington


miss-islington  added the comment:


New changeset 193366e25c4f84a58d2f6c6c577fd9f0143dc6e1 by Miss Islington (bot) 
(Pablo Galindo) in branch '3.7':
[3.7] bpo-38395: Fix ownership in weakref.proxy methods (GH-16632) (GH-16663)
https://github.com/python/cpython/commit/193366e25c4f84a58d2f6c6c577fd9f0143dc6e1


--
nosy: +miss-islington

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-10-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Oh well :( My initial guess is that the report is for methods. The other 
reports were for functions. So I am wondering if the check for FunctionType is 
successful and if I need to handle something more. I haven't tried it yet.

--

___
Python tracker 

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



[issue38341] Add SMTPNotSupportedError in the exports of smtplib

2019-10-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16299
pull_request: https://github.com/python/cpython/pull/16721

___
Python tracker 

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

I went ahead and ran an instrumented build on some random production code 
(mostly financial data processing), just because I was curious:

BINARY_ADD ops: 3,720,776
BINARY_ADD ops with two lists: 100,452 (2.7% of total)
BINARY_ADD with new fast path: 26,357 (26.2% of list adds, 0.7% of total)

--

___
Python tracker 

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



[issue38450] 3.8 Release Notes: IDLE section dupe

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report!  Those whatsnew issues are being addressed in PR 16621.

--
nosy: +ned.deily
resolution:  -> duplicate
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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Welcome Victor Stinner. Any chance to get it also backported to 3.6 as I 
> guess this would increase the chance to see it in RedHat 8 where I hit the 
> issue?

Python 3.6 doesn't accept bugfixes upstream.

If you are a Red Hat customer, you can contact the support to request a 
backport. Or you can copy the file from the master branch :-)

--

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Maybe os.fspath() can be used:

>>> os.fspath(True)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: expected str, bytes or os.PathLike object, not bool

--

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-10-11 Thread Caris Moses


Caris Moses  added the comment:

I tried it with mocked functions instead of methods and got the same result, so 
I dug into this a little deeper. It seems as though the issue it how the mocked 
functions are called. If I replace the do_something() line with the following 
then it works.

#do_something()
manager.set_foo_func(3)
manager.set_bar_func(4)

I am a beginner with unittest so please let me know if I am just using this 
incorrectly. However in the original code I posted, if I 
print(manager.set_foo_func.mock_calls, manager.set_bar_func.mock_calls) I get 
the calls made in do_something(), however print(manager.mock_calls) returns an 
empty list which leads me to believe something else is wrong.

--

___
Python tracker 

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



[issue38270] Tests: Avoid MD5 or check for MD5 availablity

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

It looks like Christian originally requested autobackports to both 3.8 and 3.7 
but both failed due to git checkout errors.  He then manually restarted the 3.8 
backport but it looks like the 3.7 one did not get restarted.  Christian, was 
that intentional or just an oversight?  If the latter, you should try the 3.7 
backport again.

--
nosy: +ned.deily

___
Python tracker 

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



[issue28188] os.putenv should support bytes arguments on Windows

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

This issue was referenced from https://bugs.python.org/issue29240#msg285482

--

___
Python tracker 

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



[issue28188] os.putenv should support bytes arguments on Windows

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

In the meanwhile, the PEP 540 "UTF-8 Mode" has been implemented.

--
nosy: +vstinner

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Abhilash Raj


Abhilash Raj  added the comment:

The bug is interesting due to some of the implementation details of 
"guess_type". The documentation says that it can parse either a URL or a 
filename.

Switching from urllib.parse._splittype to urllib.parse.urlparse changed what a 
valid "path" is. _splittype doesn't care about the rest of the URL except the 
scheme, but urlparse does. Previously, we used to split things like:

   >>> print(urllib.parse._splittype(';1.tar.gz')
   (None, ';1.tar.gz')

Then, we'd just treat the 2nd part as a filesystem path, which would rightfully 
guess the extension as .tar.gz

However, switching to using parsing via urllib.parse.urlparse, we get:

>>> print(urllib.parse.urlparse(';1.tar.gz')
ParseResult(scheme='', netloc='', path='', params='1.tar.gz', query='', 
fragment='')

And then we get the ".path" attribute for further processing, which being 
empty, returns (None, None).

The format of all these parts is:

scheme://netloc/path;parameters?query#fragment

A simple fix would be to just merge path, parameters, query and fragment 
together (with appropriate delimiters) and the proceed with further processing. 
That would fix parsing of Filesystem paths but would break (again) parsing of 
URLs like:

>>> mimetypes.guess_type('http://example.com/index.html;1.tar.gz')
('application/x-tar', 'gzip')

It should return 'text/html' as the type, since this is a URL and everything 
after the ';' should not be used to determine the mimetype. But, if there is no 
scheme provided, we should treat it as a filesystem path and in that case 
'application/x-tar' is the right type.

I hope I am not confusing everyone here. 

The right fix IMO would be to make "guess_type" not treat URLs and filesytem 
paths alike.

--

___
Python tracker 

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



[issue38452] unittest setUpClass missing 1 required positional argument: 'cls'

2019-10-11 Thread Danylo


New submission from Danylo :

Currently, unittest setUpClass and tearDownClass methods are incorrectly called 
from within its core.

```
class TestUltrasonicEnv(unittest.TestCase):

def setUpClass(cls):
pass


def tearDownClass(cls):
pass
```

Traceback (the same for teadDownClass)
```
  File "/home/dizcza/anaconda3/envs/robotsim/lib/python3.7/unittest/suite.py", 
line 163, in _handleClassSetUp
setUpClass()
TypeError: setUpClass() missing 1 required positional argument: 'cls'
```

The traceback is self-descriptive.

--
components: Tests
messages: 354501
nosy: dizcza
priority: normal
severity: normal
status: open
title: unittest setUpClass missing 1 required positional argument: 'cls'
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



[issue32238] Handle "POSIX" in the legacy locale detection

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

In Python 3.8, if the LC_CTYPE is "POSIX", the default stdio error handler is 
now "surrogateescape" instead of "strict", and the UTF-8 is now enabled. In 
short, LC_CTYPE="POSIX" now behaves as LC_CTYPE="C".

This change impacts at least FreeBSD. If I correctly, if there is no LC_ALL, 
LC_CTYPE or LANG environment variable on FreeBSD, the LC_CTYPE locale is 
"POSIX".

See bpo-34485, bpo-19977 and the "POSIX locale on FreeBSD" section of my 
article:
https://vstinner.github.io/python3-locales-encodings.html

--

___
Python tracker 

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



[issue30672] PEP 538: Unexpected locale behaviour on *BSD (including Mac OS X)

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Since this issue has been created, I deeply reworked the Python Initialization 
with the PEP 587, and I made many changes related to locales and the UTF-8 Mode 
(PEP 540). What's the status of this issue?

--
nosy: +vstinner

___
Python tracker 

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



[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-11 Thread Tal Einat


Tal Einat  added the comment:

I'd certainly be surprised to have the order of zero and negative values in the 
input have such a dramatic effect on the result. It would make debugging these 
cases unnecessarily confusing and difficult. And I think it is indeed worth 
fixing, as these edge-cases are likely to come up of time when dealing with 
large amounts of data.

I'm +1 on Warren's latest suggestion for a fix.

P.S If we agree on this, either Warren should make the fix himself or we should 
mark it "newcomer friendly" and let a newcomer handle it.

--
nosy: +taleinat

___
Python tracker 

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



  1   2   >