[issue32782] memoryview & ctypes: incorrect itemsize for empty array

2019-07-15 Thread Eric Wieser


Eric Wieser  added the comment:

Pinging again, now that the patch has undergone a revision with some cleanup 
thanks to @skrah

--

___
Python tracker 

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



[issue37559] IDLE: Scrolling issues with code context shown

2019-07-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

'at least' means 'get something working, then consider expanding'.
The scrollwheel is tougher without built-in start/stop events equivalent to 
press/release.  We could, however, synthesize them.  But I want to start with 
mouse button, and it that works, consider keys next.

--

___
Python tracker 

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



[issue37602] nonzero fixer problem

2019-07-15 Thread 徐靖

New submission from 徐靖 :

An easy problem.
It seems like nonzero fixer can only fix definition, not usage. nonzero fixer 
cannot fix problems like below:
 a = 1
 a.__nonzero__()
And there are no cases of __nonzero__() usage in test cases from 
test_fixers.py.(all cases test only definition rename)
It might not be a bug, since in DOC it just says "rename", not "convert". (If 
it is not a bug, the doc must be considered to be kinds of confusing and should 
add additional description.)but adding this automatic transformation is really 
useful in my current work, so at least an optional fixer is needed for 2to3.
A fixer of __oct__(),__hex__() to oct(),hex() is also in need, but 2to3 lacks 
such fixer.

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 348002
nosy: shiyuchong
priority: normal
severity: normal
status: open
title: nonzero fixer problem
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I2: replace font/hightlight loop with notification and immediate change instead 
of a delay is a bugfix.

In testing PR 14675 for #37530 I discovered a bug.  'Show' always shows a 
single blank line, as if the top visible line were the top line of the file.  
One should not have to scroll to trigger the context calculation.  This exists 
now, prior to the new PR. If/when we add a hotkey (M4), once should be able to 
show, see context, and hide just by hitting hotkey twice.  Add

C3: Make 'Show' show the context for the current top visible line.

--

___
Python tracker 

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



[issue37530] IDLE: simplify, optimize, and clean up code context

2019-07-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

PR 14030 for #17535 (line numbers) also has code for 1. I want to merge this 
first, and fix-up the other.

Changing context font at the same time as the text font, instead of up to 1 
second later, eliminates a visual glitch and is a user-visible improvement.  
Ditto for highlight changes, although the situation is more complicated due to 
text recoloring (a separate issue).

--

___
Python tracker 

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



