[issue29832] Don't refer to getsockaddrarg in error messages

2017-03-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: getsockaddrarg() is an internal C function in the socket module implementation used in a number of socket methods (bind(), connect(), connect_ex(), sendto(), sendmsg()) for creating C structure sock_addr_t from Python tuple. Error messages raised when pass

[issue29832] Don't refer to getsockaddrarg in error messages

2017-03-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +564 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue29829] Documentation lacks clear warning of subprocess issue with pythonw

2017-03-16 Thread Eryk Sun
Eryk Sun added the comment: An exception (not a crash) is possible if a standard handle is invalid and a Popen call tries to replace one or two of the other standard handles (e.g. stdin is invalid and you pass the argument stdout=PIPE). Note that subprocess uses the standard handles directly,

[issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad

2017-03-16 Thread Xiang Zhang
Changes by Xiang Zhang : -- keywords: +easy stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue29820] Broken link to "GUI Programming with Python: QT Edition" book

2017-03-16 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks Marco :) I merged your PR, and backported to 3.5 and 3.6. There are some merge conflict with the 2.7 branch, so I decided not to bother with it. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed versions: -Python 2

[issue29820] Broken link to "GUI Programming with Python: QT Edition" book

2017-03-16 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +562 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue29820] Broken link to "GUI Programming with Python: QT Edition" book

2017-03-16 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +563 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue29831] os.path.exists seems can not recgnize "~"

2017-03-16 Thread Martin Panter
Martin Panter added the comment: I agree with Josh. This is how it is supposed to work. os.system calls the shell (e.g. Bash) rather than running the "ls" program directly. Unix shells translate "~" to the home directory (as well as translating a lot of other stuff, e.g. spaces to separate CLI

[issue29831] os.path.exists seems can not recgnize "~"

2017-03-16 Thread Josh Rosenberg
Josh Rosenberg added the comment: That's because os.system is executing the command in a shell (which expands ~). Without shell support, ~ doesn't mean anything unless used with the APIs that specifically support it (e.g. os.path.expanduser). You wanted os.path.exists(os.path.expanduser('~/.zs

[issue29831] os.path.exists seems can not recgnize "~"

2017-03-16 Thread quanyechavshuo
New submission from quanyechavshuo: os.system is ok to recgnize "~",but os.path.exists can not recgnize "~". eg: #1.py: import os os.system("ls -al ~/.zshrc") python3 1.py output: -rw-r--r-- 1 root wheel 5391 3 14 18:12 /var/root/.zshrc #2.py: import os a=os.path.exists("~/.zshrc") prin

[issue29826] " don't work on Mac under IDLE

2017-03-16 Thread Ned Deily
Ned Deily added the comment: > Is this restriction correct? Yes -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue29826] " don't work on Mac under IDLE

2017-03-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: Marco, did you see this message? (r"WARNING: The version of Tcl/Tk ({0}) in use may" r" be unstable.\n" r"Visit http://www.python.org/download/mac/tcltk/"; r" for current information.".format(patchlevel)) Or is it somehow lost? Ned, the version check for

[issue29830] pyexpat.errors doesn't have __spec__ and __loader__ set

2017-03-16 Thread Manuel Jacob
New submission from Manuel Jacob: The same applies to pyexpat.model. It seems like pyexpat is the only builtin module which has submodules (errors, model). Normally, as I understand it, the module gets imported given a spec and the import machinery ensures that this spec ends up in the __spec

[issue29826] " don't work on Mac under IDLE

2017-03-16 Thread Ned Deily
Ned Deily added the comment: Yes, this is a symptom of using the default Apple-supplied macOS Tcl/Tk. See https://www.python.org/download/mac/tcltk/ for more information as the warning in IDLE suggests. If you are using Python 3.6.0 downloaded from python.org, the simple solution is to insta

[issue29828] Allow registering after-fork initializers in multiprocessing

2017-03-16 Thread Yury Selivanov
Yury Selivanov added the comment: BTW, why can't you use `pthread_atfork` in numpy? -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue29777] argparse arguments in main parser hide an argument in subparser

2017-03-16 Thread Alan Evangelista
Alan Evangelista added the comment: s/Python 2.6/Python 2/ in last comment -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue29828] Allow registering after-fork initializers in multiprocessing

2017-03-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: The use case is quite clear here. The specific need to re-seed the Numpy PRNG has already come up in two different projects I work on: Numba and Dask. I wouldn't be surprised if other libraries have similar needs. If you want a reproducible RNG sequence, you

[issue29777] argparse arguments in main parser hide an argument in subparser

2017-03-16 Thread Alan Evangelista
Alan Evangelista added the comment: PA> In http://bugs.python.org/issue14910#msg204678 I suggest a subclassing patch that might work with Py2. This solves my particular case. I do not use any argument with action='count', so the regression introduced by the new option does not affect me. Thank

[issue29828] Allow registering after-fork initializers in multiprocessing

2017-03-16 Thread Nathaniel Smith
Nathaniel Smith added the comment: I think ideally on numpy's end we would reseed iff the RNG was unseeded. Now that I think about it I'm a little surprised that we haven't had more complaints about this, so I guess it's not a super urgent issue, but that would be an improvement over the statu

[issue29820] Broken link to "GUI Programming with Python: QT Edition" book

2017-03-16 Thread Marco Buttu
Changes by Marco Buttu : -- pull_requests: +561 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue29828] Allow registering after-fork initializers in multiprocessing

