[issue29125] Shell injection via TIX_LIBRARY when using tkinter.tix

2017-01-15 Thread Larry Hastings
Larry Hastings added the comment: If it "has a small attack surface" and affects "a very small number of applications", I don't think it's a release blocker. Demoting to "high" priority, which will permit me to release 3.5.3. -- priority: release blocker -> high

[issue13886] readline-related test_builtin failure

2017-01-15 Thread Martin Panter
Martin Panter added the comment: V3 of my patch skips the Readline tests in cases involving non-ASCII bytes when the locale seen by Readline would be ASCII. Readline may translate the non-ASCII bytes to escape sequences, and treat them as special Meta (Alt) key combinations. This behaviour

[issue29235] Allow profile/cProfile to be used as context managers

2017-01-15 Thread Thane Brimhall
Thane Brimhall added the comment: I've signed the agreement. I will do the necessary research to figure out how to do unit tests and documentation updates. I should also mention that while maintaining API-compatibility with `profile` was a stated goal, it turns out that the pure-python

[issue29279] --with-pydebug optimizes too much

2017-01-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: > You can override CFLAGS when default option is not fit for you. I concur with INADA and agree that the existing defaults should be left alone because they've worked well for many years and they provide all tolerably fast result for running the entire

[issue29235] Allow profile/cProfile to be used as context managers

2017-01-15 Thread Xiang Zhang
Xiang Zhang added the comment: > I suspect unit tests and documentation updates? Yes. Code alone is not enough. It's better to have tests and documentation. Also, it's appreciated to sign the CLA: https://www.python.org/psf/contrib/contrib-form/. :-) -- nosy: +xiang.zhang stage:

[issue29235] Allow profile/cProfile to be used as context managers

2017-01-15 Thread Thane Brimhall
Thane Brimhall added the comment: So this is my first time contributing to Python, but here's a (trivial) patch for this issue. Let me know what else is required to make this happen. I suspect unit tests and documentation updates? -- keywords: +patch Added file:

[issue26110] Speedup method calls 1.2x

2017-01-15 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file46294/call-method-doc5.patch ___ Python tracker ___

[issue29125] Shell injection via TIX_LIBRARY when using tkinter.tix

2017-01-15 Thread Larry Hastings
Larry Hastings added the comment: I'll make you a deal. If you check this in in the next 3 hours, I'll cherry-pick it for 3.5.3. Otherwise I don't want to hold up the release. To be honest I'm not sure why it's marked as "release blocker" if it's "low severity". --

[issue28997] test_readline.test_nonascii fails on Android