[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2019-07-15 Thread Ethan Furman


Change by Ethan Furman :


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

___
Python tracker 

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



[issue34443] enum repr should use __qualname__

2019-07-15 Thread Ethan Furman


Change by Ethan Furman :


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

___
Python tracker 

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



[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2019-07-15 Thread Ethan Furman


Change by Ethan Furman :


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



[issue7202] "python setup.py cmd --verbose" does not set verbosity

2019-07-15 Thread Giovanni Cappellotto


Giovanni Cappellotto  added the comment:

I took a stab at this, see attached PR.

I was able encode the first two cases described by @tarek, but not the first 
one because `_parse_command_opts` doesn't have visibility to the list of global 
options that have already been parsed.

Note:

I had to move `log.set_verbosity(self.verbose)` after the call to 
`_parse_command_opts` in order to correctly apply the verbosity level after all 
command options are parsed. I think there should be a better way to handle this 
case, maybe by creating a `verbose` setter that re-runs `log.set_verbosity` 
every time `verbose` value is updated.

--
nosy: +potomak

___
Python tracker 

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



[issue7202] "python setup.py cmd --verbose" does not set verbosity

2019-07-15 Thread Giovanni Cappellotto


Change by Giovanni Cappellotto :


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

___
Python tracker 

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



[issue37584] Multiple test failures with OSError: [Errno 84] Invalid or incomplete multibyte or wide character on ZFS with utf8only=on

2019-07-15 Thread Ezio Melotti

Ezio Melotti  added the comment:

I think Dimiter was able to fix most of the failures, except 
test_unicode_file_functions.
Yesterday during the sprints we were looking at it, and we did some tests using 
the following snippet:

import os
import unicodedata
upsilon_diaeresis_and_hook = "ϔ"

for form in ["NFC", "NFD", "NFKC", "NFKD"]:   
  unicode_filename = unicodedata.normalize(form, upsilon_diaeresis_and_hook)
  with open(unicode_filename, "w") as f: f.write(form)
  print("N:", ascii(unicode_filename))
  print([ascii(filename) for filename in os.listdir('.')])

On ext4 this creates 4 different files: ['\u03d4', '\u03d2\u0308', '\u03ab', 
'\u03a5\u0308']
On ZFS with utf8only=true (and I believe normalization=formD), only 2 files are 
created but each of the 4 filenames can be used to access either of the 2 files.
This is also the default behavior on Mac.

The test is already skipped on darwin 
(Lib/test/test_unicode_file_functions.py:120), and should be skipped for ZFS 
too (might depend on the exact flags used), however we weren't able to find a 
portable way to determine the filesystem and flags.

An alternative is to try creating the 4 files and skip the test if only 2 gets 
created and if all the names can be used to open these two files, however this 
might mask other failures.  Unless someone can come up with a better way to do 
this, I think this is the only option.

In addition, different filesystems that don't exhibit this behavior can be used 
on Mac, so the test shouldn't be skipped in those cases.

--
nosy: +serhiy.storchaka
stage:  -> test needed

___
Python tracker 

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



[issue7940] re.finditer and re.findall should support negative end positions

2019-07-15 Thread Ezio Melotti


Ezio Melotti  added the comment:

> Are there any real world examples which show the benefit of supporting 
> negative indices?

A common case is ignoring parentheses at the beginning/end, e.g.
>>> re.compile('[^,]+').findall('(foo,123,(),bar)')
['(foo', '123', '()', 'bar)']
>>> # ignore the surrounding ()
>>> re.compile('[^,]+').findall('(foo,123,(),bar)', 1, 15)
['foo', '123', '()', 'bar']
>>>
>>> # extract attributes from a tag (poc, doesn't handle all cases)
>>> re.compile('[^ ]+').findall('', 7, 
>>> 39)
['type="checkbox"', 'id="foo"', 'checked']

In both cases using -1 as endpos is simpler.

--
versions: +Python 3.9 -Python 3.5

___
Python tracker 

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



[issue37601] shutil.make_archive does not follow symlinks for zip archives

2019-07-15 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
type:  -> enhancement
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue37601] shutil.make_archive does not follow symlinks for zip archives

2019-07-15 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +giampaolo.rodola, tarek

___
Python tracker 

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



[issue37601] shutil.make_archive does not follow symlinks for zip archives

2019-07-15 Thread Kevin Teague


New submission from Kevin Teague :

Zip archives created with shutil.make_archive will not follow symlinks.

The shutil._make_zipfile uses os.walk:

for dirpath, dirnames, filenames in os.walk(base_dir)

os.walk has the followlinks parameter:

for dirpath, dirnames, filenames in os.walk(base_dir, followlinks=True)

Setting followlinks to True will include symlinks in a zip archive.

Could a followlinks parameter be added to shutil.make_archive?

--
components: Library (Lib)
messages: 347996
nosy: Kevin Teague
priority: normal
severity: normal
status: open
title: shutil.make_archive does not follow symlinks for zip archives
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



[issue37600] os.sched_getaffinity() is missing - module 'os' has no attribute 'sched_getaffinity'

2019-07-15 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Per the docs on the function group that includes os.sched_getaffinity ( 
https://docs.python.org/3/library/os.html#interface-to-the-scheduler ):

> These functions control how a process is allocated CPU time by the operating 
> system. They are only available on some Unix platforms. For more detailed 
> information, consult your Unix manpages.

> New in version 3.3.

> The following scheduling policies are exposed if they are supported by the 
> operating system.

OSX doesn't support these APIs, so Python on OSX won't have them.

--
nosy: +josh.r
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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-15 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

Thanks for the feedback.  I agree that putting the tests in regrtest is better. 
 I've made the following changes:

- the --pgo option now uses the shorter list of tests by default

- I added --pgo-extended as a regrtest option that enables the old behavior of 
running most of the tests.  I considered being more fancy and having named sets 
of different tests (like the -u option) but I think just the two options (fast 
or slow) is good enough.  I used "pgo-extended" because I think "fast" or 
"slow" is confusing (i.e. build is slower but hopefully resulting binary is 
faster).

- You can still pass an explicit list of tests if you use the --pgo option.  
That should avoid breaking builds like the Docker one.

- You can now configure the the PGO task using 'configure'.  I think that is 
cleaner than trying to modify the Makefile after the fact. e.g. 

   ./configure [...] --with-profile-task='-m test --pgo-extended'

--

___
Python tracker 

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



[issue37589] Missing dependences in the Makefile

2019-07-15 Thread Kyle Stanley


Kyle Stanley  added the comment:

Added twouters to the nosy list since he's the makefile expert according to 
https://devguide.python.org/experts/#miscellaneous.

--
nosy: +aeros167, twouters

___
Python tracker 

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



[issue37598] Don't use _ as a function name in logging documentation cookbook

2019-07-15 Thread Vinay Sajip


Vinay Sajip  added the comment:

The comment at the end of the "_ = ..." line indicates clearly that it's 
optional to do that, and I assume that any reader will realise that they can 
use any suitable variable name rather than "_". There's no particular 
"recommendation" to use "_" and cookbook recipes are generally regarded as 
starting points for one's own code, rather than being copied verbatim into 
production scenarios.

I specifically picked "_", despite knowing its other uses, because:

 * One use of "_" is as a function that does some form of translation on a 
passed string argument - language translation being the most common example - 
and this recipe is a very loose analogue of that type of usage
* A very brief notation assists readability because once you've looked at the 
"_" definition, you can use constructions like the one further down in the 
recipe.

Since "_" wasn't picked at random, I'd rather not change it - if people decide 
to use this recipe, it would be better for brevity and standardisation if "_" 
were to be used, IMO.

I don't believe the usage of "_" in interactive interpreter sessions is 
relevant to this cookbook recipe and shouldn't, in my opinion, cause confusion, 
any more than where the use of "_" for language translations is being explored 
in an interactive session.

In summary - please don't waste your time on this, though I appreciate the 
intent behind your suggestion - thanks.

--

___
Python tracker 

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



[issue37600] os.sched_getaffinity() is missing - module 'os' has no attribute 'sched_getaffinity'

2019-07-15 Thread wesinator


Change by wesinator <13hu...@gmail.com>:


--
title: sched_getaffinity() is missing - module 'os' has no attribute 
'sched_getaffinity' -> os.sched_getaffinity() is missing - module 'os' has no 
attribute 'sched_getaffinity'

___
Python tracker 

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



[issue37600] sched_getaffinity() is missing - module 'os' has no attribute 'sched_getaffinity'

2019-07-15 Thread wesinator


New submission from wesinator <13hu...@gmail.com>:

Python 3.7.4 macOS 10.14.5 (homebrew) 

According to https://docs.python.org/3/library/os.html#os.cpu_count , there is 
a method `os.sched_getaffinity()` 
(https://docs.python.org/3/library/os.html#os.sched_getaffinity)

Code to reproduce :
 - 
```
import os
len(os.sched_getaffinity(0))
```


Traceback (most recent call last):
  File "", line 1, in 
AttributeError: module 'os' has no attribute 'sched_getaffinity'

--
components: Library (Lib)
messages: 347991
nosy: wesinator
priority: normal
severity: normal
status: open
title: sched_getaffinity() is missing - module 'os' has no attribute 
'sched_getaffinity'
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



[issue37599] Remove a vague statement in documentation of Integer Objects

2019-07-15 Thread sgal


Change by sgal :


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

___
Python tracker 

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



[issue37599] Remove a vague statement in documentation of Integer Objects

2019-07-15 Thread Eric N. Vander Weele


Change by Eric N. Vander Weele :


--
nosy: +ericvw

___
Python tracker 

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



[issue37599] Remove a vague statement in documentation of Integer Objects

2019-07-15 Thread sgal


New submission from sgal :

In current Python document (3.7 - 3.9) there is such statement in documentation 
of Integer Objects:

The current implementation keeps an array of integer objects for all integers 
between ``-5`` and ``256``, when you create an int in that range you actually 
just get back a reference to the existing object. So it should be possible to 
change the value of ``1``.  I suspect the behaviour of Python in this case is 
undefined. :-)

The last sentence is vague. It is irresponsible to write "I suspect" in 
documentation. And as the statements ahead has already clarified the sense that 
this is "a current implementation", the last sentence should be removed.

--
assignee: docs@python
components: Documentation
messages: 347990
nosy: docs@python, sgal
priority: normal
severity: normal
status: open
title: Remove a vague statement in documentation of Integer Objects
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



[issue37522] http.cookies.SimpleCookie doesn't seem to be parsed using regulars

2019-07-15 Thread SilentGhost


Change by SilentGhost :


--
components: +Library (Lib) -Extension Modules
versions:  -Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue37598] Don't use _ as a function name in logging documentation cookbook

2019-07-15 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue37564] ArgumentParser should support bool type according to truth values

