[issue24614] 404 link in Documenting Python, Style Guide

2015-07-12 Thread Julien Maisonneuve
New submission from Julien Maisonneuve: The link to the Apple Publications Style Guide on this page https://docs.python.org/3.0/documenting/style.html lniks to a 404 page on https://developer.apple.com/

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Mark Dickinson
Mark Dickinson added the comment: Serhiy: there's already a small bias inherent in using `int(random() * n)`, regardless of double rounding, since in general `random()` gives 2**53 equally likely (modulo deficiencies in the source generator) outcomes and `n` need not be a divisor of `2**53`.

[issue24615] 'make install' fails installation of man pages for Python 2.7.10 on Unixware 7.1.4

2015-07-12 Thread Ron Barak
Ron Barak added the comment: EDIT 1 (cut and paste had some extraneous data): I wanted to add Python 2.7 to Unix. I downloaded the sources to the VirtualBox on which the Unix is installed. ./configure is successful. make is successful after I manually applied the changes in

[issue24626] please sync cgi.parse document

2015-07-12 Thread hiroaki itoh
New submission from hiroaki itoh: https://docs.python.org/2/library/cgi.html#cgi.parse (the file defaults to ``sys.stdin`` and environment defaults to ``os.environ``) https://docs.python.org/3/library/cgi.html#cgi.parse (the file defaults to ``sys.stdin``) maby this fix had applied only

[issue24624] Itertools documentation says iterator when iterable is intended

2015-07-12 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24624 ___

[issue24625] py.exe executes #! in windows

2015-07-12 Thread R. David Murray
R. David Murray added the comment: Py.exe does not work exactly like unix. Unless you can point to documentation of py.exe that is wrong or does not cover this, this should be closed as not a bug. -- nosy: +r.david.murray ___ Python tracker

[issue24620] Segfault with nonsensical random state

2015-07-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can't reproduce on 32-bit. -- components: +Extension Modules nosy: +serhiy.storchaka stage: - needs patch type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24620

[issue24623] Parser: broken line numbers for triple-quoted strings

2015-07-12 Thread Stefan Krah
Changes by Stefan Krah ste...@bytereef.org: -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24623 ___ ___

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Tim Peters
Tim Peters added the comment: Hmm. Looks like the answer to my question came before, via Custom collection can has non-standard behavior with negative indices. Really? We're worried about a custom collection that assigns some crazy-ass meaning to a negative index applied to an empty

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: My weak preference is with Martin’s simpler patch and relying on the Readline and the terminal to handle questions of tab stops and copied text. Fair enough. Still, it would be nice to add a test to test_rlcompleter. Does someone want to do this?

[issue24620] Segfault with nonsensical random state

2015-07-12 Thread Stefan Krah
New submission from Stefan Krah: While trying to find a possible cause for #24546, I came across this glitch: Python 3.6.0a0 (default:02b81a82a57d, Jul 12 2015, 20:33:44) [GCC 4.8.4] on linux Type help, copyright, credits or license for more information. import random s = (3,

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Tim Peters
Tim Peters added the comment: I have a question about this new snippet in choice(): +if i == n and n 0: +i = n - 1 What's the purpose of the and n 0 clause? Without it, if i == n == 0 then i will be set to -1, which is just as good as 0 for the purpose of raising

[issue24621] zipfile.BadZipFile: File is not a zip file

2015-07-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24621 ___

[issue24620] Segfault with nonsensical random state

2015-07-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But I can reproduce the crash with other example. import random random.setstate((3, (1,)*624+(-10**9,), None)) random.random() The index attribute can be set to negative value and this causes reading out of the buffer. Here is a patch that fixes this.

[issue23239] SSL match_hostname does not accept IP Address

2015-07-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: ping Sorry. I do not have time currently to tackle this issue. Feel free to submit and/or commit improvements if you feel like it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23239

[issue24587] Tkinter stacking versus focus behavior on Windows

