[issue29532] functools.partial is not compatible between 2.7 and 3.5

2017-02-10 Thread Naoyuki Kamo

New submission from Naoyuki Kamo:

The code:
from functools import partial
def f(a):
print(a)
d = {'a': 3}
g = partial(f, **d)
g()
d['a'] = 5 
g()

On python2.7, gets
3
but on python3.5, gets
5

is it a bug?

--
messages: 287594
nosy: naoyuki
priority: normal
severity: normal
status: open
title: functools.partial is not compatible between 2.7 and 3.5
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue28929] Provide a link from documentation back to its source file

2017-02-10 Thread Brett Cannon

Brett Cannon added the comment:

Now that we have migrated to GitHub and Mariatta is a core dev I'm assigning 
this to her. :)

--
assignee: docs@python -> Mariatta

___
Python tracker 

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



[issue27536] Convert readme to reStructuredText

2017-02-10 Thread Zachary Ware

Zachary Ware added the comment:

This has been done in PR2.  Thank you for the patch anyway, Louis, and I'm 
sorry we didn't wind up using it!

--
nosy: +haypo, zach.ware
pull_requests: +33
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue29528] Encrypt IRC channel details for Travis

2017-02-10 Thread Zachary Ware

Zachary Ware added the comment:

Fixed in PR13.

--
nosy: +zach.ware
pull_requests: +32
resolution:  -> fixed
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



[issue29531] Update Doc/README.txt to README.rst

2017-02-10 Thread Roger Sachan

Changes by Roger Sachan :


--
pull_requests: +31

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-10 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +30

___
Python tracker 

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



[issue29531] Update Doc/README.txt to README.rst

2017-02-10 Thread Roger Sachan

New submission from Roger Sachan:

I have simply updated the document and its references to README.rst (thanks to 
whoever formatted it).

--
assignee: docs@python
components: Documentation
messages: 287590
nosy: Roger Sachan, docs@python
priority: normal
pull_requests: 29
severity: normal
status: open
title: Update Doc/README.txt to README.rst
type: enhancement
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



[issue29525] Python 2.7.13 for Windows broken (from prompt)

2017-02-10 Thread Eryk Sun

Eryk Sun added the comment:

It doesn't appear to be a crash, but seems like the REPL is quitting because 
there's no input (e.g. like stdin is redirected to NUL). Echo %errorlevel%; 
it's probably 0. 

readline (pyreadline) is probably the culprit. Try the following shell commands 
to temporarily disable it:

ren C:\Python27\Lib\site-packages\readline.py readline.py.bak
del C:\Python27\Lib\site-packages\readline.pyc

If it's not installed, then these commands will fail.

--
nosy: +eryksun

___
Python tracker 

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



[issue29524] Move functions to call objects into a new Objects/call.c file

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

Benchmarks results.

I don't know if the speedup is purely random, if I was just lucky, or if the 
change really makes Python faster...

spectral_norm is a benchmark highly impacted by code placement.

haypo@speed-python$ python3 -m perf compare_to 
/home/haypo/benchmarks/2017-02-10_00-20-default-e91ec62da088.json 
call_ref_e91ec62da088.json -G --min-speed=5
Slower (1):
- spectral_norm: 242 ms +- 3 ms -> 282 ms +- 2 ms: 1.16x slower (+16%)

Faster (15):
- xml_etree_process: 193 ms +- 4 ms -> 173 ms +- 3 ms: 1.11x faster (-10%)
- call_method: 12.4 ms +- 0.6 ms -> 11.3 ms +- 0.3 ms: 1.10x faster (-9%)
- hexiom: 18.5 ms +- 0.2 ms -> 17.1 ms +- 0.1 ms: 1.09x faster (-8%)
- sympy_expand: 940 ms +- 12 ms -> 866 ms +- 13 ms: 1.09x faster (-8%)
- regex_effbot: 5.39 ms +- 0.09 ms -> 4.99 ms +- 0.06 ms: 1.08x faster (-7%)
- chaos: 235 ms +- 2 ms -> 219 ms +- 2 ms: 1.07x faster (-7%)
- unpickle_pure_python: 686 us +- 11 us -> 639 us +- 7 us: 1.07x faster (-7%)
- chameleon: 22.6 ms +- 0.4 ms -> 21.0 ms +- 0.3 ms: 1.07x faster (-7%)
- nqueens: 220 ms +- 2 ms -> 205 ms +- 3 ms: 1.07x faster (-7%)
- telco: 15.0 ms +- 0.6 ms -> 14.0 ms +- 0.2 ms: 1.07x faster (-6%)
- sympy_str: 423 ms +- 4 ms -> 399 ms +- 3 ms: 1.06x faster (-6%)
- scimark_monte_carlo: 223 ms +- 9 ms -> 211 ms +- 8 ms: 1.06x faster (-6%)
- xml_etree_generate: 223 ms +- 3 ms -> 210 ms +- 2 ms: 1.06x faster (-6%)
- xml_etree_iterparse: 192 ms +- 3 ms -> 182 ms +- 4 ms: 1.05x faster (-5%)
- sympy_sum: 191 ms +- 7 ms -> 181 ms +- 7 ms: 1.05x faster (-5%)

Benchmark hidden because not significant (48): (...)

--

___
Python tracker 

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



[issue29530] Windows buildbots broken by the migration to GitHub (meta issue)

2017-02-10 Thread STINNER Victor

New submission from STINNER Victor:

(*) I noticed test_sax and test_random failures on Windows since CPython moved 
to GitHub. These failures seem to be caused by newlines: see issue #27425.


(*) "AMD64 Windows7 SP1 3.x" fails on the "git" step with:

   'git' is not recognized as an internal or external command

I contacted the slave owner, Jeremy, to ask him to install git.

--
components: Tests
keywords: buildbot
messages: 287587
nosy: haypo
priority: normal
severity: normal
status: open
title: Windows buildbots broken by the migration to GitHub (meta issue)
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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Eric Snow

Eric Snow added the comment:

This is strictly a problem for the system Python, right?  In that case, can't 
the dist package clear __pycache__ under the system site-packages directory 
(and any other user-read-only dirs) during install of the updated Python?

