[issue32388] Remove cross-version binary compatibility

2018-03-03 Thread Stefan Behnel

Stefan Behnel  added the comment:

I'm ok with "removing" this "guarantee" (although it seems too late to apply 
this specific change to 3.7 now).

While Cython users do ask for a way to build cross-version binaries from time 
to time, it's neither supported nor planned, and the underlying problem is IMHO 
solved better via tooling like the manylinux wheel build.

I also generally consider it good to let user code take advantage of new 
features in new CPython releases, even if it means that they need to 
retranslate their Cython code from time to time. The 1.5 years release cycle of 
CPython should exceed that of most "still in maintenance" extension modules out 
there, and it's long enough to not impose a real burden on their maintainers.

--

___
Python tracker 

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



[issue32990] Supporting extensible format(PCM) for wave.open(read-mode)

2018-03-03 Thread Andrea Celletti

New submission from Andrea Celletti :

The wave.Wave_read class currently supports 8, 16, 24, and 32 bit PCM files.
Wave files are only supported if the wFormatTag in the format chunk matches the 
flag WAVE_FORMAT_PCM, which is correct but incomplete for 24 bit files.

According to the specification the WAVE_FORMAT_EXTENSIBLE format should be used 
whenever the actual number of bits/sample is not equal to the container size. 
Based on this specification, most applications export 24 bit PCM with the 
WAVE_FORMAT_EXTENSIBLE flag since 24 is stored in container size 32. 
Importing these files causes wave.open to raise an exception.

The specification also explains how to detect 24PCM exported in this fashion as 
"The first two bytes of the GUID form the sub-code specifying the data format 
code, e.g. WAVE_FORMAT_PCM.". In essence, we have to look at the first two 
bytes of the SubFormat tag and that will tell us if this file is PCM.

Based on this premise, it appears to me that there is no reason for not adding 
support for both format specification as the rest of the file is exactly the 
same for both.

I am attaching a file that can be used to test the exception being raised.

Source: http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html

--
components: Library (Lib)
files: pluck-pcm24-ext.wav
messages: 313183
nosy: acelletti
priority: normal
severity: normal
status: open
title: Supporting extensible format(PCM) for wave.open(read-mode)
type: enhancement
Added file: https://bugs.python.org/file47467/pluck-pcm24-ext.wav

___
Python tracker 

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



[issue32990] Supporting extensible format(PCM) for wave.open(read-mode)

2018-03-03 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
stage:  -> needs patch
versions: +Python 3.8

___
Python tracker 

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



[issue32963] Python 2.7 tutorial claims source code is UTF-8 encoded

2018-03-03 Thread Martijn Pieters

Martijn Pieters  added the comment:

Thanks for the quick fix, sorry I didn't have a PR for this one!

--

___
Python tracker 

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



[issue32758] Stack overflow when parse long expression to AST

2018-03-03 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you Brett! The comment LGTM.

Is it worth to add warnings to other functions?

* compile(), exec() and eval(). They are crashed due to recursion in the AST 
optimizer. This is a regression of 3.7. compile(..., PyCF_ONLY_AST) is the same 
as ast.parse() and crashed in older versions.

* dbm.dumb.open(). It calls ast.literal_eval(). The dbm.dumb databases are 
considered slow but portable. Before issue22885 this function was even more 
vulnerable due to using eval(). Since changing it to ast.literal_eval() some 
developers could consider it safe, but this is not true.

* A number of functions in the inspect module which directly or indirectly call 
ast.parse() on the __text_signature__ attribute. The risk of this vulnerability 
is very low.

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



[issue32964] Reuse a testing implementation of the path protocol in tests

2018-03-03 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset fbdd075c64a5229dfa26632cf1b2cf2361dc5003 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-32964: Reuse a testing implementation of the path protocol in tests. 
(GH-5930). (GH-5958)
https://github.com/python/cpython/commit/fbdd075c64a5229dfa26632cf1b2cf2361dc5003