2019-07-15 Thread paul j3


paul j3  added the comment:

The use of `bool` as registry key only works because that object already exists 
as a builtin.  This amounts a form of shadowing, and sets a dangerous precedent.

type=bool

should work as documented at

https://docs.python.org/3/library/functions.html?highlight=bool#bool

even if that is not what a casual user would expect.

--

___
Python tracker 

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



[issue37519] Three inconsistent module attributes

2019-07-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

While some of these might be inconsistent (I haven't really looked at it 
thoroughly yet), I think it might be problematic to change them at this point, 
since there's no doubt code out there that depends on the current behavior.

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-07-15 Thread Tal Einat


Change by Tal Einat :


--
nosy:  -taleinat

___
Python tracker 

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



[issue37519] Three inconsistent module attributes

2019-07-15 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +eric.smith

___
Python tracker 

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



[issue37521] importlib examples have their exec_module()/sys.modules assignment lines reversed

2019-07-15 Thread Brett Cannon


Brett Cannon  added the comment:

I'm not sure why you think importlib.util.module_from_spec() adds a module to 
sys.modules? 
https://docs.python.org/3/library/importlib.html#importlib.util.module_from_spec
 doesn't say that nor does 
https://github.com/python/cpython/blob/master/Lib/importlib/_bootstrap.py#L549 
actually do that.

--

___
Python tracker 

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



[issue19696] Merge all (non-syntactic) import-related tests into test_importlib

2019-07-15 Thread Brett Cannon


Change by Brett Cannon :


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



[issue34160] ElementTree not preserving attribute order

2019-07-15 Thread Diego Rojas


Diego Rojas  added the comment:

Victor, you mean place again this code? 
https://github.com/python/cpython/pull/10163/files#diff-d5a064acb6ae44dcb7e01fee148c733dR926

And the recipe proposed in https://bugs.python.org/issue34160#msg338102 place 
it as a method of ElementTree or just as a helper function?

--

___
Python tracker 

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



[issue37577] ModuleNotFoundError: No module named '_sysconfigdata__linux_x86_64-linux-gnu'

2019-07-15 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +doko

___
Python tracker 

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



[issue35224] PEP 572: Assignment Expressions

2019-07-15 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

I might be missing it, but I think the Language Reference still doesn't 
document assignment expressions.

https://docs.python.org/3/reference/lexical_analysis.html#operators

There are likely other places in the LR that need to be filled out with PEP 572 
documentation.

--
nosy: +barry

___
Python tracker 

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



[issue37598] Don't use _ as a function name in logging documentation cookbook

2019-07-15 Thread Andrew Carter


New submission from Andrew Carter :

Current docs link: 
https://docs.python.org/3/howto/logging-cookbook.html#implementing-structured-logging

GitHub commit link: 
https://github.com/python/cpython/commit/4b88d6c6642450240a9dc22e6efbdc69baf890dd

The suggestion is that for structured logging, a StructuredMessage class should 
be created with a __str__ method defined and then assigned to an _ variable and 
used as a logging formatter.

As the _ variable is commonly used as a "skip variable" and it has other 
meanings inside the Python interactive shell - I recommend that this example is 
changed to one that maybe just defines a simple wrapper function.

I'm happy to create a PR for this - but only if there's agreement that it's 
worthwhile and will get merged if suitable.

Thanks,

Andrew

--
assignee: docs@python
components: Documentation
messages: 347984
nosy: AndrewCarterUK, docs@python
priority: normal
severity: normal
status: open
title: Don't use _ as a function name in logging documentation cookbook
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



[issue37565] test_faulthandler: test_register_chain() crash with SIGSEGV (signal 11) on Skylake chipset

2019-07-15 Thread Michelle Johnson


Michelle Johnson  added the comment:

Oh, ok.  So, it doesn't seem like trying to get the contents of op was 
successful:

(gdb) print *op
$1 = {ob_refcnt = 0, ob_type = 0x0}
(gdb) print *op->ob_type
Cannot access memory at address 0x0
(gdb)