2017-01-15 Thread Martin Panter
Martin Panter added the comment: So the problem seems to be that Python assumes Readline’s encoding is UTF-8, but Readline actually uses ASCII (depending on locale variables). The code at the start of the test is supposed to catch when add_history() calls PyUnicode_EncodeLocale() and fails.

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: OK, I will make a PR to typing adding a folder (as it is done for mypy_extensions) with a basic set of runtime type inspection functions. -- ___ Python tracker

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: Up to you, but the latter might make it clearer that the two are to be kept in sync. -- ___ Python tracker ___

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: OK, I agree. How then it should be done logistically? Should I just make a separate repo on GitHub for this? Or will it be inside typing (like mypy_extesions is inside mypy) but published on PyPI separately? --

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: I think it should be separate from mypy_extensions, since it's not even related to mypy. Regarding typing.re and typing.io, typing.inspect would be a typed version of the inspect module, so that's not quite the same. (Though I consider typing.re/io mistakes

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I have a similar idea. We already have mypy_extensions for runtime counterparts of experimental features. However, the runtime inspections are not related to mypy, so that I am not sure. I am just a bit worried there will be to many things to keep in mind/in

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: Posting to python-dev would probably cause more friction than a PR for the PEPs repo. But maybe the best way to do this is to use a third party module with a proposed API? E.g. typing_inspect. We could then iterate quickly on the design and implementation

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Maybe a proposal should be discussed as an addendum to PEP 484? Or would Mark Shannon reject that? On one hand, I would like to involve a wider audience to this discussion. On the other hand, an addition to the PEP could slow things down. Maybe a

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe a proposal should be discussed as an addendum to PEP 484? Or would Mark Shannon reject that? On Sun, Jan 15, 2017 at 2:48 PM, Ivan Levkivskyi wrote: > > Ivan Levkivskyi added the comment: > > > Maybe we need to take a step back

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Maybe we need to take a step back and look at the needs for code that wants > to implement runtime type checking more in general? I would say that the most convenient way for me would be a set of "inspect-style" simple helpers like ``is_union``,

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, let me back-pedal a bit. The situation with Callable is murky, as e.g. isinstance(typing.Tuple[int, int], typing.Callable) returns True. Maybe we need to take a step back and look at the needs for code that wants to implement runtime type checking more

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: This will be a bit unusual since ``isinstance`` is typically called for instances (i.e. not types) as in ``isinstance(func, Callable)``. But on the other hand this is probably what one would expect when one sees ``isinstance(tp, Union)``. Thus I am fine with

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, maybe isinstance(t, Union) should actually be allowed? (Though isinstance(x, Union[int, str]) should not be!) After all we can write isinstance(t, Callable) as well, even though isinstance(x, Callable[[int], int]) is disallowed. --

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-15 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: In principle, such a function could be added if it is not called ``isinstance``. For example, we could add a helper ``is_union(tp)`` (or maybe also ``is_generic(tp)`` etc). Such function(s) will be simple one-liners wrapping private API in a right way (e.g.

[issue29277] os.getcwd failing on LOFS share

2017-01-15 Thread STINNER Victor
STINNER Victor added the comment: When getcwd() fails with ENOENT, os.getcwd() raises OSError(ENOENT). It's expected and not a bug in Python. Please report the issue to LOFS. -- nosy: +haypo resolution: -> not a bug status: open -> closed ___

[issue29277] os.getcwd failing on LOFS share

2017-01-15 Thread miniflow
miniflow added the comment: After performing an strace - it shows that the underlying call to getcwd is indeed returning ENOENT which is not correct. Does this become a libc bug? -- ___ Python tracker

[issue29280] gdbm & ndbm support missing in Windows

2017-01-15 Thread Arthur Vanwalleghen
New submission from Arthur Vanwalleghen: When I tried to work with GDBM and Ndbm files I saw that their supporting modules were not found. This can be verified with Pydoc: Pydoc\Python36-32\lib \dbm(package)\Package Contents\gnu|ndbm ErrorDuringImport: problem in dbm.gnu -

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2017-01-15 Thread INADA Naoki
INADA Naoki added the comment: Serhiy Storchaka, would you review again? Merging unicodeobject.c.v5.patch into default branch was almost straightforward. But there was one place I should rewrite. Here is the part of diff -u v5.patch v6.patch -- is old docstring w/o AC +- is current docstring

[issue29029] Faster positional arguments parsing in PyArg_ParseTupleAndKeywords

2017-01-15 Thread INADA Naoki
INADA Naoki added the comment: LGTM -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2017-01-15 Thread Tal Einat
Tal Einat added the comment: Unfortunately, I won't be able to review this due to lack of time. -- ___ Python tracker ___

[issue29274] Change “tests cases” → “test cases”

2017-01-15 Thread Kushal Das
Kushal Das added the comment: The patch looks good to me. -- nosy: +kushal.das ___ Python tracker ___ ___

[issue29279] --with-pydebug optimizes too much

2017-01-15 Thread INADA Naoki
INADA Naoki added the comment: I feel this is a problem of balance between speed and debugger usability. I prefer default to -Og because: * It's recommended by gcc for this purpose. * --pydebug option is not only for gdb. I use debug build to run various programs with many assertion. You can

[issue26110] Speedup method calls 1.2x

2017-01-15 Thread INADA Naoki
INADA Naoki added the comment: Yury, could you review this? -- ___ Python tracker ___ ___ Python-bugs-list

[issue22302] Windows os.path.isabs UNC path bug

2017-01-15 Thread Eryk Sun
Eryk Sun added the comment: isabs also fails for device paths such as r"\\.\C:", which is an absolute path for opening the C: volume. UNC and device paths (i.e. \\server, \\?, and \\.) should always be considered absolute. Only logical drives (i.e. C:, D:, etc) support drive-relative paths.

[issue29132] shlex.shlex with punctuation_chars and posix doesn't handle punctuation next to quotes

2017-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7e40c940df14 by Vinay Sajip in branch '3.6': Fixed #29132: Updated shlex to work better with punctuation chars in POSIX mode. https://hg.python.org/cpython/rev/7e40c940df14 New changeset c163a76163f7 by Vinay Sajip in branch 'default': Closes

[issue21258] Add __iter__ support for mock_open

2017-01-15 Thread Georg Sauthoff
Georg Sauthoff added the comment: For working around this issue on Python 3.5 it is sufficient to overwrite just the `return_value.__iter__` method of the object returned by `mock_open()` with an iterator that calls the mocked `readline()` method until it returns the empty string. cf. e.g.

[issue29278] Python 3.6 build fails with parallel make

2017-01-15 Thread SilentGhost
SilentGhost added the comment: Can't reproduce this on 3.7, can you supply additional information, such as what exact revision you're trying to build and what gcc version you're using? -- nosy: +SilentGhost ___ Python tracker

[issue21258] Add __iter__ support for mock_open

2017-01-15 Thread Georg Sauthoff
Changes by Georg Sauthoff : -- nosy: +gms ___ Python tracker ___ ___ Python-bugs-list mailing

[issue29279] --with-pydebug optimizes too much

2017-01-15 Thread Arcadiy Ivanov
Arcadiy Ivanov added the comment: gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) Fedora 25 -- ___ Python tracker ___

[issue29279] --with-pydebug optimizes too much

2017-01-15 Thread Arcadiy Ivanov
New submission from Arcadiy Ivanov: Around line 1480 of configure.ac: if test "$Py_DEBUG" = 'true' ; then # Optimization messes up debuggers, so turn it off for # debug builds. if "$CC" -v --help 2>/dev/null |grep -- -Og > /dev/null;

[issue29278] Python 3.6 build fails with parallel make

2017-01-15 Thread INADA Naoki
INADA Naoki added the comment: Isn't it a OOM killer? How much memory your machine has? How about make -j4? (you can use number of cores instead of 4). -- nosy: +inada.naoki ___ Python tracker