--

___
Python tracker 

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



[issue32964] Reuse a testing implementation of the path protocol in tests

2018-03-03 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue32980] Remove functions that do nothing in _Py_InitializeCore()

2018-03-03 Thread Thomas Nyberg

Change by Thomas Nyberg :


--
pull_requests: +5732

___
Python tracker 

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



[issue32980] Remove functions that do nothing in _Py_InitializeCore()

2018-03-03 Thread Thomas Nyberg

Thomas Nyberg  added the comment:

ince I originated this issue and I think I understand the concerns, I figured I 
could speed up the back and forth in this thread by opening this new PR which 
removes the `_PyFrame_Init()` function. I couldn't find any `_PyFrame_Fini()` 
function in the source so maybe you two are confused and there wasn't a 
corresponding Fini function? (I presume the more likely scenario is that I am 
the one who is confused so feel free to correct that confusion in that case. :) 
)

--

___
Python tracker 

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



[issue32730] Allow py launcher to launch other registered Pythons

2018-03-03 Thread Steve Dower

Steve Dower  added the comment:

Since I took the time to do a brain dump of my thinking here, feel free to 
review/contribute to https://github.com/zooba/PyLauncher/wiki

Note that the code in that repo doesn't match the wiki page, and while I think 
it's good code I do now think it's the wrong approach. So ignore that and just 
read the "spec"

--

___
Python tracker 

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



[issue26707] plistlib fails to parse bplist with 0x80 UID values

2018-03-03 Thread Jon Janzen

Jon Janzen  added the comment:

Hello,

I have attached a file extracted from the database of the 2Do App for iOS and 
macOS. The file contains information about tags used in the app.

plistlib cannot currently parse this file because it lacks the ability to read 
byte 0x80 (UID).

I believe the documentation for generating these type of files can be found at: 
https://developer.apple.com/documentation/foundation/nskeyedarchiver

--
nosy: +bigfootjon
Added file: https://bugs.python.org/file47468/cat.plist

___
Python tracker 

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



[issue32990] Supporting extensible format(PCM) for wave.open(read-mode)

2018-03-03 Thread Andrea Celletti

Andrea Celletti  added the comment:

I am currently working on a patch for this.

When done can I try pushing this in 3.7 rather than 3.8?

It is not much of an enhancement but rather fixing the code that raises an 
error for a perfectly valid PCM wave file (bugfix).

--
versions:  -Python 3.8

___
Python tracker 

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



[issue32990] Supporting extensible format(PCM) for wave.open(read-mode)

2018-03-03 Thread Ned Deily

Ned Deily  added the comment:

Thanks for working on this.  Please follow the process in our Developers Guide 
and submit a PR against the master branch (for 3.8).  After a core developer 
reviews it and if it is accepted, we can then decide about backports to other 
release branches.  Also, if you haven't already, please make sure to read the 
section on licensing and sign a contributor agreement:

https://devguide.python.org/pullrequest/

--
nosy: +ned.deily
versions: +Python 3.8

___
Python tracker 

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



[issue32963] Python 2.7 tutorial claims source code is UTF-8 encoded

2018-03-03 Thread Brett Cannon

Brett Cannon  added the comment:

No need to apologize! We all only have so much free time.

--

___
Python tracker 

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



[issue32758] Stack overflow when parse long expression to AST

2018-03-03 Thread Brett Cannon

Brett Cannon  added the comment:

You're probably right and it's worth propagating the warning a bit wider.

--
assignee: docs@python -> brett.cannon

___
Python tracker 

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




[issue32919] csv.reader() to support QUOTE_ALL

2018-03-03 Thread R. David Murray

R. David Murray  added the comment:

QUOTE_ALL only makes sense as an output control parameter, IMO.  It is an 
output discipline but doesn't say anything about semantics.  In csv format, an 
empty field and a field containing the empty quoted string are completely 
equivalent.  I would be -1 on adding an option that differentiated them.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32989] IDLE: Incorrect signature in call from editor to pyparse.find_good_parse_start