I then followed your instructions to recompile in debug mode and retried the 
script.  Here are the results:

[jshelly@gl-build Python-3.7.4]$ ./python ~/script.py
Current thread 0x2ab43fe0d400 (most recent call first):
  File "/home/jshelly/script.py", line 12 in 
called True
[jshelly@gl-build Python-3.7.4]$

Does that help at all?

--

___
Python tracker 

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



[issue37547] Add _PyObject_CallMethodOneArg()

2019-07-15 Thread Zackery Spytz


Zackery Spytz  added the comment:

It seems that 59ad110d7a7784d53d0b502eebce0346597a6bef introduced a compiler 
warning in Modules/_io/winconsoleio.c.

c:\projects\cpython\modules\_io\winconsoleio.c(208): warning C4133: 'function': 
incompatible types - from 'winconsoleio *' to 'PyObject *' 
[C:\projects\cpython\PCbuild\pythoncore.vcxproj]

PR 14785 fixes this.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue33955] Implement PyOS_CheckStack on macOS using pthread_get_stack*_np

2019-07-15 Thread Zackery Spytz


Zackery Spytz  added the comment:

It seems that this issue is a duplicate of bpo-25518.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue37547] Add _PyObject_CallMethodOneArg()

2019-07-15 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +14582
pull_request: https://github.com/python/cpython/pull/14785

___
Python tracker 

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



[issue37597] audit event table breaks PDF sphinx build

2019-07-15 Thread Julien Palard


New submission from Julien Palard :

The following commit:

44f91c388a6f4da9ed3300df32ca290b8aa104ea
bpo-37390: Add audit event table to documentations (GH-14406)

Also updates some (unreleased) event names to be consistent with the others.

breaks PDF builds.

Reproductible using:

(cd Doc; sphinx-build -b latex -d build/doctrees -D 
latex_elements.papersize=a4 -D latex_engine=xelatex -D latex_elements.inputenc= 
-D latex_elements.fontenc=usepackage{xeCJK} -Ea -A daily=1 -A switchers=1  
. build/latex)

The exception raised is "NoUri", I patched sphinx [1] to add a few info, so it 
is a "sphinx.errors.NoUri: c-api/code".



[1]: https://github.com/sphinx-doc/sphinx/pull/6583/files

--
messages: 347980
nosy: christian.heimes, mdk, steve.dower
priority: normal
severity: normal
status: open
title: audit event table breaks PDF sphinx build

___
Python tracker 

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



[issue37565] test_faulthandler: test_register_chain() crash with SIGSEGV (signal 11) on Skylake chipset

2019-07-15 Thread STINNER Victor


STINNER Victor  added the comment:

Oh. So Py_FinalizeEx() does get a SIGSEGV when triggering a garbage collection: 
the test doesn't crash, it's Python which crash at exit.

> Program received signal SIGSEGV, Segmentation fault.
> 0x2ae88924 in visit_decref (op=0x2acd3468, data=0x0) at 
> Modules/gcmodule.c:271
> 271   if (PyObject_IS_GC(op)) {

You can try to dump the content of op? For example:

(gdb) print *op
(gdb) print *op->ob_type


Can you try to rebuild Python from source in debug mode, and then retry the 
script? Something like:
---
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
tar -xf Python-3.7.4.tar.xz 
cd Python-3.7.4/
./configure --with-pydebug --prefix /opt/py37
make
./python script.py
# no need to install Python
---

If it works, maybe retry without --with-pydebug.

--

___
Python tracker 

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



[issue37565] test_faulthandler: test_register_chain() crash with SIGSEGV (signal 11) on Skylake chipset

2019-07-15 Thread STINNER Victor


STINNER Victor  added the comment:

My notes to debug a crash on a GC collection:
https://pythondev.readthedocs.io/debug_tools.html#debug-crash-in-garbage-collection-visit-decref

--

___
Python tracker 

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



[issue37565] test_faulthandler: test_register_chain() crash with SIGSEGV (signal 11) on Skylake chipset

2019-07-15 Thread Michelle Johnson


Michelle Johnson  added the comment:

1.  Here is the output of the signal.getsignal test:

[jshelly@gl-build bin]$ ./python3
Python 3.7.4 (default, Jul 15 2019, 10:08:37)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal
>>> signal.getsignal(signal.SIGUSR1)


2.  Here is the output after running the provided script in gdb:

[jshelly@gl-build bin]$ gdb -args ./python3 ~/script.py
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /sw/arcts/centos7/python/3.7.4/bin/python3.7...done.
(gdb) handle SIGUSR1 nostop
SignalStop  Print   Pass to program Description
SIGUSR1   NoYes Yes User defined signal 1
(gdb) run
Starting program: /sw/arcts/centos7/python/3.7.4/bin/./python3 
/home/jshelly/script.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGUSR1, User defined signal 1.
Current thread 0x2aaf59c0 (most recent call first):
  File "/home/jshelly/script.py", line 12 in 

Program received signal SIGUSR1, User defined signal 1.
called True

Program received signal SIGSEGV, Segmentation fault.
0x2ae88924 in visit_decref (op=0x2acd3468, data=0x0) at 
Modules/gcmodule.c:271
271 if (PyObject_IS_GC(op)) {
Missing separate debuginfos, use: debuginfo-install 
glibc-2.17-260.el7_6.3.x86_64 nss-softokn-freebl-3.36.0-5.el7_5.x86_64
(gdb) where
#0  0x2ae88924 in visit_decref (op=0x2acd3468, data=0x0) at 
Modules/gcmodule.c:271
#1  0x2ad92d8d in dict_traverse (op=, 
visit=0x2ae88920 , arg=0x0) at Objects/dictobject.c:2987
#2  0x2ae87b3d in subtract_refs (containers=) at 
Modules/gcmodule.c:296
#3  collect (generation=generation@entry=2, 
n_collected=n_collected@entry=0x7fffce20,
n_uncollectable=n_uncollectable@entry=0x7fffce28, 
nofail=nofail@entry=0) at Modules/gcmodule.c:853
#4  0x2ae891c9 in collect_with_callback (generation=2) at 
Modules/gcmodule.c:1028
#5  PyGC_Collect () at Modules/gcmodule.c:1573
#6  0x2ae5e62a in Py_FinalizeEx () at Python/pylifecycle.c:1185
#7  0x2ae86d58 in pymain_main (pymain=pymain@entry=0x7fffcf60) at 
Modules/main.c:3030
#8  0x2ae874e9 in _Py_UnixMain (argc=, argv=) at Modules/main.c:3063
#9  0x2bd843d5 in __libc_start_main () from /lib64/libc.so.6
#10 0x0040067e in _start ()
(gdb)

