[issue38106] [2.7] Race in PyThread_release_lock on macOS - can lead to memory corruption and deadlock

2019-10-02 Thread Mariusz Wawrzonkowski


Mariusz Wawrzonkowski  added the comment:

I can confirm that I have the deadlock because of the reason described above. 
When I change the PyThread_release_lock source locally to signal before 
releasing the mutex, then my deadlock does not occur anymore. I have tested it 
on a heave multithreading model.

--
nosy: +mariosoft

___
Python tracker 

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



[issue38342] ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata'

2019-10-02 Thread Florimond Manca


Florimond Manca  added the comment:

Can confirm this on 3.8.0rc1+ / macOS Mojave:

```console
$ python -c "import importlib.metadata; 
print(list(importlib.metadata.distributions()))"
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Users/florimond/.pyenv/versions/3.8-dev/lib/python3.8/importlib/metadata/__init__.py",
 line 175, in 
resolver()
  File "", line 1381, in 
find_distributions
ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata' 
(/Users/florimond/.pyenv/versions/3.8-dev/lib/python3.8/importlib/metadata/__init__.py)
```

I discovered this pytest started failing on 3.8-dev because it uses 
`importlib.metadata.distributions()` internally.

3.8.0b4+ used to be fine I believe. I'd assume this is a rather critical bug?

--
nosy: +Florimond Manca

___
Python tracker 

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



[issue38342] ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata'

2019-10-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The library was synced with https://bugs.python.org/issue38121 which seems to 
be related to this.

--
nosy: +xtreak

___
Python tracker 

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, Neil missed "bpo-38006: " prefix in his commit. Here it is:

commit bcda460baf25062ab68622b3f043f52b9db4d21d
Author: Neil Schemenauer 
Date:   Mon Sep 30 10:06:45 2019 -0700