2017-03-16 Thread Davin Potts
Davin Potts added the comment: Having a read through issue16500 and issue6721, I worry that this could again become bogged down with similar concerns. With the specific example of NumPy, I am not sure I would want its random number generator to be reseeded with each forked process. There are

[issue29829] Documentation lacks clear warning of subprocess issue with pythonw

2017-03-16 Thread R. David Murray
R. David Murray added the comment: A warning is not appropriate (we reserve those for things that are security related, pretty much). A sentence might be, though. For example, we could change the initial discussion of the run function to say: This does not capture stdout or stderr by defau

[issue29828] Allow registering after-fork initializers in multiprocessing

2017-03-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: That issue seems to have stalled as it seems to have focussed on low-level APIs, and also because it is proposing a new module with the API question that entails. Another possible stance is that os.fork() should be left as-is, as a low-level primitive, and th

[issue28261] wrong error messages when using PyArg_ParseTuple to parse normal tuples

2017-03-16 Thread Oren Milman
Oren Milman added the comment: as Serhiy pointed out in PR 668, here are some more functions that produce the same kind of wrong error messages: - Modules/timemodule.c - gettmarg() - Modules/socketmodule.c: * getsockaddrarg() * socket_getnameinfo() ISTM that searching for

[issue29828] Allow registering after-fork initializers in multiprocessing

2017-03-16 Thread Yury Selivanov
Yury Selivanov added the comment: Maybe a better way would be to proceed with http://bugs.python.org/issue16500? -- nosy: +yselivanov ___ Python tracker ___ _

[issue29636] Specifying indent in the json.tool command

2017-03-16 Thread Bob Ippolito
Bob Ippolito added the comment: Probably the best thing we could do here is to mirror the options available in similar tools, such as jq: https://stedolan.github.io/jq/manual/#Invokingjq The relevant options here would be: --indent --tab --compact-output --sort-keys The defaul

[issue29820] Broken link to "GUI Programming with Python: QT Edition" book

2017-03-16 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks, Marco. That sounds good. Let's just remove the reference to the books from both PyQt and wxPython. -- keywords: +easy stage: -> needs patch ___ Python tracker __

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2017-03-16 Thread Charalampos Stratakis
Charalampos Stratakis added the comment: In order to reproduce: Apply the python.patch from bz1268226_reproducer2.tar.gz Compile python Run the reproduce4.py from bz1268226_reproducer2.tar.gz As indicated by the reproducer, the status returned by os.wait() for the child is 139. I will refin

[issue29829] Documentation lacks clear warning of subprocess issue with pythonw

2017-03-16 Thread Steve Barnes
New submission from Steve Barnes: When running under pythonw, or pyinstaller with the -w flag, modules that use subprocess calls such as popen, run, etc. will crash if the default `stdout=None, stderr=None` behaviour is used rather than PIPE. This is an obscure problem which is very hard to de

[issue29828] Allow registering after-fork initializers in multiprocessing

2017-03-16 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +njs ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.o

[issue29828] Allow registering after-fork initializers in multiprocessing