--

___
Python tracker 

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



[issue34788] ipaddress module fails on rfc4007 scoped IPv6 addresses

2019-07-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

FWIW: Marking Component: Documentation means that the issue is only about 
changing the doc.  Hence the auto-assignment to the nebulous docs group, which 
no longer exists in the form it once did.  Enhancement issues nearly always 
need a doc change but are not marked 'Documentation'.  I am not sure what 
Jeremy's original intent was, but the actual PR is mostly code implementing and 
testing the newly documented addition.

--
assignee: docs@python -> 
components:  -Documentation
nosy: +terry.reedy -docs@python
type: behavior -> enhancement
versions: +Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 
3.8

___
Python tracker 

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



[issue37565] test_faulthandler: test_register_chain() crash with SIGSEGV (signal 11) on Skylake chipset

2019-07-15 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_faulthandler: test_register_chain() crash on Skylake chipset -> 
test_faulthandler: test_register_chain() crash with SIGSEGV (signal 11) on 
Skylake chipset

___
Python tracker 

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



[issue37565] test_faulthandler: test_register_chain() crash on Skylake chipset

2019-07-15 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_faulthandler failure -> test_faulthandler: test_register_chain() 
crash on Skylake chipset

___
Python tracker 

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



[issue37565] test_faulthandler failure

2019-07-15 Thread STINNER Victor


STINNER Victor  added the comment:

More tests.

(*) What is the output of signal.getsignal(signal.SIGUSR1) before importing 
faulthandler (before calling any faulthandler method)? Example:

$ python3
Python 3.7.3 (default, May 11 2019, 00:38:04) 
>>> import signal; signal.getsignal(signal.SIGUSR1)


(*) Can you try to run attached script in gdb? If you get a crash, type "where" 
to get the traceback. Example:

$ gdb -args ./python script.py 
(gdb) handle SIGUSR1 nostop
SignalStop  Print   Pass to program Description
SIGUSR1   NoYes Yes User defined signal 1

(gdb) run
Starting program: /home/vstinner/python/master/python script.py

Program received signal SIGUSR1, User defined signal 1.
Current thread 0x77c27740 (most recent call first):
  File "/home/vstinner/python/master/script.py", line 13 in 

Program received signal SIGUSR1, User defined signal 1.
called True
[Inferior 1 (process 24361) exited normally]

--
Added file: https://bugs.python.org/file48485/script.py

___
Python tracker 

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



[issue37468] Don't install wininst*.exe on non-Windows platforms

2019-07-15 Thread STINNER Victor


STINNER Victor  added the comment:

I sent a notice to python-dev about this change. If someone considers that my 
change is wrong on Cygwin or MinGW, please propose a pull request.
https://mail.python.org/archives/list/python-...@python.org/thread/53T647PT4F5QZ5NOX2GDLMMPC5EPJY4Y/

In the meanwhile, I close the issue. Thanks for the review Paul Ganssle!

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



[issue37468] Don't install wininst*.exe on non-Windows platforms

2019-07-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e8692818afd731c1b7e925c626ac8200b1f1c31e by Victor Stinner in 
branch 'master':
bpo-37468: make install no longer install wininst-*.exe files (GH-14511)
https://github.com/python/cpython/commit/e8692818afd731c1b7e925c626ac8200b1f1c31e


--

___
Python tracker 

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



[issue37538] Refactor zipfile to ease subclassing and enhancement

2019-07-15 Thread Daniel Hillier


Daniel Hillier  added the comment:

Hi,

Here is a pull request against my fork:

https://github.com/danifus/cpython/pull/1/files

The overall behaviour of zipfile remains the same and I've tried to call out 
any behaviour changes in the extended commit messages (usually with ** markers).