Clear weakrefs in garbage found by the GC (#16495)

Fix a bug due to the interaction of weakrefs and the cyclic garbage
collector. We must clear any weakrefs in garbage in order to prevent
their callbacks from executing and causing a crash.

--

___
Python tracker 

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



[issue38346] Wrong behavior when using `assert_called_with` with mutable object

2019-10-02 Thread Jim Jeon


New submission from Jim Jeon :

When `assert_called_with` is used with mutable object, test fails if the object 
has changed. I think this is not what it meant to do.

https://docs.python.org/dev/library/unittest.mock-examples.html#coping-with-mutable-arguments

The same situation is explained in this document. But I don't understand why 
they did not fix and just are proposing some solutions to the users.

--
components: Tests
files: Screen Shot 2019-10-02 at 5.22.05 PM.png
messages: 353727
nosy: Jim Jeon
priority: normal
severity: normal
status: open
title: Wrong behavior when using `assert_called_with` with mutable object
type: enhancement
versions: Python 3.7
Added file: https://bugs.python.org/file48638/Screen Shot 2019-10-02 at 5.22.05 
PM.png

___
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-02 Thread Rüdiger Plüm

New submission from Rüdiger Plüm :

Tools/scripts/pathfix.py does not find Python scripts that contain a '-' in 
their filename when working recursively.
This is caused by the regular expression used to detect whether a filename is a 
Python script:

r'^[a-zA-Z0-9_]+\.py$'

r'^[a-zA-Z0-9_-]+\.py$'

fixes this. I am not sure if you want to allow further characters in script 
names like spaces or other special characters. The pull request I will create 
will only fix the '-' issue.

--
components: Demos and Tools
messages: 353728
nosy: rpluem
priority: normal
severity: normal
status: open
title: pathfix.py does not find Python scripts that have '-' in its filename
type: behavior
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



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

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

Change by Rüdiger Plüm :


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

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



[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-10-02 Thread Łukasz Langa

Łukasz Langa  added the comment:

> Łukasz, is there some reason you removed old versions (2.7, 3.6, etc)?  The 
> bug is present on those versions of Python and it should be trivial to 
> backport the fix.  If those branches are maintained, I think we should fix it.

Sorry, I did that by mistake.

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16126
pull_request: https://github.com/python/cpython/pull/16537

___
Python tracker 

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



[issue38346] Wrong behavior when using `assert_called_with` with mutable object

2019-10-02 Thread Vedran Čačić

Vedran Čačić  added the comment:

I don't see what the "fix" should be. Python doesn't have value semantics. 
Functions are called with objects, not with their values.

Imagine a was global variable, and then you say:
a = mutable_object()
f(a)
a.mutate()
f.assert_called_with(a)

In your view of the world, this should raise??

--
nosy: +veky

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16127
pull_request: https://github.com/python/cpython/pull/16538

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2ea71a07d0a720707094ee55f78fd232c40724bc by Victor Stinner in 
branch 'master':
bpo-36670: regrtest bug fixes (GH-16537)
https://github.com/python/cpython/commit/2ea71a07d0a720707094ee55f78fd232c40724bc


--

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread miss-islington


miss-islington  added the comment:


New changeset a72de9338882b8013a4bb8adb930fe3308682e28 by Miss Islington (bot) 
in branch '3.8':
bpo-36670: regrtest bug fixes (GH-16537)
https://github.com/python/cpython/commit/a72de9338882b8013a4bb8adb930fe3308682e28


--

___
Python tracker 

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



[issue38346] Wrong behavior when using `assert_called_with` with mutable object

2019-10-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

As explained copy would cause backwards incompatible change on objects that 
depend on identity comparison. I am not sure if this can be fixed in a 
backwards compatible manner.

> One possibility would be for mock to copy the arguments you pass in. This 
> could then cause problems if you do assertions that rely on object identity 
> for equality.

--
nosy: +cjw296, lisroach, mariocj89, michael.foord, xtreak

___
Python tracker 

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



[issue38346] Wrong behavior when using `assert_called_with` with mutable object

2019-10-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also https://bugs.python.org/issue28848

--

___
Python tracker 

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



[issue38342] ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata'

2019-10-02 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I believe importlib/metadata/__init__ was moved to importlib.metadata. I’ll 
inspect the repo for correctness, but there may be another issue with the old 
files lingering.

--

___
Python tracker 

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



[issue38342] ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata'

2019-10-02 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I've confirmed that the `metadata` directory doesn't exist in the repo. It also 
doesn't appear on my Python 3.8.0b4 installation on macOS:

```
cpython master $ ls 
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/  
 
__init__.py_bootstrap.py  abc.py 
metadata.pyutil.py
__pycache___bootstrap_external.py machinery.py   
resources.py
cpython master $ python3.8 -V   
 
Python 3.8.0b4
```

I installed b4 clean. I also installed 3.8.0rc1 over 3.8.0b4 and everything is 
fine.

It's possible that installing 3.8.0b4 over 3.8.0b3 would leave the old package 
lingering. Can you confirm that's how 3.8.0rc1 was installed?

I've crafted this command which should correct the situation in such an 
environment::

python -c "import importlib.metadata, shutil, pathlib; file = 
pathlib.Path(importlib.metadata.__file__); str(file).endswith('__init__.py') 
and shutil.rmtree(file.parent) and print('removed', file.parent)"

Please give that a try and see if it corrects the condition.

--

___
Python tracker 

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



[issue38331] Exec not recognizing global variables inside function

2019-10-02 Thread Huyston


Huyston  added the comment:

Ronald Oussoren, I understand your comment and it makes sense in the module 
perspective.

However, when using 'exec', we are explicitly passing a globals dict (and 
locals) that the target code should consider.

As the documentation states:
"If globals and locals are given, they are used for the global and local 
variables, respectively."

In my point of view, the function is not considering the given globals and 
locals dict.

--

___
Python tracker 

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



[issue38319] shutil.copyfile(): os.sendfile() fails with OverflowError on 32-bit system

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:

32-bit buildbots are back to green. Thanks for the fix!

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



[issue38342] ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata'

2019-10-02 Thread Anthony Tuininga


Anthony Tuininga  added the comment:

Yes. I had tried b3 earlier, installed b4 over b3 and then rc1 over b4. 
Removing the cruft using the command you specified caused the problem to go 
away.

--

___
Python tracker 

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



[issue38338] [2.7] test_ssl fails on RHEL8

2019-10-02 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38342] ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata'

2019-10-02 Thread Batuhan


Batuhan  added the comment:

https://gitlab.com/python-devs/importlib_metadata/issues/92

--
nosy: +BTaskaya

___
Python tracker 

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



[issue38348] Make python -m ast more configurable

2019-10-02 Thread Batuhan


New submission from Batuhan :

Allow user to set indent level and parsing status of type comments

--
components: Library (Lib)
messages: 353741
nosy: BTaskaya, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Make python -m ast more configurable
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



[issue38348] Make python -m ast more configurable

2019-10-02 Thread Batuhan


Change by Batuhan :


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

___
Python tracker 

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



[issue38338] [2.7] test_ssl fails on RHEL8

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b3e7045f8314e7b62cd95861d207fe2f97e47198 by Victor Stinner in 
branch 'master':
bpo-38338, test.pythoninfo: add more ssl infos (GH-16539)
https://github.com/python/cpython/commit/b3e7045f8314e7b62cd95861d207fe2f97e47198


--

___
Python tracker 

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



[issue38338] [2.7] test_ssl fails on RHEL8

2019-10-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16131
pull_request: https://github.com/python/cpython/pull/16542

___
Python tracker 

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



[issue38338] [2.7] test_ssl fails on RHEL8

2019-10-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16130
pull_request: https://github.com/python/cpython/pull/16541

___
Python tracker 

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



[issue38349] Email example using imaginary library installation error. The install shows that it only supports python 2.x but is listed for python 3.6+

2019-10-02 Thread jackotonye


New submission from jackotonye :

https://docs.python.org/3.7/library/email.examples.html

--
assignee: docs@python
components: Documentation
messages: 353743
nosy: docs@python, jackotonye
priority: normal
severity: normal
status: open
title: Email example using imaginary library installation error. The install 
shows that it only supports python 2.x but is listed for python 3.6+
type: resource usage
versions: 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



[issue38349] Email example using imaginary library installation error. The install shows that it only supports python 2.x but is listed under python 3.6+ docs.

2019-10-02 Thread jackotonye


Change by jackotonye :


--
title: Email example using imaginary library installation error. The install 
shows that it only supports python 2.x but is listed for python 3.6+ -> Email 
example using imaginary library installation error. The install shows that it 
only supports python 2.x but is listed under python 3.6+ docs.

___
Python tracker 

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



[issue38338] [2.7] test_ssl fails on RHEL8

2019-10-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16132
pull_request: https://github.com/python/cpython/pull/16543

___
Python tracker 

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



[issue38338] [2.7] test_ssl fails on RHEL8

2019-10-02 Thread miss-islington


miss-islington  added the comment:


New changeset ab98cd8aee5a5a7222b82ff13d61f0d33e72a889 by Miss Islington (bot) 
in branch '3.7':
bpo-38338, test.pythoninfo: add more ssl infos (GH-16539)
https://github.com/python/cpython/commit/ab98cd8aee5a5a7222b82ff13d61f0d33e72a889


--
nosy: +miss-islington

___
Python tracker 

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



[issue38349] Email example using imaginary library installation error. The install shows that it only supports python 2.x but is listed under python 3.6+ docs.

2019-10-02 Thread SilentGhost


SilentGhost  added the comment:

imaginary in the example is not meant to refer to 
https://pypi.org/project/Imaginary/ it's meant to refer to a module that you 
could write that would do all the dirty work. Perhaps, it's not the best name 
to use provided there is an actual module on pypi, alternatively half-baked 
outdated modules could be remove.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue38350] ./configure --with-pydebug should use -O0 rather than -Og

2019-10-02 Thread STINNER Victor


New submission from STINNER Victor :

In Python 2.7, when using ./configure --with-pydebug, Python is built using -O0 
compiler optimization level: disable all optimizations. The comment is quite 
explicit: "Optimization messes up debuggers, so turn it off for debug builds".

if test "$Py_DEBUG" = 'true' ; then
# Optimization messes up debuggers, so turn it off for
# debug builds.
OPT="-g -O0 -Wall $STRICT_PROTO"
else
OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
fi

In Python 3, -Og is preferred over -O0 for pydebug, if -Og is available:

if test "$Py_DEBUG" = 'true' ; then
# Optimization messes up debuggers, so turn it off for
# debug builds.
if "$CC" -v --help 2>/dev/null |grep -- -Og > /dev/null; then
OPT="-g -Og -Wall"
else
OPT="-g -O0 -Wall"
fi
else
OPT="-g $WRAP -O3 -Wall"
fi

Problem: in my experience, gdb traceback doesn't make sense sometimes, and gdb 
fails to inspect some function arguments and some variables which are displayed 
as .

See a very concrete example with a test_gdb failure on x86-64 when Python is 
compiled using gcc -Og:
https://bugzilla.redhat.com/show_bug.cgi?id=1734327#c22

My colleague who is working on gdb suggests to use -O0:
https://bugzilla.redhat.com/show_bug.cgi?id=1734327#c27

Since I started contributing to Python, I always forced gcc -O0 because any 
other optimization level caused me many issues in gdb. I'm using -O0 for 10 
years with sucess.

The GCC documentation says "It is a better choice than -O0 for producing 
debuggable code because some compiler passes that collect debug information are 
disabled at -O0." But my experience says the opposite.

Note: instead of -g, we could use -g3 to include debug information for macros 
and defines.

--

I'm proposing to change the *default* compiler flags from -Og to -O0. 
Obviously, Linux distributions and developers are free to override the compiler 
optimization level. For example: ./configure --with-pydebug CFLAGS="-Og" 
ensures that Python is always built using -Og.

I propose to modify 3.7, 3.8 and master branches.

--
components: Build
messages: 353746
nosy: vstinner
priority: normal
severity: normal
status: open
title: ./configure --with-pydebug should use -O0 rather than -Og
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



[issue38338] [2.7] test_ssl fails on RHEL8

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 403ca7ea70232e520af18511fbfb89b58ef2a046 by Victor Stinner in 
branch '2.7':
[2.7] bpo-38338, test.pythoninfo: add more ssl infos (GH-16543)
https://github.com/python/cpython/commit/403ca7ea70232e520af18511fbfb89b58ef2a046


--

___
Python tracker 

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



[issue38350] ./configure --with-pydebug should use -O0 rather than -Og

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:

I basically propose to revert bpo-23445 change:

commit 3d6c784371bccc2407048652bce50c5bccf9b1af
Author: Antoine Pitrou 
Date:   Wed Feb 11 19:39:16 2015 +0100

Issue #23445: pydebug builds now use "gcc -Og" where possible, to make the 
resulting executable faster.

--

___
Python tracker 

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



[issue38351] Modernize email example from %-formatting to f-string

2019-10-02 Thread Mariatta


New submission from Mariatta :

A string was formatted with %s in the code example 

https://github.com/python/cpython/blob/b3e7045f8314e7b62cd95861d207fe2f97e47198/Doc/includes/email-simple.py#L15
 

```
msg['Subject'] = 'The contents of %s' % textfile
```

It would be great to modernize that into fstring.

Doc can be read at: https://docs.python.org/3.7/library/email.examples.html

--
assignee: docs@python
components: Documentation
keywords: easy, newcomer friendly
messages: 353749
nosy: Mariatta, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: Modernize email example from %-formatting to f-string
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



[issue38350] ./configure --with-pydebug should use -O0 rather than -Og

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:

test_gdb is failing in different architectures and different operating systems:

* Fedora, Python 3.8, x86-64:
  https://bugzilla.redhat.com/show_bug.cgi?id=1734327

* RHEL8, Python 3.6, s390x
  https://bugzilla.redhat.com/show_bug.cgi?id=1712977

* RHEL 8, Python 3.6, ppc64le
  https://bugzilla.redhat.com/show_bug.cgi?id=1714733

I'm quite sure that most issues are caused by the compiler optimization level 
which is not -O0.

See also bpo-37631: the debug build of the RHEL8 package is supposed to be 
compiled using -O0 using EXTRA_CFLAGS variable, but -O0 in EXTRA_CFLAGS 
variable is overriden by -02 in CFLAGS_NODIST.

--

___
Python tracker 

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



[issue38338] [2.7] test_ssl fails on RHEL8

2019-10-02 Thread miss-islington


miss-islington  added the comment:


New changeset 183733dfb6b4779d1a5e47f41a2fb86c6be08dda by Miss Islington (bot) 
in branch '3.8':
bpo-38338, test.pythoninfo: add more ssl infos (GH-16539)
https://github.com/python/cpython/commit/183733dfb6b4779d1a5e47f41a2fb86c6be08dda


--

___
Python tracker 

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



[issue38350] ./configure --with-pydebug should use -O0 rather than -Og

2019-10-02 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38342] ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata'

2019-10-02 Thread Brett Cannon


Brett Cannon  added the comment:

Closing as not a bug as this seems to be an issue from installing over a b3 or 
earlier build where the importlib/metadata/ directory gets left behind and thus 
take priority in import over importlib/metadata.py.

--
nosy: +brett.cannon
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



[issue38350] ./configure --with-pydebug should use -O0 rather than -Og

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:

My use case is to debug a crash using a Python compiled in debug module, like 
python3-debug program in Fedora. Since the debug ABI is now compatible with the 
release build, the idea is to attempt to reproduce a crash in gdb using 
python3-debug instead of python3, and then use gdb to see what's going on.

With -Og, the call stack is wrong sometimes, and some function arguments and 
local variables cannot be read (displayed as ).

On Travis CI, a few months ago, Python was built in debug mode using -O3. But 
it was a side effect of OpenSSL flags if I recall correctly.

With my PR 16544, Travis CI now uses -O0.

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

___
Python tracker 

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



[issue23445] Use -Og for debug builds

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-38350 to propose to revert this change.

--

___
Python tracker 

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



[issue38349] Email example using imaginary library installation error. The install shows that it only supports python 2.x but is listed under python 3.6+ docs.

2019-10-02 Thread jackotonye


jackotonye  added the comment:

Might be best to make it a little more obvious since most examples are
considered executable code. That would require little modification.

On Wed, Oct 2, 2019 at 12:20 PM SilentGhost  wrote:

>
> SilentGhost  added the comment:
>
> imaginary in the example is not meant to refer to
> https://pypi.org/project/Imaginary/ it's meant to refer to a module that
> you could write that would do all the dirty work. Perhaps, it's not the
> best name to use provided there is an actual module on pypi, alternatively
> half-baked outdated modules could be remove.
>
> --
> nosy: +SilentGhost
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue38344] activate.bat else needs to be on the same line as the if

2019-10-02 Thread Steve Dower


Steve Dower  added the comment:

Should be a straightforward fix (replace the "else" with "if not defined..."), 
but since it slipped through testing we probably want a regression test in 
test_venv as well.

(+RM for the 3.8 regression)

--
keywords: +3.8regression
nosy: +lukasz.langa
priority: normal -> release blocker
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



[issue38351] Modernize email example from %-formatting to f-string

2019-10-02 Thread Fred L. Drake, Jr.


Fred L. Drake, Jr.  added the comment:

Does it make sense to change just one example?

I'm not sure what the long-term stance is on whether %-formatting should be 
replaced at this point, but shouldn't this be a matter of which string 
formatting approach we want overall, rather than adjusting only specific 
examples?

--
nosy: +fdrake

___
Python tracker 

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



[issue38344] activate.bat else needs to be on the same line as the if

2019-10-02 Thread Steve Dower


Steve Dower  added the comment:

Adding this to the end of test_unicode_in_batch_file seems to be sufficient to 
cause the test to fail:

self.assertEqual(err.strip(), '')

Potentially we should add that additional check throughout this test module, 
but I don't think that's needed for a post-RC fix.

--

___
Python tracker 

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