2018-03-03 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +patch
pull_requests: +5734
stage: test needed -> patch review

___
Python tracker 

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



[issue32989] IDLE: Incorrect signature in call from editor to pyparse.find_good_parse_start

2018-03-03 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I didn't incorporate all the suggestions into the first PR for this so that it 
could focus on the parameter change and the tests.  `newline_and_indent_event` 
does a lot, so I want to make sure the tests look good.  I was also going to 
add tests for the other indent methods (some are called from 
`newline_and_indent_event`), but, again, wanted to focus on the bug fix.

Oddly enough, I don't know how to show in the tests that the bug fix makes any 
difference.  Finding a "good parse start" is more about parsing faster, but, as 
the tests show from running all the tests with the `context_use_ps1` set to 
True and False, the results are the same.  Of course, with one or two lines of 
code, they would be because there isn't much text to parse and ignore.  I did 
have some tests that had longer text to show that `bod` was being calculated, 
but I wasn't sure if I should include those for the main goal of testing  the 
newline and indent.

>  Both calls to fgps (editor and hyperparser) pass 
> _build_char_in_string_func(initial_start), which unconditionally returns a 
> function.  So I think we can delete '=None' and the early return, rather than 
> changing the early return condition.

I'd like to address the on another PR that focuses more on refactoring pyparse 
than this one.

> If fgps never returns 0

It can return 0, separately from None, as some of the tests on this PR show.

> Perhaps separate issue: the 'if use_ps1' statements in editor and 
> hyperparser, and a couple of lines before, is nearly identical, and could be 
> factored into a separate editor method that returns a parser instance ready 
> for analysis.  It could then be tested in isolation.  The method should 
> return a parser instance ready for analysis.

I agree.  The duplicated code is bugging me.  :-)

-
One addtional note:  I think that all the indent-related methods in 
EditorWindow can be factored out into their own class.   It will help make 
EditorWindow a little more manageable.

--
stage: patch review -> test needed

___
Python tracker 

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



[issue21998] asyncio: support fork

2018-03-03 Thread Zac Medico

Zac Medico  added the comment:

I'm not sure about possible use cases that might conflict with this approach, 
but using a separate event loop for each pid seems very reasonable to me, as 
follows:

_default_policy = asyncio.get_event_loop_policy()
_pid_loop = {}

class MultiprocessingPolicy(asyncio.AbstractEventLoopPolicy):
def get_event_loop(self):
pid = os.getpid()
loop = _pid_loop.get(pid)
if loop is None:
loop = self.new_event_loop()
_pid_loop[pid] = loop
return loop

def new_event_loop(self):
return _default_policy.new_event_loop()

asyncio.set_event_loop_policy(MultiprocessingPolicy())

--
nosy: +zmedico

___
Python tracker 

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



[issue32991] AttributeError in doctest.DocTestFinder.find

2018-03-03 Thread Jason R. Coombs

New submission from Jason R. Coombs :

In Python 3.6, one could find doctests on a namespace package:

```
$ mkdir foo
$ python3.6
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import foo
>>> foo.__file__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: module 'foo' has no attribute '__file__'
>>> import doctest
>>> doctest.DocTestFinder().find(foo)
[]
```

In recent builds of Python 3.7, these namespace packages inherited a `__file__` 
attribute whose value is `None`, which causes DocTestFinder.find to fail:

```
$ python
Python 3.7.0b2 (tags/v3.7.0b2:b0ef5c979b, Feb 27 2018, 20:38:21)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import doctest
>>> import foo
>>> foo.__file__
>>> doctest.DocTestFinder().find(foo)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/doctest.py", 
line 893, in find
file = inspect.getsourcefile(obj)
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/inspect.py", 
line 687, in getsourcefile
if any(filename.endswith(s) for s in all_bytecode_suffixes):
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/inspect.py", 
line 687, in 
if any(filename.endswith(s) for s in all_bytecode_suffixes):
AttributeError: 'NoneType' object has no attribute 'endswith'
```