There is another branch 
(https://github.com/danifus/cpython/tree/zipfile_refactor_2) which has a couple 
of extra commits which slightly changes some functionality.

Any review would be greatly appreciated! Happy to make any changes to the code 
or general approach taken.

Thanks,
Dan

--

___
Python tracker 

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



[issue29708] support reproducible Python builds

2019-07-15 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-37596 "Reproducible pyc: frozenset is not serialized in a 
deterministic order".

--

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2019-07-15 Thread STINNER Victor


New submission from STINNER Victor :

See bpo-29708 meta issue and https://reproducible-builds.org/ for reproducible 
builds.

pyc files are not fully reproducible yet: frozenset items are not serialized in 
a deterministic order

One solution would be to modify marshal to sort frozenset items before 
serializing them. The issue is how to handle items which cannot be compared. 
Example:

>>> l=[float("nan"), b'bytes', 'unicode']
>>> l.sort()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: '<' not supported between instances of 'bytes' and 'float'

One workaround for types which cannot be compared is to use the type name in 
the key used to compare items:

>>> l.sort(key=lambda x: (type(x).__name__, x))
>>> l
[b'bytes', nan, 'unicode']

Note: comparison between bytes and str raises a BytesWarning exception when 
using python3 -bb.

Second problem: how to handle exceptions when comparison raises an error anyway?


Another solution would be to use the PYTHONHASHSEED environment variable. For 
example, if SOURCE_DATE_EPOCH is set, PYTHONHASHSEED would be set to 0. This 
option is not my favorite because it disables a security fix against denial of 
service on dict and set:
https://python-security.readthedocs.io/vuln/hash-dos.html

--

Previous discussions on reproducible frozenset:

* https://mail.python.org/pipermail/python-dev/2018-July/154604.html
* https://bugs.python.org/issue34093#msg321523

See also bpo-34093: "Reproducible pyc: FLAG_REF is not stable" and PEP 552 
"Deterministic pycs".

--
components: Interpreter Core
messages: 347969
nosy: vstinner
priority: normal
severity: normal
status: open
title: Reproducible pyc: frozenset is not serialized in a deterministic order
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



[issue34093] Reproducible pyc: FLAG_REF is not stable.

2019-07-15 Thread STINNER Victor


STINNER Victor  added the comment:

> According to Serhiy Storchaka, currently marshal.dumps() writes frozenset in 
> arbitrary order, and so frozenset serialization is not reproducible: 
> https://mail.python.org/pipermail/python-dev/2018-July/154604.html

I created bpo-37596 "Reproducible pyc: frozenset is not serialized in a 
deterministic order" to track this issue.

--

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() needs refresh

2019-07-15 Thread Michael Felt


Michael Felt  added the comment:

On 14/07/2019 22:28, Tal Einat wrote:
> Tal Einat  added the comment:
>
>>> The current code and proposed changes use 'netstat -ia' to find the node 
>>> however if netstat needs to perform a reverse DNS query to resolve some 
>>> interfaces this makes using uuid1 *really* slow especially when reverse DNS 
>>> queries aren't set up correctly or timeout.
>>>mac = _find_mac_netstat('netstat', '-ia', b'Address', lambda i: i)
>>>
>>> Would it be possible to change the netstat call to add 'n' to the nestat 
>>> options, i.e. _find_mac_netstat('netstat', '-ian', ...) to prevent netstat 
>>> from attempting to resolve addresses?
>> Sounds like an excellent idea. Gives me a reason to get started again. Thx!
> I don't see this in PR GH-28009; should this change be made?
I am testing with "-ian" - on top of the changes you have already made.
I'll push asap, assuming all goes well.
>
> --
> nosy: +taleinat
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue37284] Not obvious that new required attrs of sys.implementation must have a PEP.

2019-07-15 Thread Eric Snow


Eric Snow  added the comment:

@potomak, thanks for doing this!

--

___
Python tracker 

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



[issue37284] Not obvious that new required attrs of sys.implementation must have a PEP.

2019-07-15 Thread Eric Snow


Change by Eric Snow :


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



[issue37284] Not obvious that new required attrs of sys.implementation must have a PEP.

2019-07-15 Thread miss-islington


miss-islington  added the comment:


New changeset 1ff4c4277421c02df5ca0894fb95de70cd9cd5f4 by Miss Islington (bot) 
in branch '3.8':
bpo-37284: Add note to sys.implementation doc (GH-14328)
https://github.com/python/cpython/commit/1ff4c4277421c02df5ca0894fb95de70cd9cd5f4


--

___
Python tracker 

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



[issue37284] Not obvious that new required attrs of sys.implementation must have a PEP.

2019-07-15 Thread miss-islington


miss-islington  added the comment:


New changeset 134f79682d6729e3cf84b665d615f576075550e8 by Miss Islington (bot) 
in branch '3.7':
bpo-37284: Add note to sys.implementation doc (GH-14328)
https://github.com/python/cpython/commit/134f79682d6729e3cf84b665d615f576075550e8


--

___
Python tracker 

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



[issue37284] Not obvious that new required attrs of sys.implementation must have a PEP.

2019-07-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14581
pull_request: https://github.com/python/cpython/pull/14784

___
Python tracker 

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



[issue37284] Not obvious that new required attrs of sys.implementation must have a PEP.

2019-07-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14580
pull_request: https://github.com/python/cpython/pull/14783

___
Python tracker 

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



[issue30140] Binary arithmetic does not always call subclasses first

2019-07-15 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



[issue37284] Not obvious that new required attrs of sys.implementation must have a PEP.

2019-07-15 Thread miss-islington


miss-islington  added the comment:


New changeset 52693c10e82622d883433b779a45d0bd792f17ed by Miss Islington (bot) 
(Giovanni Cappellotto) in branch 'master':
bpo-37284: Add note to sys.implementation doc (GH-14328)
https://github.com/python/cpython/commit/52693c10e82622d883433b779a45d0bd792f17ed


--
nosy: +miss-islington

___
Python tracker 

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



[issue30140] Binary arithmetic does not always call subclasses first

2019-07-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Are there any core devs who care enough to make a decision here?

--

___
Python tracker 

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



[issue37565] test_faulthandler failure

2019-07-15 Thread Michelle Johnson


Michelle Johnson  added the comment:

Hello Victor.  Thank you for looking into this.  I ran the attached script, 
sigusr1.py as you requested.  The output was as expected:

[jshelly@gl-build bin]$ ./python3.7 ~/sigusr1.py
called True

Not sure if that helps identify the problem.  Regarding the related bugs I 
mentioned, I think my first comments were mixed up.  There were 2 possibly 
related bugs.

1.  Redhat bugzilla 1687171, which may have been related to the skylake 
chipset: https://bugzilla.redhat.com/show_bug.cgi?id=1687171 