[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16134
pull_request: https://github.com/python/cpython/pull/16545

___
Python tracker 

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



[issue38335] simplify overlaps function in ipaddress.py

2019-10-02 Thread Sanjay


Change by Sanjay :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 16545 solves the problem by using OS specific methods for converting between 
Python and Tcl strings. It is not ideal, but is good enough for most real cases.

Now you can paste, copy and print non-BMP characters. The code containing them 
can be displayed weird, but the result of print looks OK.

>>> '\N{PERSONAL COMPUTER}'
'💻'
>>> print('💻')
💻

As a side effect, printing '\udcf0\udc9f\udc90\udc8d' on Linux and 
'\ud83d\udcbb' on Windows should have the same effect as printing '\U0001f4bb'.

I do not know about macOS, but expect the same behavior as on Linux. Could 
anybody test please?

--

___
Python tracker 

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



[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Oops, it is better to attach it to issue13153.

--

___
Python tracker 

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



[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16135
pull_request: https://github.com/python/cpython/pull/16545

___
Python tracker 

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



[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-02 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 16545 solves the problem by using OS specific methods for converting between 
Python and Tcl strings. It is not ideal, but is good enough for most real cases.

Now you can paste, copy and print non-BMP characters. The code containing them 
can be displayed weird, but the result of print looks OK.

>>> '\N{PERSONAL COMPUTER}'
'💻'
>>> print('💻')
💻

As a side effect, printing '\udcf0\udc9f\udc90\udc8d' on Linux and 
'\ud83d\udcbb' on Windows should have the same effect as printing '\U0001f4bb'.

I do not know about macOS, but expect the same behavior as on Linux. Could 
anybody test please?

--

___
Python tracker 

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



[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue38351] Modernize email example from %-formatting to f-string

2019-10-02 Thread Mariatta


Mariatta  added the comment:

I think updating one isolated code example is less invasive and easier to 
review, instead of one big PR to change everything from "%s" to str.format or 
f-string.

I brought up this example code merely because I happen to be reading this page.

--

___
Python tracker 

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



[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2019-10-02 Thread Karl Kornel


New submission from Karl Kornel :

Hello!

In https://github.com/python/cpython/blob/master/Lib/typing.py#L115-L117, there 
is a note about the io and re classes not being included in typing.__all__.  I 
am a relatively new user of typing, and I did `from typing import *` in my 
code.  I ran the code through mypy first, which reported no problems, but then 
running Python 3.6 failed with a NameError (name 'IO' is not defined).

Reading through the typing source, it's clear that this was an intentional 
decision.  So, instead of reporting a bug, I'd like to request a documentation 
enhancement!

The docs for typing make no mention of typing.io or typing.re.  So, my request 
is: In the sections for the IO/TextIO/BinaryIO and Pattern/Match classes, 
include text warning the user that these types are not imported when you do 
`from typing import *`.

--
assignee: docs@python
components: Documentation
messages: 353763
nosy: Karl Kornel, docs@python
priority: normal
severity: normal
status: open
title: In typing docs, note explicit import needed for IO and Pattern/Match
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue38344] activate.bat else needs to be on the same line as the if

2019-10-02 Thread Steve Dower


Steve Dower  added the comment:

Also adding Ned - this made it into 3.7 as well.

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



[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-02 Thread Tal Einat

Tal Einat  added the comment:

Serhiy, this looks like a great step in the right direction!

Tested on Win10 with PR GH-16545 (commit f4db0e7e00). Here is a copy/paste from 
an IDLE shell session:

>>> '\N{PERSONAL COMPUTER}'
'💻'
>>> print('💻')
SyntaxError: 'utf-8' codec can't encode characters in position 7-12: surrogates 
not allowed

Note that in the first output, the second and third chars in the string aren't 
visible in IDLE; i.e. what is actually displayed is 'ð»'.

--

___
Python tracker 

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



[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-02 Thread Tal Einat

Tal Einat  added the comment:

Not sure if this helps, but a bit of experimentation brought this up:

>>> '\N{PERSONAL COMPUTER}'.encode('utf-8')
b'\xf0\x9f\x92\xbb'
>>> '💻'.encode('utf-16le')
b'\xf0\x00\x9f\x00\x92\x00\xbb\x00'
>>> '💻'.encode('utf-16')
b'\xff\xfe\xf0\x00\x9f\x00\x92\x00\xbb\x00'

--

___
Python tracker 

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



[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-02 Thread Tal Einat

Tal Einat  added the comment:

More info:

>>> '\N{PERSONAL COMPUTER}'.encode('utf-8').decode('latin-1') == '💻'
True

--

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread David Bolen


David Bolen  added the comment:

Just an FYI that this change is generating warnings on my Windows 10 buildbot 
with some regularity about a failure to parse testperf output, such as:

Warning -- Failed to parse typeperf output: '"10/01/2019 07:58:50.056"'

from https://buildbot.python.org/all/#/builders/217/builds/487

Now, clearly there's no queue length in that output so the parsing warning is 
accurate, but does the overall build have to reflect a warning in such cases, 
given that it's just a test harness issue, and not anything going wrong with 
the actual tests?  Previously any such cases would be ignored silently, so this 
probably isn't a new issue but just one that is now shows up as an overall 
build warning.

I don't know why both fields aren't present although it seems plausible that 
it's just a partial line from the I/O (I don't think it guarantees it receives 
full lines), and the queue length field would appear on the following read.

--
nosy: +db3l

___
Python tracker 

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



[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sorry, I did not test the last version on Windows. There was a bug which caused 
using the Linux version on Windows. Now it should be fixed.

--

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:

> Just an FYI that this change is generating warnings on my Windows 10 buildbot 
> with some regularity about a failure to parse testperf output, such as:

Warning -- Failed to parse typeperf output: '"10/01/2019 07:58:50.056"'

Aha, interesting. I added a warning to debug the code.

> Now, clearly there's no queue length in that output so the parsing warning is 
> accurate, but does the overall build have to reflect a warning in such cases, 
> given that it's just a test harness issue, and not anything going wrong with 
> the actual tests?

The build is marked as "warning" (orange) which is different than "fail" (red). 
Warnings are used to detect bugs or interesting issues, but not considered as a 
regression.

> I don't know why both fields aren't present although it seems plausible that 
> it's just a partial line from the I/O (I don't think it guarantees it 
> receives full lines), and the queue length field would appear on the 
> following read.

Right, the code doesn't ensure that a line ends with a newline character. Could 
you try to run manually the following command to check its output?

   typeperf "\System\Processor Queue Length" -si 1

Maybe uncomplete lines should be buffered in read_output().

--

___
Python tracker 

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



[issue38014] Python 3.7 does not compile

2019-10-02 Thread Matej Cepl

Matej Cepl  added the comment:

Isn’t https://bugzilla.suse.com/1152793 (removal of stropts.h from glibc) cause 
of this?

--
nosy: +mcepl

___
Python tracker 

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



[issue38014] Python 3.7 does not compile

2019-10-02 Thread Matej Cepl


Matej Cepl  added the comment:

Sorry, got confused. My openSUSE bug has nothing to do with it.

--

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread David Bolen


David Bolen  added the comment:

Oh, I agree it's just a warning, and I suspect few people look into warnings, 
but since it's not from an actual test, I'm not sure the overall build should 
be flagged.

The manual typeperf looks fine, but there's no way I could tell visually how 
the I/O is being done under the covers.  My bet is typeperf is probably issuing 
multiple output calls, one for the leading timestamp and then one for each 
value.  So regrtest just happens to interleave its own read in between the two. 
 The subsequent read would then get the trailing "," which the current code 
would parse normally as it only cares about the second field.  In which case 
it's not even affecting the load monitoring, other than the warning message.

I suspect it's happening on the Windows 10 buildbot as the machine is 
reasonably fast.  But to your earlier comment about things just working 
previously, I'm not sure there's that much value in adding code to deal with 
this case.

I'd probably just remove the warning to restore the earlier behavior.  The 
current code still ignores other issues like an actual read failure in 
read_output.  Or, if there's a way to generate the message without it being 
considered an overall test build warning, that would work too.

--

___
Python tracker 

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



[issue38353] Cleanup the path configuration implementation code (getpath.c)

2019-10-02 Thread STINNER Victor


New submission from STINNER Victor :

Place holder issue for changes related to path configuration cleanup changes 
(Modules/getpath.c).

--
components: Interpreter Core
messages: 353774
nosy: vstinner
priority: normal
severity: normal
status: open
title: Cleanup the path configuration implementation code (getpath.c)
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



[issue38353] Cleanup the path configuration implementation code (getpath.c)

2019-10-02 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38354] Fix for bug 30378 regressed SysLogHandler

2019-10-02 Thread Enji Cooper


New submission from Enji Cooper :

The change made for bug 30378 caused a regression in our code by making
lookups for SysLogHandler addresses at init time, instead of making them more 
lazy. Example:

>>> import logging.handlers
>>> LOGGER = logging.getLogger("logger")
>>> LOGGER.addHandler(logging.handlers.SysLogHandler(address=('resolvessometimesbutnotthefirsttime.com',
>>>  logging.handlers.SYSLOG_UDP_PORT)))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python2.7/logging/handlers.py", line 767, in __init__
ress = socket.getaddrinfo(host, port, 0, socktype)
socket.gaierror: [Errno -2] Name or service not known

This is exacerbated by the fact that a lot of code the organization I work for 
(and to be honest, I have written in the past) initializes global loggers once 
at import time. If the SysLogHandler is added to the global logger and the DNS 
resolution isn't possible (/etc/hosts is empty on Unix or does not contain the 
entry, and DNS out is to lunch), it will fall on its face at initialization 
time.

There needs to be a more graceful way of initializing loggers like this, or a 
way of delaying the host resolution, so it fails gracefully and doesn't crash 
the entire program (restoring the previous behavior).

Example: SMTPHandler doesn't do name resolution until it calls emit, which 
seems like a much more logical place to do the operation (especially since DNS 
records can change or become invalid).

--
components: Library (Lib)
messages: 353775
nosy: calcheng, ngie
priority: normal
severity: normal
status: open
title: Fix for bug 30378 regressed SysLogHandler
type: crash
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



[issue38354] Fix for bug 30378 regressed SysLogHandler by making it resolve addresses at initialization instead of in `.emit()`

2019-10-02 Thread Enji Cooper


Change by Enji Cooper :


--
title: Fix for bug 30378 regressed SysLogHandler -> Fix for bug 30378 regressed 
SysLogHandler by making it resolve addresses at initialization instead of in 
`.emit()`

___
Python tracker 

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



[issue38333] add type signatures to library function docs

2019-10-02 Thread paul rubin


paul rubin  added the comment:

Yes, the suggestion was just for the docs, and since those are intended for 
human rather than machine consumption, it's fine if there are some blurry cases 
where there is no signature.  Ideally in those cases, the issue should be 
explained in the doc text.

I actually don't see what's wrong with including signatures in the source code 
as well, as long as doing so doesn't break anyone's existing code.  I agree 
with Veky that one should be very hesitant about breaking existing working 
code, even if that code relies on undocumented behavior.

--

___
Python tracker 

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



[issue38353] Cleanup the path configuration implementation code (getpath.c)

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 61691d833631fed42b86605b09e1535e3e8d40e5 by Victor Stinner in 
branch 'master':
bpo-38353: Cleanup includes in the internal C API (GH-16548)
https://github.com/python/cpython/commit/61691d833631fed42b86605b09e1535e3e8d40e5


--

___
Python tracker 

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



[issue38353] Cleanup the path configuration implementation code (getpath.c)

2019-10-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16137
pull_request: https://github.com/python/cpython/pull/16549

___
Python tracker 

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



[issue38333] add type signatures to library function docs

2019-10-02 Thread Guido van Rossum


Guido van Rossum  added the comment:

@phr

To be clear, I agree that there's nothing wrong with adding signatures to docs. 
We just need to find a way to do it. There will definitely be some cases where 
it's better not to have a type rather than trying to spell out the actual type 
in the docs.

My "unacceptable" comment was meant in response to Vedran's suggestion that it 
would be okay to lie in the docs about the signature for sum(). If the truth is 
too subtle to use a specific type signature we should keep the words. (The 
words for sum() are actually pretty clear.)

FWIW: My objection against vague docs was specifically about situations where 
the word "string" is used without clarifying if this allows bytes. I've also 
seen docs that were even more vague, e.g. "a name" or "a filename".

Signatures in the code won't "break" the code (they are ignored at runtime) but 
if present they should nevertheless be precise since they will be used by type 
checkers. Signatures in code are *not* just documentation. Only in very limited 
situations would I be okay with lies in signatures -- this would have to be 
done on a case by case basis.

--

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread David Bolen


David Bolen  added the comment:

I've confirmed the partial read with some local modifications, and the failures 
are always split between time stamp and value:

Warning -- Failed to parse typeperf output: '"10/02/2019 17:42:26.229"'
0.0
Warning -- Missing first field: ,"0.00"
0.0

Adding multiple variables to the typeperf command can vary the split position, 
but I've only seen it at a variable boundary (starting with the comma).  So I'm 
guessing with the current implementation the above is probably the only point 
where the I/Os can be interleaved.

Also, CRLF seems to only appear at the start of each read, never at the end.  
You can see that behavior interactively too where the cursor waits at the end 
of the line between samples.  So changes to wait for a complete line to be read 
would also delay load values by one sample interval.

So I'm thinking just reverting to silently ignoring this case is probably 
simplest.

--

___
Python tracker 

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



[issue38354] Fix for bug 30378 regressed SysLogHandler by making it resolve addresses at initialization instead of in `.emit()`

2019-10-02 Thread Enji Cooper


Enji Cooper  added the comment:

Capturing more context here, based on internal discussion: other handlers are 
doing address resolution in `emit()` (HTTPHandler, SMTPHandler), which is 
expensive. In order for SysLogHandler to not regress behavior and not become 
expensive, performance-wise, it would probably be best to use 
`functools.lru_cache()`, using the address and a timeout as the key when 
resolving the addresses to avoid always doing address resolutions, e.g., DNS 
lookups: https://docs.python.org/3/library/functools.html#functools.lru_cache .

--

___
Python tracker 

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



[issue37631] EXTRA_CFLAGS get overrided by CFLAGS_NODIST

2019-10-02 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Dug a bit further here.

The issue is that CFLAGS_NODIST will always come after normal CFLAGS (which are 
subsets of PY_CFLAGS and PY_CFLAGS_NODIST) [0][1].

The EXTRA_CFLAGS variable is appended at the end of PY_CFLAGS [2], hence as 
reported here, whatever compiler flag comes after, embedded within 
PY_CFLAGS_NODIST, will override the previous flags if they contradict each 
other.

So basically EXTRA_CFLAGS can be used only for flags that can't be overwritten 
by PY_CFLAGS_NODIST, which in my opinion, is not very useful in the context of 
just adding extra flags.

Commit adding the variable to Python 2.5: 
https://github.com/python/cpython/commit/08cd598c2145d00f1517c93cabf80a5d7d2a4bc0

"EXTRA_CFLAGS has been introduced as an environment variable to hold compiler 
flags that change binary compatibility"

Apparently it was added in order to avoid using the OPT variable for the 
various debug builds described in 
https://github.com/python/cpython/blob/master/Misc/SpecialBuilds.txt

On another note this flag will get passed down to distutils, so if it was used 
for building the interpreter, C extensions compiled by users will also inherit 
it.

Honestly I am not sure what the best solution would be here. If the various 
sub-debug special builds are still relevant and they stack, by doing for 
example $ make CFLAGS_NODIST="-DPy_TRACE_REFS" EXTRA_CFLAGS="-DPy_REF_DEBUG" 
then the issue can be closed, and the documentation can be more explicit that 
the EXTRA_CFLAGS is to be used only for the special builds.

If the EXTRA_CFLAGS can also be used for adding our own flags, then the flag 
handling needs to change to take this into account.

[0] https://github.com/python/cpython/blob/master/setup.py#L85
[1] https://github.com/python/cpython/blob/master/Makefile.pre.in#L115
[2] https://github.com/python/cpython/blob/master/Makefile.pre.in#L97

--
nosy: +brett.cannon

___
Python tracker 

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



[issue38355] ntpath.realpath() fails on sys.executable

2019-10-02 Thread Steve Dower


New submission from Steve Dower :

The change to error handling did not include ERROR_CANT_ACCESS_FILE, but this 
error occurs in the Store package install.

After suppressing this error, it then occurs again when stripping the prefix - 
we should just check for the same error here to determine whether it's safe to 
remove the prefix of a file we can't access.

--
assignee: steve.dower
components: Windows
keywords: 3.8regression
messages: 353782
nosy: lukasz.langa, paul.moore, steve.dower, tim.golden, zach.ware
priority: release blocker
severity: normal
status: open
title: ntpath.realpath() fails on sys.executable
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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16138
pull_request: https://github.com/python/cpython/pull/16550

___
Python tracker 

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



[issue38355] ntpath.realpath() fails on sys.executable

2019-10-02 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, I managed to reproduce the bug using this change:

diff --git a/Lib/test/libregrtest/win_utils.py 
b/Lib/test/libregrtest/win_utils.py
index f0c17b906f..78429faa89 100644
--- a/Lib/test/libregrtest/win_utils.py
+++ b/Lib/test/libregrtest/win_utils.py
@@ -14,7 +14,7 @@ BUFSIZE = 8192
 LOAD_FACTOR_1 = 0.9200444146293232478931553241
 
 # Seconds per measurement
-SAMPLING_INTERVAL = 5
+SAMPLING_INTERVAL = 0
 # Windows registry subkey of HKEY_LOCAL_MACHINE where the counter names
 # of typeperf are registered
 COUNTER_REGISTRY_KEY = (r"SOFTWARE\Microsoft\Windows NT\CurrentVersion"


I wrote PR 16550 to handle partial lines.

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



[issue38356] test_asyncio: SubprocessThreadedWatcherTests leaks threads

2019-10-02 Thread STINNER Victor


New submission from STINNER Victor :

Warning seen o AMD64 Ubuntu Shared 3.x buildbot:
https://buildbot.python.org/all/#/builders/141/builds/2593

test_devnull_output 
(test.test_a=syncio.test_subprocess.SubprocessThreadedWatcherTests) ...
Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 
2)

The ThreadedChildWatcher class of asyncio.unix_events doesn't seem to have a 
method to join all threads. It should be done in tests to prevent "leaking" 
threads which can have side effects on following tests.

--
components: Tests, asyncio
messages: 353784
nosy: asvetlov, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: test_asyncio: SubprocessThreadedWatcherTests leaks threads
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



[issue38356] test_asyncio: SubprocessThreadedWatcherTests leaks threads

2019-10-02 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +pablogsal

___
Python tracker 

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



[issue37631] EXTRA_CFLAGS get overrided by CFLAGS_NODIST

2019-10-02 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Also this is due to an expected behaviour from gcc. From the documentation:

"If you use multiple -O options, with or without level numbers, the last such 
option is the one that is effective. "

--

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-10-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3e04cd268ee9a57f95dc78d8974b21a6fac3f666 by Victor Stinner in 
branch 'master':
bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line (GH-16550)
https://github.com/python/cpython/commit/3e04cd268ee9a57f95dc78d8974b21a6fac3f666


--

___
Python tracker 

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



[issue38351] Modernize email example from %-formatting to f-string

2019-10-02 Thread Fred L. Drake, Jr.


Fred L. Drake, Jr.  added the comment:

I agree that it's less invasive and easier to review.

My question (and it's just that) is whether we've made a decision to prefer one 
formatting syntax over others (outside of examples discussing the formatting 
approaches themselves).

If a decision is made to prefer one over others, it's worth making that 
decision separately, and then using separate PRs to deal with updates to 
different parts of the docs.

Added Julien Palard to the issue; I'd value input on this.

--
nosy: +JulienPalard

___
Python tracker 

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



[issue38318] Issues linking with ncurses and tinfo (cannot resolve symbols)

2019-10-02 Thread Michael Everitt


Michael Everitt  added the comment:

Attached patch seems to fix build failure for python2.7 with uclibc-ng.

--
keywords: +patch
Added file: 
https://bugs.python.org/file48639/fix-tinfo-probably-python-2_7.patch

___
Python tracker 

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



[issue38318] Issues linking with ncurses and tinfo (cannot resolve symbols)

2019-10-02 Thread Michael Everitt


Michael Everitt  added the comment:

Attached patch seems to fix build with python3.6 withh uclibc-ng.

Tested on x86_64 and ARMv6zk.

--
Added file: 
https://bugs.python.org/file48640/fix-tinfo-probably-python-3_6.patch

___
Python tracker 

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



[issue38351] Modernize email example from %-formatting to f-string

2019-10-02 Thread Kyle Stanley


Kyle Stanley  added the comment:

Welcome back from the OOOS break Mariatta!

> My question (and it's just that) is whether we've made a decision to prefer 
> one formatting syntax over others (outside of examples discussing the 
> formatting approaches themselves).

I agree that we should reach a consensus on the preferred string formatting 
style. However, there seems to be two separate questions here:

1) Should the code examples in the docs be updated to use f-strings?

2) Should ALL instances of the old string formatting be updated to use 
f-strings? This would affect every *.py; potentially leading to additional code 
churn, which adds clutter to the commit logs and git blame.

The first one is far less costly and has very minimal risk of breakage. The 
cost of updating every *.py to use f-strings is worth considering, but is 
significantly higher and has more potential consequences, especially for the 
regression tests. I'm personally in favor of updating the code examples first 
and discussing the second question in a python-dev thread due to the wide 
impact.

> If a decision is made to prefer one over others, it's worth making that 
> decision separately, and then using separate PRs to deal with updates to 
> different parts of the docs.

Once we reach a decision on the matter, I think this particular issue could 
serve as a great first PR for a new contributor to become familiar with the 
workflow, so it would be a good candidate for the "newcomer friendly" label. 
Most python users are well acquainted with string formatting. I wouldn't mind 
opening a PR to fix it myself, but I think that leaving it open for a new 
contributor to work on as an intro to the workflow would be far more beneficial.

Although there may be a benefit to use f-strings instead here, there's 
certainly no rush to have it completed in a short period of time. I would be in 
favor of having each PR address a single documentation file. This would help 
accelerate the review process and provide a valuable learning experience to a 
greater number of new contributors, in comparison to a single PR that updates 
every single code example in the docs.

--
nosy: +aeros167

___
Python tracker 

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



[issue38351] Modernize email example from %-formatting to f-string

2019-10-02 Thread Kyle Stanley


Kyle Stanley  added the comment:

> so it would be a good candidate for the "newcomer friendly" label

Never mind, just noticed this was already labeled as newcomer friendly. I only 
saw the "easy" label at first. (:

If consensus is reached for this, we can open a separate issue for addressing 
the other doc files, something along the lines of "Update code examples to use 
f-strings". As mentioned earlier I think it would be worth having each new 
contributor update all of the instances in a single *.rst in a PR, but it can 
be a single issue.

--

___
Python tracker 

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



[issue38356] test_asyncio: SubprocessThreadedWatcherTests leaks threads

2019-10-02 Thread Kyle Stanley


Kyle Stanley  added the comment:

I can try to work on fixing this.

--
nosy: +aeros167

___
Python tracker 

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



[issue19683] test_minidom has many empty tests

2019-10-02 Thread karl


karl  added the comment:

@zach.ware
@r.david.murray


So I was looking at that issue. There is a lot of work. 

I had a couple of questions, because there are different categories


# Empty tests for existing functions.

This seems to be straightforward as they would complete the module.

Example:
```python
def testGetAttributeNode(self): pass
```
https://github.com/python/cpython/blob/3e04cd268ee9a57f95dc78d8974b21a6fac3f666/Lib/test/test_minidom.py#L412

which refers to: `GetAttributeNode`
https://github.com/python/cpython/blob/3e04cd268ee9a57f95dc78d8974b21a6fac3f666/Lib/xml/dom/minidom.py#L765-L768
https://github.com/python/cpython/blob/3e04cd268ee9a57f95dc78d8974b21a6fac3f666/Lib/test/test_minidom.py#L285-L294



# Tests without any logical reference in the module.

This is puzzling because I'm not sure which DOM feature they should be testing.

For example:

```
def testGetAttrList(self):
pass
```

https://github.com/python/cpython/blob/3e04cd268ee9a57f95dc78d8974b21a6fac3f666/Lib/test/test_minidom.py#L383-L384


Or maybe this is just supposed to test Element.attributes returning a list of 
attributes, such as 
`NamedNodeMap [ def="ghi", jkl="mno"]` returned by a browser.


```
>>> import xml.dom.minidom
>>> from xml.dom.minidom import parse, Node, Document, parseString
>>> from xml.dom.minidom import getDOMImplementation
>>> dom = parseString("")
>>> el = dom.documentElement
>>> el.setAttribute("def", "ghi")
>>> el.setAttribute("jkl", "mno")
>>> el.attributes

```

or is it supposed to test something like 

```
>>> el.attributes.items()
[('def', 'ghi'), ('jkl', 'mno')]
```

This is slightly confusing. And the missing docstrings are not making it easier.



# Tests which do not really test the module(?)

I think for example about this, which is testing that `del` is working, but it 
doesn't have anything to do with the DOM. 

```
def testDeleteAttr(self):
dom = Document()
child = dom.appendChild(dom.createElement("abc"))

self.confirm(len(child.attributes) == 0)
child.setAttribute("def", "ghi")
self.confirm(len(child.attributes) == 1)
del child.attributes["def"]
self.confirm(len(child.attributes) == 0)
dom.unlink()
```

https://github.com/python/cpython/blob/3e04cd268ee9a57f95dc78d8974b21a6fac3f666/Lib/test/test_minidom.py#L285-L294

Specifically when there is a function for it: `removeAttribute`
https://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-6D6AC0F9 

which is tested just below that test.
https://github.com/python/cpython/blob/3e04cd268ee9a57f95dc78d8974b21a6fac3f666/Lib/test/test_minidom.py#L296-L305

so I guess these should be removed or do I miss something in the testing logic?




# Missing docstrings.

Both the testing module and the module lack a lot of docstrings.
Would it be good to fix this too, probably in a separate commit.



# DOM Level 2

So the module intent is to implement DOM Level 2.
but does that make sense in the light of 
https://dom.spec.whatwg.org/

Should minidom tries to follow the current DOM spec?

--
nosy: +karlcow

___
Python tracker 

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



[issue38351] Modernize email example from %-formatting to f-string

2019-10-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

I definitely think we should not modify any code in the stdlib just to switch 
to f-strings.

I think the code examples in the docs would benefit from a consistent style, 
and since f-strings are the least verbose way to format strings, I'd endorse 
using them except where .format or %-formatting is the point of the example.

I agree with Fred that hearing from Julien would be helpful.

--
nosy: +eric.smith

___
Python tracker 

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



[issue38342] ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata'

2019-10-02 Thread Dima Tisnek


Change by Dima Tisnek :


--
nosy: +Dima.Tisnek

___
Python tracker 

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



[issue38350] ./configure --with-pydebug should use -O0 rather than -Og

2019-10-02 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Do note though that if the -D_FORTIFY_SOURCE=2 hardening flag is used, the 
compilation will fail with an optimization level less than -Og.

Haven't tried yet with -D_FORTIFY_SOURCE=1 to see if it works with -O0.

--
nosy: +cstratak

___
Python tracker 

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



[issue38357] print adding extra bytes in hex above x7F

2019-10-02 Thread Artificial


New submission from Artificial :

Any hex str of value above \x7F causes an extra byte to printed.

--
files: Screenshot from 2019-10-02 20-31-50.png
messages: 353796
nosy: Artificial
priority: normal
severity: normal
status: open
title: print adding extra bytes in hex above x7F
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48641/Screenshot from 2019-10-02 
20-31-50.png

___
Python tracker 

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



[issue38351] Modernize email example from %-formatting to f-string

2019-10-02 Thread Kyle Stanley


Kyle Stanley  added the comment:

> I definitely think we should not modify any code in the stdlib just to switch 
> to f-strings.

Does this also apply to updating code to use f-strings in an area that's 
already being modified for a functional purpose? 

I agree that that we shouldn't update stdlib code for the sole purpose of 
switching to f-strings, but if a function or method is already being changed 
for another purpose, I don't think updating the formatting to use f-strings is 
an issue. This would probably have to be decided on a case-by-case basis though.

--

___
Python tracker 

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



[issue38350] ./configure --with-pydebug should use -O0 rather than -Og

2019-10-02 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Correction, not fail, just a ton of warnings. The same is true for 
-D_FORTIFY_SOURCE=1

--

___
Python tracker 

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



  1   2   >