Scanning through the recent changes, issue32305 seems to be related, but when I 
look at the code ancestry, I can't see the related commits on the 3.7 branch, 
so I couldn't immediately confirm if it is indeed implicated.

I encountered this issue when testing jaraco.functools on Python 3.7.0b2 on 
macOS, but did not encounter it on Python 3.7.0a4+ as found on the Travis 
nightly builds. More details are logged in 
https://github.com/pytest-dev/pytest/issues/3276.

I'm not sure yet whether inspect.getfile should be adapted to raise a TypeError 
in this case, or if doctest.DocTestFinder.find should account for getfile 
returning None.

If we choose to update inspect.getfile, I should caution there's a bit of 
copy/paste there, so two branches of code will need to be updated.

Barry, I'd love to hear what your thoughts are on this and what you'd like to 
do. And definitely let me know if I can help.

--
components: Interpreter Core, Library (Lib)
keywords: 3.7regression
messages: 313197
nosy: barry, jason.coombs
priority: normal
severity: normal
status: open
title: AttributeError in doctest.DocTestFinder.find
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



[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-03 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 0e6c8ee2358a2e23117501826c008842acb835ac by Benjamin Peterson 
(Jamie Davis) in branch 'master':
bpo-32981: Fix catastrophic backtracking vulns (#5955)
https://github.com/python/cpython/commit/0e6c8ee2358a2e23117501826c008842acb835ac


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-03 Thread miss-islington

Change by miss-islington :


--
keywords: +patch
pull_requests: +5735
stage:  -> patch review

___
Python tracker 

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



[issue32874] IDLE: Add tests for pyparse

2018-03-03 Thread Terry J. Reedy

Change by Terry J. Reedy :


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



[issue31500] IDLE: Tiny font on HiDPI display

2018-03-03 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I assume that the 2nd patch, by Serhiy, fixed the issue.

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



[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-03 Thread Benjamin Peterson

Change by Benjamin Peterson :


--
pull_requests: +5736

___
Python tracker 

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



[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-03 Thread Benjamin Peterson

Change by Benjamin Peterson :


--
pull_requests: +5737

___
Python tracker 

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



[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-03 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 0902a2d6b2d1d9dbde36aeaaccf1788ceaa97143 by Benjamin Peterson 
(Miss Islington (bot)) in branch '3.7':
bpo-32981: Fix catastrophic backtracking vulns (GH-5955)
https://github.com/python/cpython/commit/0902a2d6b2d1d9dbde36aeaaccf1788ceaa97143


--

___
Python tracker 

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



[issue32980] Remove functions that do nothing in _Py_InitializeCore()

2018-03-03 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 7023644e0c310a3006c984318c2c111c468735b4 by Benjamin Peterson 
(Thomas Nyberg) in branch 'master':
closes bpo-32980 Remove _PyFrame_Init (GH-5965)
https://github.com/python/cpython/commit/7023644e0c310a3006c984318c2c111c468735b4


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



[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-03 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset e052d40cea15f582b50947f7d906b39744dc62a2 by Benjamin Peterson in 
branch '2.7':
[2.7] bpo-32981: Fix catastrophic backtracking vulns (GH-5955)
https://github.com/python/cpython/commit/e052d40cea15f582b50947f7d906b39744dc62a2


--

___
Python tracker 

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



[issue32981] Catastrophic backtracking in poplib and difflib

2018-03-03 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset c9516754067d71fd7429a25ccfcb2141fc583523 by Benjamin Peterson in 
branch '3.6':
[3.6] bpo-32981: Fix catastrophic backtracking vulns (GH-5955)
https://github.com/python/cpython/commit/c9516754067d71fd7429a25ccfcb2141fc583523


--

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2018-03-03 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What about 2.7?

--

___
Python tracker 

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