2.  Github # 32:  https://github.com/vstinner/faulthandler/issues/32
That is an older one (2017), and maybe not related.

Bug # 36 at Github is one that I opened initially, and that one is a duplicate 
of this bug report. It is closed now as I was asked to open the bug here 
instead.

Thanks for any further insight or suggestions you can provide.

--

___
Python tracker 

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



[issue37555] _CallList.__contains__ doesn't always respect ANY.

2019-07-15 Thread Paul Ganssle


Paul Ganssle  added the comment:

Maybe I am missing something, but while it is true that DjangoModel is doing 
the wrong thing by returning False instead of NotImplemented, the `ANY` 
sentinel is supposed to match *anything*, not just things that compare equal to 
it, right? I would expect this to work, for example:

  class EqualsNothing:
def __eq__(self, other):
return False

  m = Mock(spec_set=EqualsNothing)
  obj = EqualsNothing()
  m(obj)
  m.assert_has_calls([call(ANY)])

In that example, it is deliberate that EqualsNothing returns False for any 
type, but ANY should still match it. I think maybe the solution here is to 
special-case the matching with ANY so the criterion for a call matching would 
be `y is ANY or x == y`.

--
nosy: +p-ganssle

___
Python tracker 

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



[issue37519] Three inconsistent module attributes

2019-07-15 Thread Géry

Change by Géry :


--
nosy: +eric.snow -eric.smith

___
Python tracker 

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



[issue37519] Three inconsistent module attributes

2019-07-15 Thread Géry

Géry  added the comment:

@Brett Cannon

> PEPs actually become historical documents once they are implemented

Actually the inconsistency of the values of the 3 module attributes 
(``__file__``, ``__cached__`` and ``__package__``) is with respect to the other 
values within the current implementation (not only with respect to the values 
specified in PEP 451). Sorry if I did not explain this well. Let me detail:

For ``__file__``, if you look at the current output of the above "Imported 
modules" section, you have:

- __file__: None, for an imported namespace package;
- __file__: 'not set', for an imported built-in module;
- __file__: 'not set', for an imported frozen module,

which is inconsistent: it should always be 'not set' when ``__file__`` has no 
meaning.

For ``__cached__``, if you look at the current output of the above "Run 
modules" section, you have:

- __cached__: None, for a non-package module run from the file system 
(``python3 module.py``) or run from standard input (``cat module.py | 
python3``);
- __path__: 'not set', for a non-package module run from the file system 
(``python3 module.py``) or run from standard input (``cat module.py | 
python3``),

which is inconsistent: it should always be 'not set' when ``__cached__`` has no 
meaning, like it is already the case for ``__path__`` and other module 
attributes.

For ``__package__``, if you look at the current output of the above "Run 
modules" section, you have:

- __package__: None, for a non-package module run from the file system 
(``python3 module.py``) or run from standard input (``cat module.py | 
python3``);
- __package__: '', for a non-package module run from the module namespace 
(``python3 -m module``) or a package run from the file system (``python3 
module/``).

which is inconsistent: it should always be ``''`` when there is no parent 
package for ``__package__`` to refer to.

--

___
Python tracker 

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



[issue37562] PEP 590 implementation may have introduced a performance regression

2019-07-15 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

PR 14782 (backport of PR 13781) fixes the regression for me.

--

___
Python tracker 

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



[issue37562] PEP 590 implementation may have introduced a performance regression

2019-07-15 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


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



[issue36974] Implement PEP 590

2019-07-15 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
pull_requests: +14578
pull_request: https://github.com/python/cpython/pull/14782

___
Python tracker 

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



[issue37562] PEP 590 implementation may have introduced a performance regression

2019-07-15 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
pull_requests: +14579
pull_request: https://github.com/python/cpython/pull/14782

___
Python tracker 

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



[issue7940] re.finditer and re.findall should support negative end positions

2019-07-15 Thread M. Anil Tuncel


M. Anil Tuncel  added the comment:

I guess the use of negative indices serve the same purpose here as in lists or 
strings. 
Though as Ezio pointed out, the current behaviour is already accepting negative 
indices but providing inconsistent results in comparison to various other 
Python modules that support negative indices.

In my opinion:
If the negative indices are to be used here (which is what the current 
implementation suggests), they should behave in the same way as the rest of the 
Python modules. 
Otherwise, perhaps negative indices should not be allowed here at all. 

What do you think?

P.S. this patch is already applied to the regex module by @mrabarnett

--
nosy: +anilbey

___
Python tracker 

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



[issue37522] http.cookies.SimpleCookie doesn't seem to be parsed using regulars

2019-07-15 Thread MeiK


Change by MeiK :


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

___
Python tracker 

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



[issue37562] PEP 590 implementation may have introduced a performance regression

2019-07-15 Thread STINNER Victor


STINNER Victor  added the comment:

> can we backport more of the PEP 590 commits to 3.8? Or will the release 
> manager complain?

I would opt for a case by case discussion. Would you be able to identify which 
master commits have the most significant impact on performance for builtin 
functions?

--
nosy: +vstinner

___
Python tracker 

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



[issue37562] PEP 590 implementation may have introduced a performance regression

2019-07-15 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

I did some benchmarks WITHOUT PGO (simply because it's much faster to compile 
and therefore easier to test things out).

The command I used for testing is
./python -m perf timeit --duplicate 200 -s 'f = len; x = ()' 'f(x)'

* d30da5dd9a8a965cf24a22bbaff8a5b1341c2944 (before PEP 590)
  Mean +- std dev: 25.1 ns +- 0.2 ns
* aacc77fbd77640a8f03638216fa09372cc21673d (first commit of PEP 590)
  Mean +- std dev: 29.3 ns +- 0.9 ns