Is the concern that upgrading Python may force all .pyc files to be re-written 
(perhaps unnecessarily)?  If so, I'm not clear on why it's okay between major 
versions but not minor ones.  Frequency perhaps?  Is the cost of re-compiling 
all .pyc files (which mostly won't happen all at the same time) significant 
enough to warrant changing the status quo, particularly since the magic number 
rarely changes in a minor release?

As one (poor) alternative, we could require re-compiling a .pyc file only if it 
contains the affected bytecode(s).  Granted, that would probably require 
associating every bytecode with a magic number.  The required comparison would 
likely be more expensive than just re-compiling. :/

Another alternative would be to leverage sys.dont_write_bytecode somehow.

--
nosy: +eric.snow

___
Python tracker 

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



[issue29511] Add 'find' as build-in method for lists

2017-02-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Without any test code (other than my examples) to illustrate the desired new 
functionality, I may have misunderstood.  But I read the George's prose (but 
not the SO link) and everything I wrote is relevant to what I thought it said.  
The request appears to be for either what now exists (other than the name and 
failure signal) or what Guido has specifically rejected for non-strings.

Reasons for rejecting subsequence matching:
1. Except for strings, practical use cases seem to be rare.
2. Enhancement could mask bugs.
3. General sequences with nesting (tuples and lists, but not range) have an 
ambiguity problem that strings do not.

[1, 2, [1,2]].index([1,2]) currently returns 2, not 0, and this cannot change.  
Similarly, [1,2] in [1,2,3] should not change from False to True.

Steven, without specific code examples, I do not understand what the 'this' is 
that you think is different from what you say was properly rejected,  The 
request appears to be for extending the meaning of'in' and 'find/index' for 
non-strings. (See last sentence of opening post.) As you note, there are 
several related but different problems.

http://code.activestate.com/recipes/117214/ gives Python code for 
Knuth-Morris-Pratt string matching.  Python uses a C-coded version of either 
this or an alternative in (str/bytes/bytearray).(index/find) Both methods stop 
with the first match, but have a 'start' parameter if one wants repeated 
matches, and one can choose either start as position + 1 or position + 
len(pattern) to allow overlaps or not.

Every presentation of KMP I have seen is as a string algorithm.  In spite of 
the recipe title and argument name ('text'), the author claims that the Python 
code is generic.  Since the recipe discussion only tested strings, I tried

for i in KnuthMorrisPratt([1,2,3,4,5,1,2], [1,2]):
print(i)

and it prints 0 and 5, as claimed.  Nice! Generic subsequence matching is 
easily possible.  I believe the Python code could be rewritten in C with the 
Python C-API and remain generic.

If this idea is not to be dropped, I think the next step should be a 
python-ideas post with a clear function definition and a possible API (which 
will elicit alternative proposals) that avoids the back compatibility problem, 
specific positive and negative test examples, and real-life use cases (which I 
hope might be included in the SO questions).

--

___
Python tracker 

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



[issue29527] Travis: doc job is broken

2017-02-10 Thread Ryan Gonzalez

Ryan Gonzalez added the comment:

Trying to fix this in https://github.com/python/cpython/pull/9...but...

Currently there are approx *pause for effect* 6,245 warnings!

Out of those, around 6,243 are 'reference target not found' warnings, spanning 
over 290 files:


/media/ryan/stuff/cpython/Doc/whatsnew/3.7.rst:121: WARNING: c:member reference 
target not found: doc
/media/ryan/stuff/cpython/Doc/whatsnew/3.7.rst:121: WARNING: c:type reference 
target not found: PyGetSetDef
/media/ryan/stuff/cpython/Doc/whatsnew/3.7.rst:121: WARNING: c:type reference 
target not found: wrapperbase
/media/ryan/stuff/cpython/Doc/whatsnew/3.7.rst:157: WARNING: py:mod reference 
target not found: ntpath
../../Misc/NEWS:348: WARNING: py:data reference target not found: 
socket.TCP_CONGESTION
../../Misc/NEWS:348: WARNING: py:data reference target not found: 
socket.TCP_USER_TIMEOUT
../../Misc/NEWS:1005: WARNING: py:data reference target not found: 
socket.TCP_CONGESTION
../../Misc/NEWS:1005: WARNING: py:data reference target not found: 
socket.TCP_USER_TIMEOUT
../../Misc/NEWS:2718: WARNING: py:obj reference target not found: idlelib/*.py
../../Misc/NEWS:2718: WARNING: py:obj reference target not found: 
idle_test/test_*.py
../../Misc/NEWS:2837: WARNING: c:func reference target not found: malloc
../../Misc/NEWS:2883: WARNING: c:func reference target not found: 
PyObject_Malloc


For some reason, I don't feel like fixing 6,200 warnings is really feasible (or 
at least for me), so would it be worth it to, in the mean time, disable this 
specific kind of warning, at least for the CI builds?

--
nosy: +refi64

___
Python tracker 

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



[issue29428] Doctest documentation unclear about multi-line fixtures

2017-02-10 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

I've drafted some fairly restricted changes to the doctest documentation page. 
They are in my Github branch, 
https://github.com/JDLH/cpython/tree/Issue29428_doctest_docs . The diffs are at 
https://github.com/JDLH/cpython/commit/223ef8f8a6d2fbec6db774912028abb4d2ff88b6 
. 

There currently is no official Python github repot against which to make a pull 
request. In a few days, once it appears, I'll make a pull request.

In the meantime, I can take review comments and improve it. If you are 
interested, please review.

--

___
Python tracker 

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



[issue29524] Move functions to call objects into a new Objects/call.c file

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

We have moved to GitHub and mandatory reviews with Pull Requests. So I created 
the PR #12 and removed the patch attached to this issue to avoid confusion.

--

___
Python tracker 

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



[issue29524] Move functions to call objects into a new Objects/call.c file

2017-02-10 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file46624/call.patch

___
Python tracker 

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



[issue29524] Move functions to call objects into a new Objects/call.c file

2017-02-10 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +28

___
Python tracker 

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



[issue29518] 'for' loop not automatically breaking (index error on line of loop header)

2017-02-10 Thread Justin McNiel

Justin McNiel added the comment:

While restarting didn't fix it, waiting for the next morning did, so I am
afraid that that isn't possible, also, I have made tremendous changes to my
code since then, but I would by happy to send you any bit of my code that
you would like, it cold also be an issue with my computer, our IT
department is very work heavy and doesn't always install the operating
system properly (ie. not installing the driver for the touchpad)

On Feb 10, 2017 4:53 AM, "Steven D'Aprano"  wrote:

>
> Steven D'Aprano added the comment:
>
> I agree with Josh: the exception you are giving doesn't seem possible with
> the code snippet shown. Please COPY AND PASTE (not a screen shot) the text
> of the entire traceback, starting with the line "Traceback..."
>
> I suspect that you may have shadowed the built-in range or len object with
> some custom object, but I could be completely wrong. But without more
> information, we cannot tell what is going on.
>
> It would be really useful if you could provide a minimal (short as
> possible) script that reproduces the problem. And please confirm that you
> can reproduce the problem in the regular CPython interpreter, without using
> any third-party IDEs.
>
> --
> nosy: +steven.daprano
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-02-10 Thread Zachary Ware

Zachary Ware added the comment:

I've disabled the Touch step on the buildbots until this is fixed.

--
keywords: +buildbot
nosy: +zach.ware
priority: normal -> critical
versions: +Python 2.7, Python 3.7

___
Python tracker 

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



[issue29527] Travis: doc job is broken

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

> And we shouldn't disable the check entirely if fixing it is difficult, but 
> instead just let warnings be warnings until we fix all warnings and then make 
> them be errors again.

Ok, I changed my change (I got the same proposal in the PR). So I removed -W 
option:
https://github.com/python/cpython/commit/0d5f11061a873e9fb67ae59e46b3313e5ba22fc3

--

___
Python tracker 

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



[issue29525] Python 2.7.13 for Windows broken (from prompt)

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

To get more information during the Python initialization, you can try to run:

python -X faulthandler -S -v

* -X faulthandler: dump a traceback if python crashed (is it the case? I don't 
understand from the bug report)
* -S disables the site module
* -v enables verbose mode

--

___
Python tracker 

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



[issue29525] Python 2.7.13 for Windows broken (from prompt)

2017-02-10 Thread Frak N

Frak N added the comment:

c:\Python27>SET PY
Environment variable PY not defined


I don't know anything about readline or how to find what uses it.

--

___
Python tracker 

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



[issue29529] Backport Travis configuration

2017-02-10 Thread Brett Cannon

Changes by Brett Cannon :


--
dependencies: +Encrypt IRC channel details for Travis

___
Python tracker 

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



[issue29529] Backport Travis configuration

2017-02-10 Thread Brett Cannon

New submission from Brett Cannon:

Once the Travis config stabilizes then it should be backported to all active 
branches.

--
assignee: brett.cannon
messages: 287576
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Backport Travis configuration
versions: Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue29528] Encrypt IRC channel details for Travis

2017-02-10 Thread Brett Cannon

Changes by Brett Cannon :


--
title: Encrypt IRC channel details -> Encrypt IRC channel details for Travis

___
Python tracker 

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



[issue29528] Encrypt IRC channel details

2017-02-10 Thread Brett Cannon

New submission from Brett Cannon:

Donald pointed out on IRC we should encrypt a channel key for IRC so that it 
doesn't get flooded from people's forks. See 
https://docs.travis-ci.com/user/notifications#Channel-key for documentation on 
how to do this.

--
messages: 287575
nosy: brett.cannon, dstufft, r.david.murray
priority: high
severity: normal
status: open
title: Encrypt IRC channel details

___
Python tracker 

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



[issue29527] Travis: doc job is broken

2017-02-10 Thread Brett Cannon

Brett Cannon added the comment:

What would it take to simply fix the docs?

And we shouldn't disable the check entirely if fixing it is difficult, but 
instead just let warnings be warnings until we fix all warnings and then make 
them be errors again.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue29527] Travis: doc job is broken

2017-02-10 Thread STINNER Victor

New submission from STINNER Victor:

I suggest to disable the job until it's fixed, just to fix Travis right now. 
This issue will track the bug to find a solution.

https://travis-ci.org/python/cpython/jobs/200517775

$ make html SPHINXBUILD="./venv/bin/python3 -m sphinx" SPHINXOPTS="-nW -q -b 
linkcheck"
./venv/bin/python3 -m sphinx -b html -d build/doctrees -D latex_paper_size= -nW 
-q -b linkcheck . build/html 

Warning, treated as error:
WARNING: latex_preamble is deprecated. Use latex_elements['preamble'] instead.

make: *** [build] Error 1

--
components: Tests
messages: 287573
nosy: haypo
priority: normal
severity: normal
status: open
title: Travis: doc job is broken
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



[issue29511] Add 'find' as build-in method for lists

2017-02-10 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Terry, I'm not sure if you've read this enhancement request correctly or not, 
because your reply when closing covers over a lot of detail which is not 
relevant to this feature request.

> Extending this idea to 'subsequence in sequence' or 
> sequence.index(subsequence) has been rejected.

And so it should, as that is a major break with backwards compatibility, but 
that is not what this feature request is about.

Including George's link, I count at least five questions on StackOverflow 
asking about this functionality: how to do subsequence tests in sequences apart 
from strings. That, and the interest in the recipes on ActiveState (here's 
another: http://code.activestate.com/recipes/117214/ ) indicate a reasonable 
level of interest in this feature.

In Python today, there is no obvious, good, correct way to do this in the 
standard library, just a bunch of hacks and tricks which solve slightly 
different problems.

Unless the very idea of subsequence matching has been rejected (which would 
surprise me greatly) I'm going to re-open this ticket. Any objections?

--

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-10 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

My Pull Request was closed, because apparently  
https://github.com/python/cpython/ will not be the new GitHub repo for Python. 
The actual repo will open on 11. Feb, I'm told. I will repeat the PR there. 
Please stand by.

--

___
Python tracker 

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



[issue29526] Documenting format() function

2017-02-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

+1 of Serhiy's ideas.  I was not aware that FORMATTING had been added.  And 
this could be specifically helpful.

>>> help(int.__format__)
Help on method_descriptor:

__format__(...)
default object formatter

--
nosy: +terry.reedy

___
Python tracker 

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



[issue29511] Add 'find' as build-in method for lists

2017-02-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Lists, tuples, ranges, dicts, and other builtin collection objects already work 
with 'in'.

>>> 1 in [1,2,3]
True
>>> 4 in range(9)
True

For historical reasons, stings have both 'find' and 'index'.  The only 
difference is returning -1 (a C-ism) versus raising ValueError on failure.  
They are otherwise redundant.

Lists, tuples, and ranges, and other builtin sequence objects already  have 
'index'.  There is no need to repeat the redundancy of 'find'.

>>> [1,2,3].index(2)
1
>>> [1,2,3].index(4)
Traceback (most recent call last):
  File "", line 1, in 
[1,2,3].index(4)
ValueError: 4 is not in list
>>> range(9).index(4)
4

Strings are a special case of collection in that they 'contain' substrings 
rather than items of a different class.  For this reason, 'in' and index/find 
are special-cased also work with contiguous substrings of length greater than 1.

>>> 'ac' in 'abc'
False
>>> 'ab' in 'abc'
True

Extending this idea to 'subsequence in sequence' or sequence.index(subsequence) 
has been rejected.

Note: __cmp__ does not exist in 3.x.  Collection 'in' and sequence 'index' 
check object identity before equality to guarantee that an object in a 
collection (in the common sense of the term) is actually found even if it has a 
screwy definition of __eq__.

>>> nan = float('nan')
>>> nan == nan
False
>>> nan in [nan]
True
>>> float('nan') in [float('nan')]
False
>>> [nan].index(nan)
0

--
nosy: +terry.reedy
resolution:  -> rejected
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



[issue29505] Submit the re, json, & csv modules to oss-fuzz testing

2017-02-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

It does not appear to me that targets have to be security critical, though that 
is certainly a good place to start.  The Chrome tests found 100s of "security 
vulnerabilities and stability bugs".

The important thing is that there be someone willing to receive and act on 
reports.  Would 'make public after 90 days' ever be a problem?  AFAIK, most 
Python security issues are already public here on the tracker from day 1.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue29518] 'for' loop not automatically breaking (index error on line of loop header)

2017-02-10 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue29523] latest setuptools breaks virtualenvs due to unbundling dependencies

2017-02-10 Thread Charalampos Stratakis

Charalampos Stratakis added the comment:

Second version of the patch:

Adjusted the test_ensurepip test cases to account for the new modules

--
Added file: 
http://bugs.python.org/file46627/bundle-setuptools-dependencies2.patch

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The online docs are regenerated daily from the current repository, so the 
inclusion of typing.Deque in the doc is correct, given that it has been added 
to the module.  IDLE aside, new features in bugfix releases are limited to 
provisional modules, such as typing.  I believe this should get a 'New in 
3.6.1' (or 3.5.?) note.

Some installations include a local frozen copy of the docs.  The frozen copy 
will not include the rare (and admittedly confusing) feature added for a future 
release.  But it will also not include the much more common corrections and 
clarifications added since the release.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-10 Thread INADA Naoki

INADA Naoki added the comment:

I'll send PR to github.  Please continue there.

--

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-10 Thread INADA Naoki

INADA Naoki added the comment:

Since Python 3.5's key sharing dict allows deletion, py35-2.patch is slightly 
different from py36-2.patch.

Since dictresize won't happen in normal (no weakref/__del__ callback)  deletion,
I removed `CACHED_KEYS(tp) = NULL` entirely.

--
Added file: 
http://bugs.python.org/file46626/29438-sharedkey-useafterfree-py35-2.patch

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Petr Viktorin

Petr Viktorin added the comment:

According to issue27286, Ubuntu 16.04LTS has the fix and uses the new magic 
number. (And this is one reason undoing the change in CPython is out of the 
question.)


The patch Nick mentioned is brewing at 
https://github.com/encukou/cpython/commit/magic-number-workaround .

--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, interesting. The install-time generation case is even trickier, since you 
presumably can't force in-place regeneration of existing pyc files on systems 
that previously had 3.5.2 and upgraded to 3.5.3.

When I last spoke to Peter about this yesterday, he was exploring the idea of a 
downstream-only patch to 3.5.3 that gave it the ability to load pyc files that 
used the 3.5.2 magic number (so it would *emit* files with the new magic 
number, but still allow use of pyc files with the old one). Assuming he can get 
that to work, then I guess it may be of interest to Debian & Ubuntu as well.

--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Petr Viktorin

Petr Viktorin added the comment:

> How would you propose to fix broken bytecodes in a bugfix be fixed if you 
> can't bump the magic number?

That would depend on the situation. I can imagine that if the bug is severe 
enough, the number could be bumped, after careful discussion, and with the 
change being advertised rather loudly.
The test case that's proposed can be changed if it's indeed the best thing to 
do, but it should at the very least be mentioned in release notes.


FWIW, I'm not convinced the bug here was severe enough. Practically no one is 
using the 3.5+ syntax in libraries: we checked to find that *zero* packages in 
Fedora are using the affected opcode. But that's moot now – wider discussion on 
that should have happened before the release.

--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Feb 10, 2017, at 05:46 PM, Nick Coghlan wrote:

>Note that Fedora doesn't even rebuild all the extension modules when bumping
>CPython to a new maintenance release, let alone rebuilding and re-releasing
>all the pure Python ones. (RPM supports doing that just fine, but it would
>mean shipping thousands of updated binary artifacts instead of just one - the
>new CPython maintenance release)

Debian/Ubuntu doesn't rebuild extension modules either.  We don't ship .pyc
files in binary packages, but instead build them at install time on the user's
machine.

--

___
Python tracker 

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



[issue29524] Move functions to call objects into a new Objects/call.c file

2017-02-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It is hard to make a review of changes of such kind. Common reviewing tools 
don't help with this. I would suggest you to make a series of commits that move 
a code from different files after migrating to Git. It may be easier to make a 
post-commit review.

I said about Python/ because Object/ contains mainly implementations of 
concrete builtin types and Python/ contains some utility files (getargs.c, 
modsupport.c). But I think Objects/ is good place too.

--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Nick Coghlan

Nick Coghlan added the comment:

Note that Fedora doesn't even rebuild all the extension modules when bumping 
CPython to a new maintenance release, let alone rebuilding and re-releasing all 
the pure Python ones. (RPM supports doing that just fine, but it would mean 
shipping thousands of updated binary artifacts instead of just one - the new 
CPython maintenance release)

--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Nick Coghlan

Nick Coghlan added the comment:

We *do* ship the bytecode in the built RPMs - the issue is that Python 
maintenance releases shouldn't be triggering rebuilds of thousands of system 
components (cf http://fedora.portingdb.xyz/ ) and potentially breaking 
otherwise working end user applications.

As far as "What about bytecode generation bugs?" goes, then my answer would be 
to find a way to fix the bug for freshly generated bytecode, without forcing 
stale bytecode to be regenerated. That way folks that actually hit the original 
bug have a way of solving it (clear their bytecode cache), while we also don't 
forcibly break the world.

That is, the problem with the resolution of issue 27836 wasn't fixing the 
bytecode generation when using double-star unpacking twice in a single function 
call - it was forcing the regeneration of *all* bytecode just because *some* 
bytecode would be broken if it used a particular new language feature. It's the 
equivalent of deliberately breaking the ABI for all extension modules just 
because we found a header bug affecting one particular function signature.

--

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-10 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue29524] Move functions to call objects into a new Objects/call.c file

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

Oh, it's painful to have reviews and comments in two websites. Serhiy
left a comment on the review in fact:
"Should be added also in PCbuild/pythoncore.vcxproj.filters."

--

___
Python tracker 

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



[issue29524] Move functions to call objects into a new Objects/call.c file

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka added the comment:
> I would delay pushing this change until CPython repository be converted to 
> Git. I heard Git better supports moving a code between files. And perhaps it 
> might be easier to do this change by several commits -- separately moving a 
> code from different files.

Mercurial requires to use "hg cp file1.c file2.c" to keep file1
history in file2.

Git doesn't care. It is "smarter" (more convenient?). It uses an
heuristic to automatically detect when code is moved between files.

The migration to GitHub is ongoing, we are no more able to push to
Mercurial anyway :-D

Any remark about call.c content itself? Does it look good to you?

--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Brett Cannon

Brett Cannon added the comment:

OK, but how would you propose to fix broken bytecodes in a bugfix be fixed if 
you can't bump the magic number? And why aren't you regenerating the bytecode 
when updating Python or shipping the bytecode with the install (and I bet the 
answer is "RPM doesn't support it" and "it goes against packaging guidelines to 
include auto-generated files", but I thought I would ask :) .

--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Nick Coghlan

Nick Coghlan added the comment:

There are a couple of pieces to it:

- first, there's the problem of breaking anyone that actually is doing pyc-only 
distribution, even though nothing in Fedora itself does that. While that aspect 
doesn't break Fedora per se, it does break Fedora's compatibility expectations 
for end user components, which maintenance updates shouldn't do

- however, more importantly in this case, ordinary users don't have write 
access to the system site-packages directory, so the pyc files have to be 
pre-compiled when generating the system RPMs.

While CPython falls back to the slow path of recompiling from source when those 
precompiled files are invalidated so nothing obviously breaks, it still 
generates a lot of SELinux warnings related to unauthorised write attempts to 
system-owned directories: 
https://bodhi.fedoraproject.org/updates/python3-3.5.3-1.fc25%20python3-docs-3.5.3-1.fc25#comment-559458

(Debian uses a similar pre-compilation trick for the same reasons, so I expect 
you'd also see comparable warnings under AppArmor if packages weren't rebuilt 
after a magic number change)

This all means that CPython changing the magic number in a maintenance release 
ends up being akin to breaking the C ABI in a maintenance release - while it 
isn't quite as dire (since there's still the slow path fallback to recompiling 
from source), it does still invalidate all of the pyc files in the system RPMs 
until they're rebuilt against the new version. "Requires a mass rebuild of all 
the Python packages in the distro to get things working properly again" is 
again a major concern for what's nominally a low impact maintenance update.

I realise those consequences aren't particularly obvious for non-distro 
developers, which is why I'd like to see the previous policy of "don't change 
the magic number in maintenance releases" captured as a test case.

--

___
Python tracker 

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



[issue29523] latest setuptools breaks virtualenvs due to unbundling dependencies

2017-02-10 Thread Charalampos Stratakis

Charalampos Stratakis added the comment:

Will send a pull request which includes the extra wheels.

--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-10 Thread Brett Cannon

Brett Cannon added the comment:

Why shouldn't the magic number be bumped when a bug in the bytecode is fixed in 
a bugfix release? How did this break Fedora? Are you not shipping source code 
but only .pyc files?

I view the whole point of having the magic number is to cover things like this, 
otherwise we might as well just embed the CPython version number in the file 
name and be done with it.

--

___
Python tracker 

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



[issue29526] Documenting format() function

2017-02-10 Thread Hugo Prod'homme

Hugo Prod'homme added the comment:

+1 :
Adding the reference to help('FORMATTING') will indeed solve all the problems I 
was thinking about at first.

--

I realized I was thinking only about a small part of the problem thanks to your 
answers. I wasn't even thinking about the dates and other types... So I agree 
applying my first idea will be a big mess.

(... and yes I was referring to printf formatting)

--

___
Python tracker 

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



[issue29526] Documenting format() function

2017-02-10 Thread R. David Murray

R. David Murray added the comment:

Serhiy: those are both great ideas.  +1 from me too.  Then we can even have the 
date formatting documented without cluttering up the main docstring, if we wish 
:)  The format docstring should then also mention doing help on the __format__ 
method of concrete types.

--

___
Python tracker 

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



[issue29526] Documenting format() function

2017-02-10 Thread Marco Buttu

Marco Buttu added the comment:

> It may be worth to add a reference to FORMATTING from the
> format() docstring.

+1 :-)

--
nosy: +marco.buttu

___
Python tracker 

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



[issue29526] Documenting format() function

2017-02-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think it would be worth to extend docstrings of __format__ methods of 
concrete types for including the description of type-specific format 
specifiers. But the docstring of format() shouldn't contain the description of 
format specifiers of all builtin types.

Detailed documentation of format specification mini-language with tables and 
examples you can get by requesting the help for FORMATTING. 
"help('FORMATTING')" or "pydoc3 FORMATTING". It may be worth to add a reference 
to FORMATTING from the format() docstring.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29523] latest setuptools breaks virtualenvs due to unbundling dependencies

2017-02-10 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Aah, yes. I see now. Ensure_pip uses _PROJECTS for three purposes: for defining 
additional_projects, extracting those packages to the tmpdir, and for declaring 
the installation of those projects. Only that last declaration is unnecessary.

This patch looks good to me.

--

___
Python tracker 

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



[issue29524] Move functions to call objects into a new Objects/call.c file

2017-02-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I like the idea of moving all code related to calling objects in one one file. 
But this has a drawback. This breaks a history. This makes harder code 
exploration and merging.

I would delay pushing this change until CPython repository be converted to Git. 
I heard Git better supports moving a code between files. And perhaps it might 
be easier to do this change by several commits -- separately moving a code from 
different files.

--

___
Python tracker 

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



[issue29526] Documenting format() function

2017-02-10 Thread R. David Murray

R. David Murray added the comment:

Thanks for wanting to help improve python.

I'm not entirely clear on what you are proposing.  I *think* you want to add 
something to the 'format' docstring?  As Eric mentioned the 'mini language' 
depends on the datatype, so it is going to be hard to cram accurate information 
into a docstring, where the full context of the documentation explanation of 
how format interacts with data types is missing.  We try to keep docstrings as 
short reminders.  In that regard, the format docstring *is* perhaps a bit 
lacking :)  A reminder of the BNF of the minilanguage would also be helpful if 
we could cram that in somehow.  It may just be too complex a topic for a 
docstring, though.

I'm also not clear why you are referring to strftime and numbers in the same 
sentence.  strftime is for date formatting.  I certainly don't think it is 
appropriate to try to jam that complex subtopic into the format docstring :)  
Maybe you meant 'printf', which % formatting followed fairly closely?

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



[issue29523] latest setuptools breaks virtualenvs due to unbundling dependencies

2017-02-10 Thread Charalampos Stratakis

Charalampos Stratakis added the comment:

@jason.coombs

Already tried to just bump the setuptools version and bundle the other wheels 
but the result is still the same

--

___
Python tracker 

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



[issue29526] Documenting format() function

2017-02-10 Thread Eric V. Smith

Eric V. Smith added the comment:

Since these codes don't apply to all types, you'll need some words saying what 
they do apply to. For example, None being the same as "g" is true for int, 
float, and Decimal; but None is "s" for strings.

And, for example, none of the listed codes apply to datetime's.

I'm +0 on this if we can get the wording right.

--
nosy: +eric.smith
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2017-02-10 Thread Steve Dower

Steve Dower added the comment:

We may just want to copy the values from the enum if there are different 
versions when they were introduced. But if that's not a problem, adding the 
MS_WINDOWS check is better than defining new macros.

--

___
Python tracker 

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



[issue29525] Python 2.7.13 for Windows broken (from prompt)

2017-02-10 Thread Steve Dower

Steve Dower added the comment:

Readline is also a common culprit when it's crashing out at the interactive 
prompt. Try either uninstalling or upgrading any packages that may include a 
readline module.

--

___
Python tracker 

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



[issue29523] latest setuptools breaks virtualenvs due to unbundling dependencies

2017-02-10 Thread Donald Stufft

Donald Stufft added the comment:

I haven't updated the bundled copy of ensurepip yet because of this. Most 
likely the way this will get resolved is that the PEP 518 PR will land in pip 
and we will no longer require setuptools to be pre-installed at all and 
ensurepip will go to only bundling pip itself.

--

___
Python tracker 

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



[issue29526] Documenting format() function

2017-02-10 Thread Hugo Prod'homme

New submission from Hugo Prod'homme:

Hello python contributors,
this is my first time on python.org and I am coming with a suggestion.

The idea is to help people that have to format strings containing numbers of 
various kinds, I am from the scientific domain but this should help everybody 
anyway.

In the past the strftime was the best way to format numbers in strings 
(truncating to some digits after point, setting to exponent notation, etc...). 
To remind the "strf language" one had to use the internet or a document such as 
this page :
http://strftime.org/;>http://strftime.org/

Some idea was provided to add this indications in the python docs.
http://bugs.python.org/issue9650;>http://bugs.python.org/issue9650

Now the format() function has appeared in the python __builtins__ and this is 
even more adequate to add help about the string formatting, because we can 
write the "Format Specification Mini-Language" directly inside the docstring of 
the format.__doc__ . See the paragraph named "7.1.3.1. Format Specification 
Mini-Language" in the following page :
https://docs.python.org/2/library/string.html;>https://docs.python.org/2/library/string.html

I emphasize, the interest of this is to allow the user to be reminded of the 
formatting options without opening another document than his(her) script, to 
avoid breaking the workflow.

I am providing what I think is the minimal material that the docstring should 
contains within the attached file. I am not really familiar with docstring 
formatting according to PEP (436?) and someone should help getting this in the 
right way of writing. Furthermore, a specific syntax  is needed within the 
string in addition to the format() arguments, this should be described. And the 
reminder about the mini-language should appear clearly as a reminder. These are 
two supplemental difficulties in comparison with an usual docstring.

To anyone thinking something else should be added to the docstring; please add 
or say it.

PS: I think I can start from the matplotlib.pyplot.plot.__doc__ as a template 
to complete the format.__doc__ but I have some work aside for now.

--
files: format_docstring_v0.1.txt
messages: 287539
nosy: hugo.prodho...@gmx.fr
priority: normal
severity: normal
status: open
title: Documenting format() function
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46625/format_docstring_v0.1.txt

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2017-02-10 Thread Matthias Klose

Matthias Klose added the comment:

I don't see the point of having an option to do that.  Will patches for third 
party projects be submitted as well, to not install the test suite? Or will pip 
gain such a feature?  Note that removing the test suite completely, you'll make 
the test suites of some third party packages useless in some cases (I had a few 
bug reports for the Ubuntu packaging when I removed the tests unconditionally), 
but probably you don't care about these either.

--

___
Python tracker 

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



[issue29523] latest setuptools breaks virtualenvs due to unbundling dependencies

2017-02-10 Thread Jason R. Coombs

Jason R. Coombs added the comment:

For convenience, here's a link to the rendered changelog in the docs, which 
provides hyperlinks to the relevant issues [0].

[0] https://setuptools.readthedocs.io/en/latest/history.html#v34-0-0

--

___
Python tracker 

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



[issue29523] latest setuptools breaks virtualenvs due to unbundling dependencies

2017-02-10 Thread Jason R. Coombs

Jason R. Coombs added the comment:

This approach, bundling the necessary dependencies to install setuptools, seems 
like exactly the right thing to do, assuming that ensurepip should install 
setuptools at all, and I don't want to challenge that assumption here.

Looking at the patch and ensurepip, I wonder if the patch is necessary at all. 
It looks to me like the `find_links` declaration should be sufficient to allow 
a `pip install setuptools` to succeed and install its dependencies as long as 
they're bundled. @cstratak, can you test a less aggressive approach that merely 
bumps the dependency on setuptools and bundles the dependencies?

--

___
Python tracker 

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



[issue29525] Python 2.7.13 for Windows broken (from prompt)

2017-02-10 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2017-02-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Victor, thanks for clarifying!  That eliminates my objection, if there's a 
tacit agreement that the functionality can be broken by mistake and it's the 
dedicated maintainer (Xavier or someone else)'s job to repair it :-)

--

___
Python tracker 

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



[issue29525] Python 2.7.13 for Windows broken (from prompt)

2017-02-10 Thread Tim Golden

Tim Golden added the comment:

Although I don't remember seeing a crash out as quick as this, common 
causes for this kind of thing are to do with environment variables 
pointing to still-existing or part-existing installations. Can you try:

set PY

from a command prompt, please, to see if any Python-related env vars are 
present. (Typically PYTHONHOME is the culprit)

--

___
Python tracker 

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



[issue29525] Python 2.7.13 for Windows broken (from prompt)

2017-02-10 Thread Frak N

New submission from Frak N:

I used to have an older version of python 2.7 that has worked for years. I just 
upgraded to 2.7.13 for Windows, 32 bit and now, I can't get the interpreter to 
run from the command line. It just returns to the DOS prompt.

c:\Python27>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
c:\Python27>python

PC:
OS: Windows 7 - 64 bit (I am intentionally using the 32bit of python)
Processor: AMD PhenomII 975 Processor. 3.6GHz
RAM: 16GB

--
components: Windows
messages: 287532
nosy: Frak N, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python 2.7.13 for Windows broken (from prompt)
type: crash
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



[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f23fa1f7b68f by Victor Stinner in branch 'default':
Issue #29465: Add Objects/call.c file
https://hg.python.org/cpython/rev/f23fa1f7b68f

--

___
Python tracker 

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



[issue3955] maybe doctest doesn't understand unicode_literals?

2017-02-10 Thread Matthis Thorade

Matthis Thorade added the comment:

I found this bug when trying to write a doctest that passes on Python 3.5 and 
Python 2.7.9.

The following adapted example passes on Python2, but fails on Python3:

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
def f():
"""
>>> f()
u'xyz'
"""
return "xyz"

if __name__ == "__main__":
import doctest
doctest.testmod()

I think a nice solution could be to add a new directive so that I can use the 
following

def myUnic():
"""
This is a small demo that just returns a string.
>>> myUnic()
u'abc' # doctest: +ALLOW_UNICODE
"""
return 'abc'


I asked the same question here:
http://stackoverflow.com/questions/42158733/unicode-literals-and-doctest-in-python-2-7-and-python-3-5

--
nosy: +Matthis Thorade

___
Python tracker 

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



[issue29507] Use FASTCALL in call_method() to avoid temporary tuple

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

> I'm willing Object/call.c solves such placement issue.

I also *hope* that a call.c file would *help* a little bit, but I'm not sure 
that it will fix *all* code placement issues.

I created the issue #29524 with a patch creating Objects/call.c.

--

___
Python tracker 

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



[issue29524] Move functions to call objects into a new Objects/call.c file

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #29502 "Should PyObject_Call() call the profiler on C functions, 
use C_TRACE() macro?": fixing this one should allow to remove fast-paths from 
ceval.c, since we now already have fast-paths in all "call" functions.

--

___
Python tracker 

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



[issue29524] Move functions to call objects into a new Objects/call.c file

2017-02-10 Thread STINNER Victor

New submission from STINNER Victor:

I propose to move functions to call objects into a new Objects/call.c file.

It should easy maintainance since all moved functions are inter-dependent: it 
becomes easier to keep them consistent since they are in the same fle.

I also have a small "hope" that moving "call" functions in the same file should 
help the compiler to produce more efficient code and that we will get a better 
"code placement". Closer functions should enhance the usage of the CPU 
instruction cache.

I don't know exactly how to measure the effect of code placement. My plan is to 
push the change, and then watch speed.python.org timeline.

Attached call.patch:

* Add Objects/call.c file
* Move all functions to call objects in a new Objects/call.c file.
* Rename fast_function() to _PyFunction_FastCallKeywords(). 
* Copy null_error() from Objects/abstract.c
* Inline type_error() in call.c to not have to copy it, it was only called once.
* Export _PyEval_EvalCodeWithName() since it is now called from call.c.


The change comes from the issue #29465. Copy of my msg287257 from this issue:
---
Serhiy Storchaka added the comment:
> Isn't the Python directory more appropriate place for call.c?

I moved code from other .c files in Objects/, so for me it seems more
natural to add the code in Objects/ as well. It seems like most of the
code in Python/ is not "aware" of types defined in Objects/. But I
don't have a strong opinion on the right directory.

Objects/call.c is 1500 lines long. IMHO the code became big enough to
justify to move it to a new file ;-)
---


Once we have a call.c file, we may try other changes to enhance the code 
placement:

* Add "#define PY_LOCAL_AGGRESSIVE" (only used by Visual Studio)
* Tag functions with _Py_HOT_FUNCTION: see the issue #28618 for discussion on 
__attribute__((hot)). The last time I checked, it wasn't enough to fix all 
"code placement issues".
* Reorder functions in call.c: I dislike this idea, IMHO it's too hard to guess 
ourself what is the best order, and it's likely to produce many commits for 
little benefit

See also the issue #29465: "Add _PyObject_FastCall() to reduce stack 
consumption.

--
components: Interpreter Core
files: call.patch
keywords: patch
messages: 287527
nosy: haypo, inada.naoki, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Move functions to call objects into a new Objects/call.c file
versions: Python 3.7
Added file: http://bugs.python.org/file46624/call.patch

___
Python tracker 

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



[issue27286] str object got multiple values for keyword argument

2017-02-10 Thread Martin Panter

Martin Panter added the comment:

Diff showing what changed relative to the main 3.5 branch when merging in the 
3.5.2 release: .

There are four news entries deleted from the 3.5.2rc1 section. Ideally they 
should have been moved to the 3.5.3rc1 section instead, because they were added 
after 3.5.2rc1 was branched, but before the 3.5.3rc1 heading appeared.

Also, there were some minor corrections of mine and Victor’s that were undone.

And I would suggest to restrict merge commits to changes that are already in at 
least one of the branches being merged. The edit to “byte-like” was not present 
in either of the branches being merged. In Git I think they call these changes 
“evil merges”.

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:


New changeset be363764cad68ad7b608ceed837cc01c2c3b4efc by Victor Stinner in 
branch '3.6':
Fix test_datetime on Windows
https://github.com/python/cpython/commit/be363764cad68ad7b608ceed837cc01c2c3b4efc


--

___
Python tracker 

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



[issue27640] add the '--disable-test-suite' option to configure

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

> But I would prefer to see a public discussion on python-dev before going into 
> this direction.

Ah, the discussion restarted on the other issue:
http://bugs.python.org/issue20210#msg287516

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:


New changeset be363764cad68ad7b608ceed837cc01c2c3b4efc by Victor Stinner in 
branch 'master':
Fix test_datetime on Windows
https://github.com/python/cpython/commit/be363764cad68ad7b608ceed837cc01c2c3b4efc


--

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

Antoine Pitrou: " Who volunteers to support it?  It's a PITA to maintain the 
configure script and setup.py, and adding options only makes it more painful.  
This kind of niche features needs some dedicated maintainer so that other core 
developers don't have to bother with it."

Oh, I forgot to put more context in my previous comment.

Xavier de Gaye opened the issue #27640 "add the '--disable-test-suite' option 
to configure". He is a core developer working on porting CPython to Android. 
Xavier is the requested dedicated maintainer ;-)

--
nosy: +xdegaye

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka: "Check that pickling/unpickling the windows object doesn't 
cause crash or undefined behaviour. Currently the pickling fails because the 
name of the class is not true name."

Ah, good idea.

I tested with curses_fix_window_class_name.patch: window objects cannot be 
pickled. Hopefully! IMHO it doesn't make sense to serialize such "live" object.

haypo@selma$ cat > x.py
import curses
w = curses.initscr()
curses.endwin()
print(type(w))
^D

haypo@selma$ ./python -i x.py

>>> import pickle
>>> pickle.dumps(w)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can't pickle _curses.window objects

--

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2017-02-10 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

I'm still -1 on the approach taken by the OP, but +1 on Martin's approach of 
making such configurations more easily possible via Modules/Setup.

--

___
Python tracker 

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



[issue29523] latest setuptools breaks virtualenvs due to unbundling dependencies

2017-02-10 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +jason.coombs

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1555e7776321 by Victor Stinner in branch '3.6':
Fix test_datetime on Windows
https://hg.python.org/cpython/rev/1555e7776321

--

___
Python tracker 

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2017-02-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> It's painful to have to maintain downstream patches. Supporting this feature 
> would make Python usable on more platforms.

Who volunteers to support it?  It's a PITA to maintain the configure script and 
setup.py, and adding options only makes it more painful.  This kind of niche 
features needs some dedicated maintainer so that other core developers don't 
have to bother with it.

--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

I'm not aware of any pending issues, buildbots are happy, I'm happy, I close 
the issue :-) Don't hesitate to reopen it if I missed something.

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



[issue20210] Provide configure options to enable/disable Python modules and extensions

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

Antoine Pitrou: "That's not really the point. The question is why we should 
have to maintain this ourselves. It is easy for interested people to maintain 
their own forks, especially when *removing* stuff."

It's painful to have to maintain downstream patches. Supporting this feature 
would make Python usable on more platforms.


Marc-Andre Lemburg: "it is possible to compress Python down to just a few MBs: 
(...)"

Right, that "a few MBs" can be too big on small devices, and it has a price on 
runtime performance, at least on the boot duration.

--

___
Python tracker 

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



[issue27640] add the '--disable-test-suite' option to configure

2017-02-10 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue27640] add the '--disable-test-suite' option to configure

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

I'm in favor of allowing to build a "subset" of Python. Not only it makes sense 
for embedded devices, but in many cases it's even not possible to do otherwise: 
"full" Python is too big for small devices.

But I would prefer to see a public discussion on python-dev before going into 
this direction.

The previous attempt failed because some core developers were opposed to 
support officially a "subset of Python". But since this previous discussion 
(two years ago? longer?), MicroPython became popular, and this implementation 
of Python has a small subset of the stdlib (but it supports asyncio ;-)) Maybe 
it's time for a new attempt :-) Oh, and the meanwhile we also made progress on 
the Android port, which is now an important platform.

In short, I would like to official support Python subsets ;-) At least, add 
options for that.

--

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Check that pickling/unpickling the windows object doesn't cause crash or 
undefined behaviour. Currently the pickling fails because the name of the class 
is not true name.

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:


New changeset a88f9614c672c3369cf03cdf51d012a42ae5665f by Victor Stinner in 
branch 'master':
Fix test_datetime on system with 32-bit time_t
https://github.com/python/cpython/commit/a88f9614c672c3369cf03cdf51d012a42ae5665f


--

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

curses_fix_window_class_name.patch: Fix the name of the C window class: 
"_curses.window", not "_curses.curses window" (with a space in the class name) 
!?

The following example current displays :
---
import curses
w = curses.initscr()
curses.endwin()
print(type(w))
---

--
Added file: http://bugs.python.org/file46623/curses_fix_window_class_name.patch

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

curses_temporaryfile.patch: Call tempfile.TemporaryFile in getwin() and 
putwin() to create the temporary file in a more portable and safer manner.

The curses library requires a FILE* object, but TemporaryFile.close() must be 
called to remove the temporary file. So I chose to duplicate the file 
descriptor, so we can close fclose() and tmpfile.close().

I chose to modify the C rather rather than trying to implement a window class 
in Python, because the C window class is part of a "PyCurses_API", and many C 
functions instanciate the C class.

--
Added file: http://bugs.python.org/file46622/curses_temporaryfile.patch

___
Python tracker 

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



[issue29518] 'for' loop not automatically breaking (index error on line of loop header)

2017-02-10 Thread Steven D'Aprano

Steven D'Aprano added the comment:

I agree with Josh: the exception you are giving doesn't seem possible with the 
code snippet shown. Please COPY AND PASTE (not a screen shot) the text of the 
entire traceback, starting with the line "Traceback..."

I suspect that you may have shadowed the built-in range or len object with some 
custom object, but I could be completely wrong. But without more information, 
we cannot tell what is going on.

It would be really useful if you could provide a minimal (short as possible) 
script that reproduces the problem. And please confirm that you can reproduce 
the problem in the regular CPython interpreter, without using any third-party 
IDEs.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue29324] test_aead_aes_gcm fails on Kernel 4.9

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

I confirm that test_socket pass with test_socket_aead_kernel49.patch on my 
Fedora 25 (kernel 4.9.5-200.fc25.x86_64).

I would be nice to fix test_socket which is currently broken ;-)

--
nosy: +haypo

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1c6b87b07586 by Victor Stinner in branch '3.6':
Fix test_datetime on system with 32-bit time_t
https://hg.python.org/cpython/rev/1c6b87b07586

--

___
Python tracker 

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



[issue27286] str object got multiple values for keyword argument

2017-02-10 Thread Larry Hastings

Larry Hastings added the comment:

Sorry about that!  It's almost like manually updating Misc/NEWS is a bad design 
:(

--

___
Python tracker 

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



[issue27286] str object got multiple values for keyword argument

2017-02-10 Thread Mark Dickinson

Mark Dickinson added the comment:

It's difficult to track down which versions of Python 3.5.x the bytecode change 
is in because the Misc/NEWS entry has vanished, apparently in this merge 
commit: 

https://github.com/python/cpython/commit/aa0f9d8f26bbe63adcbce950aaadc844d996e7ac

--
nosy: +mark.dickinson

___
Python tracker 

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



  1   2   >