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

2015-07-12 Thread Tim Smith
Tim Smith added the comment: Hi; I'm a Homebrew maintainer. Please open an issue at https://github.com/Homebrew/homebrew. -- nosy: +tdsmith ___ Python tracker ___ __

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

2015-07-12 Thread Ned Deily
Ned Deily added the comment: You are using a third-party build of Python from the homebrew package manager. You probably need to install additional brew packages to provide bsddb support so you should ask somewhere else for help with that, perhaps stackoverflow.com. -- resolution: ->

[issue24625] py.exe executes #! in windows

2015-07-12 Thread eryksun
eryksun added the comment: To support cross-platform shebangs, the launcher special-cases the following virtual commands [1]: /usr/bin/env python /usr/bin/python /usr/local/bin/python python The "env" virtual command searches the PATH environment variable. Note that it's /usr/

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

2015-07-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Macintosh nosy: +ned.deily, ronaldoussoren ___ Python tracker ___ ___ Python-bugs-list m

[issue24624] Itertools documentation says iterator when iterable is intended

2015-07-12 Thread Neil Girdhar
Neil Girdhar added the comment: Ah, good point. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue24620] Segfault with nonsensical random state

2015-07-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

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

[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

[issue24624] Itertools documentation says iterator when iterable is intended

2015-07-12 Thread R. David Murray
Changes by R. David Murray : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python

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

[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 messages:

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

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

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

[issue24136] document PEP 448: unpacking generalization

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

[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: http:/

[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

[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 ___ ___ Python-bug

[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. about

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

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

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

[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 ___ __

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

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

2015-07-12 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[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('''"""xx

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

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

2015-07-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list ma

[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 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 "", line 1, in File "/usr/lib/python2.7/zipfile.py", line 714, in __ini

[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, (9

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

[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, th

[issue24618] Invalid read in PyCode_New

2015-07-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

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

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

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

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

[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 2>&1 -- nosy: +serhiy.storchaka ___

[issue24611] Compiling Python 2.7.10 Error on Unixware 7.1.4

2015-07-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

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

[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik
Changes by Joe Jevnik : Added file: http://bugs.python.org/file39913/operator_subscript_pyonly.patch ___ Python tracker ___ ___ Python-bugs-li

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

[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. -- ___

[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 print(guess_extens

[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 : -- resolution: -> duplicate status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Un

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

[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 http://bugs.python.

[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 : -- components: +Installation -Build ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

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

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

[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

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

[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`.

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

[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/ (https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/APStyleGui

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

[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik
Changes by Joe Jevnik : Added file: http://bugs.python.org/file39907/operator_subscript_pyonly.patch ___ Python tracker ___ ___ Python-bugs-li

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

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