2015-07-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: This tracker is for patches to the CPython repository. That includes tkinter, but does not include tk. Ned, you know much more about OS variations in tk behavior than. What do you think? (See initial post.) What happens on Mac. Should we ask Kevin W.

[issue24136] document PEP 448: unpacking generalization

2015-07-12 Thread Konstantin Molchanov
Changes by Konstantin Molchanov moiga...@live.com: Added file: http://bugs.python.org/file39919/replace_sequence_with_iterable.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24136 ___

[issue24136] document PEP 448: unpacking generalization

2015-07-12 Thread Konstantin Molchanov
Konstantin Molchanov added the comment: I've updated the Calls syntax reference in reference/expressions and the assignment object description in reference/simple_stmts. Please tell me if I'm generally doing OK. If I'm not, please guide me to the right direction. -- Added file:

[issue24621] zipfile.BadZipFile: File is not a zip file

2015-07-12 Thread Yasar Luqman Ahmed
New submission from Yasar Luqman Ahmed: I have a zip-file that can be opened/extracted with 7zip but gives an error when I try work with it in python: Py2 (2.7.3 / Linux/Debian7): Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.7/zipfile.py, line 714,

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2015-07-12 Thread Stefan Krah
New submission from Stefan Krah: ELLIPSIS and RARROW are missing in EXACT_TOKEN_TYPES. Patch attached. -- files: tokenize.diff keywords: patch messages: 246663 nosy: meador.inge, skrah priority: normal severity: normal status: open title: tokenize.py: missing EXACT_TOKEN_TYPES Added

[issue23220] Documents input/output effects of how IDLE runs user code

2015-07-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: OK. Both are true for backspace ('\b') and return ('\r'). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23220 ___

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Tim Peters
Tim Peters added the comment: [Serhiy Storchaka] ... I want to say that double rounding causes not only bias from ideal distribution, but a difference between platforms That's so, but not too surprising. On those platforms users will see differences between primitive floating addition and

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file39903/handle_double_rounding.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24567