2017-03-16 Thread Antoine Pitrou
New submission from Antoine Pitrou: Currently, multiprocessing has hard-coded logic to re-seed the Python random generator (in the random module) whenever a process is forked. This is present in two places: `Popen._launch` in `popen_fork.py` and `serve_one` in `forkserver.py` (for the "fork"

[issue29820] Broken link to "GUI Programming with Python: QT Edition" book

2017-03-16 Thread Marco Buttu
Marco Buttu added the comment: Hi Mariatta, all the other seealso entries (PyGObject, PySide, ...) have references to some specific books and tutorials. No one has a reference to the wiki, maybe because there is already a reference to it (at the end of the page). IMHO we can keep the PyQt de

[issue29826] " don't work on Mac under IDLE

2017-03-16 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: -> terry.reedy components: +IDLE nosy: +terry.reedy title: " don't work on Mac -> " don't work on Mac under IDLE ___ Python tracker ___ __

[issue29827] os.path.exists() returns False for certain file name

2017-03-16 Thread Eryk Sun
Eryk Sun added the comment: In a string literal, '\t' represents a tab character (ordinal 9). Windows filenames cannot contain control characters [1], i.e. ordinals 1-31. For path literals I recommend using forward slashes and normalizing via os.path.normpath, e.g. filepath = os.path.normpath

[issue29827] os.path.exists() returns False for certain file name

2017-03-16 Thread Marko Mavrinac
Marko Mavrinac added the comment: I am sorry, I didn't realize \t affected how the path was recognized. -- ___ Python tracker ___ ___

[issue29827] os.path.exists() returns False for certain file name

2017-03-16 Thread Marko Mavrinac
New submission from Marko Mavrinac: I have two files in two different folders, both on desktop. If I try using os.path.exists() on both of them, it returns True for one file and False for the other file. After renaming file that I got False from, I get returned True and when I rename it back, i

[issue6721] Locks in the standard library should be sanitized on fork

2017-03-16 Thread Daniel Birnstiel
Daniel Birnstiel added the comment: Currently using Python 3.6.0 (default, Mar 4 2017, 12:32:34) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin > So, somehow the print() statement is blocking, which I have /no/ idea how to > go about debugging. I assume there's a lock /i

[issue29636] Specifying indent in the json.tool command

2017-03-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It's not just the support burden. It is also a burden of learning and remembering new API. The support burden itself is not tiny too. It includes careful designing, writing the implementation and test (the more options you have the more combinations you nee

[issue29636] Specifying indent in the json.tool command

2017-03-16 Thread Daniel Himmelstein
Daniel Himmelstein added the comment: @serhiy.storchaka I totally understand the desire to keep json.tool simple. However, given the description of json.tool in the documentation (below), I think an indentation option is within scope: > The json.tool module provides a simple command line inter

[issue29636] Specifying indent in the json.tool command

2017-03-16 Thread R. David Murray
R. David Murray added the comment: Easier, but if we do it in the tool, then it is done for everyone and they don't *each* have to spend that "less time" writing their own script. And --indent and --compact are both useful for debugging/hand testing, since it allows you to generate the input

[issue29636] Specifying indent in the json.tool command

2017-03-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not particularly interested in this feature. Adding two or three options looks excessive. Python is a programming language and it is easy to write a simple script for your needs. Much easier than implement the general command line interface that supports

[issue19521] Parallel build race condition on AIX since python-2.7

2017-03-16 Thread Michael Haubenwallner
Changes by Michael Haubenwallner : -- pull_requests: +560 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue29826] " don't work on Mac

2017-03-16 Thread Marco Viscito
New submission from Marco Viscito: When typing the ' key or the " key on the IDLE Python application for macOS, the application. I think it might have something to do with that beta version of Tcl/Tk (8.5.9) as Python says it is 'unstable'. -- files: Screen Shot 2017-03-16 at 09.34.26.

[issue29825] PyFunction_New() not validate code object

2017-03-16 Thread LCatro
New submission from LCatro: PyFunction_New() not validate code object ,so we can make a string object to fake code object This is Python ByteCode : LOAD_CONST '\x41\x41\x41\x41' MAKE_FUNCTION 0 in source code ,we can see that string object trace to variant

[issue29824] Hostname validation in SSL match_hostname()

2017-03-16 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +alex, dstufft, janssen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29824] Hostname validation in SSL match_hostname()

2017-03-16 Thread Christian Heimes
Christian Heimes added the comment: I don't see 1) as a problem. You won't be able to resolve these names in DNS, would you? Regarding 2). Yes, it would be beneficial to have more elaborate checks to protect against wildcard attacks like *.com. However Python is not a browser. It's really har

[issue29824] Hostname validation in SSL match_hostname()

2017-03-16 Thread Suphannee
New submission from Suphannee: 1. Allowing attempting to match invalid hostname According to domain name specification in RFC 1035, only alphanumeric, dot and hyphen are valid characters in domain name. We observe that the function match_hostname() in Lib/ssl.py allows other special characters (