* b8e198a5d09ca876b87baaf6efd2b2e7c9e3a0b3 (3.8 branch)
  Mean +- std dev: 29.5 ns +- 0.3 ns
* cd6e83b4810549c308ab2d7315dbab526e35ccf6 (master)
  Mean +- std dev: 25.1 ns +- 0.2 ns

So there does seem to be a regression with 3.8 but not with 3.9. I don't know 
what to do with this... can we backport more of the PEP 590 commits to 3.8? Or 
will the release manager complain?

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-07-15 Thread STINNER Victor


STINNER Victor  added the comment:

Other examples of projects broken by this change:
* python-glyphsLib: https://bugzilla.redhat.com/show_bug.cgi?id=1705391
* pcs: https://bugzilla.redhat.com/show_bug.cgi?id=1705475

What's New In Python 3.8 only briefly mention this change:
"The writexml(), toxml() and toprettyxml() methods of the xml.dom.minidom 
module, and xml.etree now preserve the attribute order specified by the user. 
(Contributed by Diego Rojas and Raymond Hettinger in bpo-34160.)"
https://docs.python.org/dev/whatsnew/3.8.html#changes-in-the-python-api

Would it be possible to suggest solutions for this backward incompatible 
change? Like https://bugs.python.org/issue34160#msg338102 recipe. Maybe we 
should even put it in the XML documentation, somewhere.

--

___
Python tracker 

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



[issue37559] IDLE: Scrolling issues with code context shown

2019-07-15 Thread Tal Einat


Tal Einat  added the comment:

> I *like* the CC size changes because the size indicates the indent depth.

My feeling is that you would be in a minority here.  IMO most new/novice users 
would find this surprising and confusing, since it is far from a customary UI 
experience.  Since our opinions obviously differ rather greatly on this, I 
suggest that we try to be objective and get some opinions from other users.

> The scrollbar slider bobble does not bother me much when scrolling with key 
> or mouse wheel because I hardly see it.  My eyes are focused on the text.

On Windows, when scrolling with a mouse scroll wheel or a trackpad, I find that 
this makes scrolling rather inconsistent, since it will scroll more or less 
lines depending on the change in the number of context lines.

> Another possible solution is suppressing CC update at least while the mouse 
> button is held down over the scrollbar.  Button down/up on the scrollbar 
> instance sets text.pause_CC to True/False and CC update checks 
> self.text.pauseCC.

I also see artifacts and scrollbar "jitter" when scrolling with a mouse wheel 
or trackpad, so IMO that wouldn't be a thorough enough solution.

--

___
Python tracker 

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



[issue35121] [CVE-2018-20852] Cookie domain check returns incorrect results

2019-07-15 Thread STINNER Victor


Change by STINNER Victor :


--
title: [ CVE-2018-20852] Cookie domain check returns incorrect results -> 
[CVE-2018-20852] Cookie domain check returns incorrect results

___
Python tracker 

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



[issue35121] [ CVE-2018-20852] Cookie domain check returns incorrect results

2019-07-15 Thread STINNER Victor


Change by STINNER Victor :


--
title: Cookie domain check returns incorrect results -> [ CVE-2018-20852] 
Cookie domain check returns incorrect results

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-15 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file48484/reproducer2.py

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-15 Thread STINNER Victor


STINNER Victor  added the comment:

>>> bytes([0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 
>>> 0x65, 0x3a, 0x78, 0x3b, 0x61, 0x72, 0x1b, 0x2a, 0x3d, 0x22, 0x73, 0x4f, 
>>> 0x27, 0x23, 0x61, 0xff, 0xff, 0x27, 0x5c, 0x22])
b'Content-Type:x;ar\x1b*="sO\'#a\xff\xff\'\\"'

The following loop of Lib/email/_header_value_parser.py does never stop:

def get_parameter(value):
""" attribute [section] ["*"] [CFWS] "=" value

The CFWS is implied by the RFC but not made explicit in the BNF.  This
simplified form of the BNF from the RFC is made to conform with the RFC BNF
through some extra checks.  We do it this way because it makes both error
recovery and working with the resulting parse tree easier.
"""
...
if remainder is not None:
...
while value:
...

Attached reproducer.py is code from initial msg346953.

reproducer2.py simplify the input and calls directly get_parameter(). 
Simplified input string:

   r*="'a'\"

--
nosy: +vstinner
Added file: https://bugs.python.org/file48483/reproducer.py

___
Python tracker 

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



[issue30140] Binary arithmetic does not always call subclasses first

2019-07-15 Thread Leonard Lausen


Change by Leonard Lausen :


--
nosy: +leezu

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-15 Thread STINNER Victor


Change by STINNER Victor :


--
type: crash -> security

___
Python tracker 

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



[issue37500] 3.8.0b2 no longer optimizes away "if 0:" ?

2019-07-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14576
pull_request: https://github.com/python/cpython/pull/14780

___
Python tracker 

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



[issue37500] 3.8.0b2 no longer optimizes away "if 0:" ?

2019-07-15 Thread miss-islington


miss-islington  added the comment:


New changeset 18c5f9d44dde37c0fae5585a604c6027825252d2 by Miss Islington (bot) 
(Pablo Galindo) in branch 'master':
bpo-37500: Make sure dead code does not generate bytecode but also detect 
syntax errors (GH-14612)
https://github.com/python/cpython/commit/18c5f9d44dde37c0fae5585a604c6027825252d2


--

___
Python tracker 

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



[issue35121] Cookie domain check returns incorrect results

2019-07-15 Thread Riccardo Schirone


Riccardo Schirone  added the comment:

CVE-2018-20852 has been assigned to this flaw.

--

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-15 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

See also 
https://github.com/python/cpython/pull/14193#pullrequestreview-251630953

--
nosy: +jdemeyer

___
Python tracker 

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