[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik
Joe Jevnik added the comment: updating to address the docs and order of assertions -- Added file: http://bugs.python.org/file39904/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: Removed file: http://bugs.python.org/file39903/handle_double_rounding.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24567 ___

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: Added file: http://bugs.python.org/file39905/handle_double_rounding2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24567 ___

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Unfortunately a link to Rietveld is not available for review and inlined comments. In sample() the selected set can be initialized to {n} to avoid additional checks in the loop for large population. In the branch for small population, non-empty pool can be

[issue24379] operator.subscript

2015-07-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm with Martin about tests. Only one assertion per special case is needed, no need to write exponential number of combinations. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik
Joe Jevnik added the comment: is it normal to get a lot of 500s when using the review system? -- Added file: http://bugs.python.org/file39906/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379

[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik
Changes by Joe Jevnik j...@quantopian.com: Added file: http://bugs.python.org/file39907/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___

[issue24623] Parser: broken line numbers for triple-quoted strings

2015-07-12 Thread Stefan Krah
New submission from Stefan Krah: IMO the string should start at lineno=1, col_offset=0. $ ./python Python 3.6.0a0 (default:02b81a82a57d, Jul 12 2015, 20:33:44) [GCC 4.8.4] on linux Type help, copyright, credits or license for more information. import ast a = ast.parse('''xxx ... yyy ...

[issue24620] Segfault with nonsensical random state

2015-07-12 Thread Stefan Krah
Stefan Krah added the comment: I think it's just a matter of checking for self-index = N in setstate(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24620 ___

[issue24624] Itertools documentation says iterator when iterable is intended

2015-07-12 Thread Neil Girdhar
New submission from Neil Girdhar: In the description of the consume recipe: def consume(iterator, n): Advance the iterator n-steps ahead. If n is none, consume entirely. # Use functions that consume iterators at C speed. if n is None: # feed the entire iterator into a

[issue24553] improve test coverage for subinterpreters

2015-07-12 Thread Nick Coghlan
Nick Coghlan added the comment: As a possible starting point for this, I'll point to https://hg.python.org/cpython/file/02b81a82a57d/Lib/test/__main__.py Now, I'd expected running that in a process that was *already* running regrtest to fail miserably (it would stomp all over itself). But

[issue24624] Itertools documentation says iterator when iterable is intended

2015-07-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Mon, Jul 13, 2015 at 01:37:26AM +, Neil Girdhar wrote: New submission from Neil Girdhar: In the description of the consume recipe: [...] iterator should be replaced with iterable. This function accepts strings for example, which are not

[issue24625] py.exe executes #! in windows

2015-07-12 Thread 진모씨
New submission from 진모씨: Well. A program linked to .py extension in windows (called py.exe) parses hashbang line(#!) and tries to execute program. So hashbang like this: #!/bin/env python doesn't works, and #!calc executes calculator. I guess it is bug. -- components: Windows

[issue24627] Import bsddb result in error on OS X (Python 2.7.10)

2015-07-12 Thread Luke Jang
New submission from Luke Jang: As title. I installed Python using brew. $ python Python 2.7.10 (default, Jul 9 2015, 13:34:07) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type help, copyright, credits or license for more information. import bsddb Traceback (most

[issue24620] Segfault with nonsensical random state

2015-07-12 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24620 ___ ___

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I originally used the {n} approach but it was less clear and it lead to a re-selection rather than undoing the rounding. That would change the output. In normal case j is never equal to n. In very rare cases on platforms with double rounding the

[issue24614] 404 link in Documenting Python, Style Guide

2015-07-12 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report, Julien. The up-to-date version of the document can be found at https://docs.python.org/devguide/documenting.html Also, Python 3.0.1 documentation is really old and I think the The Python documentation should follow the Apple

[issue24616] 'make install' fails installation of man pages for Python 2.7.10 on Unixware 7.1.4

2015-07-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be more helpful if you sent text output instead of graphical screenshot. Just redirect stdout and stderr of the command to the file. make install make_install_fail.txt 21 -- nosy: +serhiy.storchaka

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: In sample() the selected set can be initialized to {n} I originally used the {n} approach but it was less clear and it lead to a re-selection rather than undoing the rounding. That would change the output. I like Tim's suggestion about import-time

[issue24615] 'make install' fails installation of man pages for Python 2.7.10 on Unixware 7.1.4

2015-07-12 Thread Ron Barak
Changes by Ron Barak bugs_python_org.comve...@9ox.net: -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24615 ___

[issue24615] 'make install' fails installation of man pages for Python 2.7.10 on Unixware 7.1.4

2015-07-12 Thread Ron Barak
New submission from Ron Barak: I wanted to add Python 2.7 to Unix. I downloaded the sources to the VirtualBox on which the Unix is installed. ./configure is successful. make is successful after I manually applied the changes in http://bugs.python.org/issue24611 However, 'make install' fails

[issue24615] 'make install' fails installation of man pages for Python 2.7.10 on Unixware 7.1.4

2015-07-12 Thread Ron Barak
Changes by Ron Barak bugs_python_org.comve...@9ox.net: -- components: +Installation -Build ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24615 ___

[issue24611] Compiling Python 2.7.10 Error on Unixware 7.1.4

2015-07-12 Thread Ron Barak
Ron Barak added the comment: I tried to apply the patch. Alas, I get an Hmm... I can't seem to find a patch in there anywhere. error. See attached screenshot. Did I apply the patch incorrectly? -- Added file: http://bugs.python.org/file39909/issue24611.PNG

[issue24611] Compiling Python 2.7.10 Error on Unixware 7.1.4

2015-07-12 Thread Ron Barak
Ron Barak added the comment: When I try to apply the patch manually, namely - editing Modules/posixmodule.c, and moving the #endif a few lines up, the make finishes correctly. So, the patch does work: I'm probably not applying it correctly. Could you point to my error in applying the patch?

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm aware of issue 23974. But I want to say that double rounding causes not only bias from ideal distribution, but a difference between platforms. The result of sample() (with the same seed) can vary between platforms. --

[issue24611] Compiling Python 2.7.10 Error on Unixware 7.1.4

2015-07-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset d2b8354e87f5 by Serhiy Storchaka in branch '2.7': Issue #24611: Fixed compiling the posix module on non-Windows platforms https://hg.python.org/cpython/rev/d2b8354e87f5 -- nosy: +python-dev ___ Python

[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik
Changes by Joe Jevnik j...@quantopian.com: Added file: http://bugs.python.org/file39913/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___

[issue24616] 'make install' fails installation of man pages for Python 2.7.10 on Unixware 7.1.4

2015-07-12 Thread Ron Barak
New submission from Ron Barak: I wanted to add Python 2.7 to Unix. I downloaded the sources to the VirtualBox on which the Unix is installed. ./configure is successful. make is successful after I manually applied the changes in http://bugs.python.org/issue24611 However, 'make install' fails

[issue4963] mimetypes.guess_extension result changes after mimetypes.init()

2015-07-12 Thread Julian Sivertsen
Julian Sivertsen added the comment: I bumped into a similar issue with mimetypes.guess_extension on Arch Linux 64-bit in February. The behavior is still present in python 3.4.3. $ python test.py .htm $ python test.py .html $ cat test.py from mimetypes import guess_extension

[issue24611] Compiling Python 2.7.10 Error on Unixware 7.1.4

2015-07-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24611 ___

[issue24611] Compiling Python 2.7.10 Error on Unixware 7.1.4

2015-07-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not experienced with Unixware's version of the patch (perhaps it differs from Linux version), but try to use the -p1 option. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24611

[issue24618] Invalid read in PyCode_New

2015-07-12 Thread Brad Larsen
New submission from Brad Larsen: `PyCode_New` can read invalid heap memory. File Objects/codeobject.c: PyCodeObject * PyCode_New(int argcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names,

[issue24617] os.makedirs()'s [mode] not correct

2015-07-12 Thread John Jones
New submission from John Jones: os.makedirs() gives the optional variable mode to set the permissions on the directories it creates. While it seems to work for all triplet octal values (777,755,etc) it doesn't seem to work on values with the sticky bit (1777,1755,etc) I know that to set the

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Stefan Krah
Stefan Krah added the comment: The double rounding problem even occurs between different versions of gcc. I think ultimately we should put our foot down and ship with sse2 enabled (not possible for 2.7 though, unless an LTS-PEP emerges). If distributions want to break that, it's their business.

[issue24617] os.makedirs()'s [mode] not correct

2015-07-12 Thread eryksun
eryksun added the comment: This is not a bug, but perhaps the documentation could further clarify that the set of valid values for the mode parameter is platform dependent. The [POSIX specification][1] for mkdir() states that [w]hen bits in mode other than the file permission bits are set,

[issue24619] async/await parser issues

2015-07-12 Thread Stefan Krah
New submission from Stefan Krah: If I understand the reference manual correctly, these should probably be rejected by the compiler: async def f(): ... def g(): pass ... async = 10 ... async def f(): ... def async(): ... pass ... async def f(): async = 10 ... async def

[issue24616] 'make install' fails installation of man pages for Python 2.7.10 on Unixware 7.1.4

2015-07-12 Thread Ron Barak
Ron Barak added the comment: @Serhiy, Not only would posting text be clearer, but much easier. Alas, the Unixware I use is on a VirtualBox, and VitualBox does not support Guest Extension on Unixware - which means that neither cut-and-paste nor sharing host filesystem are possible. So, unless

[issue24618] Invalid read in PyCode_New

2015-07-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24618 ___ ___

[issue24567] random.choice IndexError due to double-rounding

2015-07-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think ultimately we should put our foot down and ship with sse2 enabled That's good for x86 but that wouldn't solve the issue if it exists on other archs. I trust Raymond to come up with an acceptable solution; though I think it would be good to add a