[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-26 Thread eryksun
eryksun added the comment: In subprocess.py there's the following code that builds a sequence of potential paths for the executable [1]: executable = os.fsencode(executable) if os.path.dirname(executable): executable_list = (executable,) else: # This matches the beha

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-26 Thread Atsuo Ishimoto
Atsuo Ishimoto added the comment: Okay, so I think this needed to be documented in signal.set_wakeup_fd(). IMO this reduces usefulness of set_wakeup_fd(). If I need to install custom handler by my self, I can write to fd in my own custom handler. And, installing custom handler omits existing

[issue25439] Add type checks to urllib.request.Request

2015-10-26 Thread Martin Panter
Martin Panter added the comment: There is already a check for request.data being str in do_request_(). Maybe it is okay to remove this check; I think it would be equivalent to the new check. Regarding the dict check, here is a strange class that currently works, but would be broken by the patc

[issue25356] Idle (Python 3.4 on Ubuntu) does not allow typing accents

2015-10-26 Thread eryksun
eryksun added the comment: This seems to be a problem with Tk 8.6 when using an international keyboard layout on Linux. I ran the following test.tcl script via wish: text .t pack .t Initially dead keys work, but they stop working if I switch away from the text entry to another window

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-26 Thread Benjamin Peterson
Benjamin Peterson added the comment: Yes, you need to tell the kernel to not ignore SIGWINCH automatically for you. -- nosy: +benjamin.peterson resolution: -> not a bug status: open -> closed ___ Python tracker __

[issue25465] Pickle uses O(n) memory overhead

2015-10-26 Thread Martin Panter
Martin Panter added the comment: Perhaps by OS crash you mean either the Linux out-of-memory (OOM) killer, that takes a hueristic stab at killing the right process, or Linux running almost out of memory, and everything grinding to a halt presumably because each task switch needs to re-read its

[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-10-26 Thread Guido van Rossum
Guido van Rossum added the comment: The issue seems to be the line inst_dict = inst.__dict__ in _Unpickler.load_build(). (I found this out by forcing sys.modules['_pickle'] = None, so the pure-Python pickle.py code gets used.) This leads to a simpler repro: # Use the same clas

[issue16785] Document the fact that constructing OSError with erron returns subclass if possible

2015-10-26 Thread Martin Panter
Martin Panter added the comment: Hopefully revision cb554248ce54 is good enough to close this. The documentation now says ''' The constructor often actually returns a subclass of OSError, as described in “OS exceptions” below. The particular subclass depends on the final “errno” value. This b

[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-10-26 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW the pickle produced looks like this, decoded with pickletools.dis(): 0: \x80 PROTO 3 2: cGLOBAL '__main__ B' 14: qBINPUT 0 16: )EMPTY_TUPLE 17: \x81 NEWOBJ 18: qBINPUT 1 20: }EMPTY_DICT 21: q

[issue25478] Consider adding a normalize() method to collections.Counter()

2015-10-26 Thread Josh Rosenberg
Josh Rosenberg added the comment: Counter is documented as being primarily intended for integer counts. While you can use them with floats, I'm not sure they're the right data type for this use case. Having some methods that only make sense with floats, and others (like elements) that only mak

[issue20519] Replace uuid ctypes usage with an extension module.

2015-10-26 Thread STINNER Victor
STINNER Victor added the comment: New review (question for Windows). -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-10-26 Thread Martin Panter
Martin Panter added the comment: I will leave opening a bug for the args issue for someone else. But if you come up with a sensible solution or find out all the details, I am happy to help write up or review the documentation changes. -- resolution: -> fixed stage: commit review -> re

[issue25487] imp module DeprecationWarning in test suite

2015-10-26 Thread Martin Panter
New submission from Martin Panter: I typically run the test suite with the “python -bWall” options enabled, and there is a new warning. I suspect it is a result of the DeprecationWarning upgrade in revision 5877c191b76e. When -Werror is enabled it causes test failure. The fix is probably pret

[issue25154] Drop the pyvenv script

2015-10-26 Thread Brett Cannon
Brett Cannon added the comment: Took Eric's advice in 8828d7847e92 as well as actually tested the results this time. :P -- status: open -> closed ___ Python tracker ___

[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-10-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset cb554248ce54 by Martin Panter in branch '3.4': Issue #23391: Restore OSError constructor argument documentation https://hg.python.org/cpython/rev/cb554248ce54 New changeset 7b1a9a12eb77 by Martin Panter in branch '3.5': Issue #23391: Merge OSError d

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-26 Thread Eric V. Smith
Eric V. Smith added the comment: This patch addresses Larry's review, plus bumps the bytecode magic number. -- ___ Python tracker ___

[issue25486] Resurrect inspect.getargspec() in 3.6

2015-10-26 Thread Ned Batchelder
Changes by Ned Batchelder : -- nosy: +nedbat ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue25432] isinstance documentation: explain behavior when type is a tuple

2015-10-26 Thread R. David Murray
R. David Murray added the comment: Sure, that's fine with me. I was trying to minimize words, but clarity is good. -- ___ Python tracker ___

[issue25432] isinstance documentation: explain behavior when type is a tuple

2015-10-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: David, if you are suggesting that the initial negative clause of "If classinfo is not a class (type object)" is not needed, I agree. If classinfo is a tuple, is is not a class. 'list of types' has to be 'tuple of types'. I think 'match' needs to be expanded

[issue25432] isinstance documentation: explain behavior when type is a tuple

2015-10-26 Thread Felipe Volpone
Felipe Volpone added the comment: r.david.murray: I liked your way. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue25432] isinstance documentation: explain behavior when type is a tuple

2015-10-26 Thread R. David Murray
R. David Murray added the comment: The fact that nested tuples are accepted is just bizarre, IMO :(. It could say something like "If classinfo is a (possibly nested) list of types, return True if any of the types match." -- ___ Python tracker

[issue23749] asyncio missing wrap_socket (starttls)

2015-10-26 Thread Yury Selivanov
Yury Selivanov added the comment: Guido, Victor, Please find attached a first draft of the patch. It's a very early attempt (i.e. I'm not including unit tests/docstrings), and its primary purpose is to gather initial feedback. Some points: 1. As discussed earlier, the primary API point is n

[issue20438] inspect: Deprecate getfullargspec?

2015-10-26 Thread Yury Selivanov
Yury Selivanov added the comment: > The thing is, we've adopted a policy that if something exists in python2.7 we > shouldn't delete it in python3 until after 2.7 is officially out of > maintenance (at the earliest), in order to facilitate single-source porting > to python3. That policy was a

[issue20438] inspect: Deprecate getfullargspec?

2015-10-26 Thread Yury Selivanov
Yury Selivanov added the comment: > This is the situation I am in: coverage.py uses getargspec in a very simple > way in its tooling. I support 2.7 and 3.5, so I have to do this: try: getargspec = inspect.getfullargspec except AttributeError: getargspec = inspect.getarg

[issue25486] Resurrect inspect.getargspec() in 3.6

2015-10-26 Thread Yury Selivanov
New submission from Yury Selivanov: See issue #20438 for more details -- components: Library (Lib) messages: 253499 nosy: yselivanov priority: normal severity: normal stage: needs patch status: open title: Resurrect inspect.getargspec() in 3.6 type: behavior versions: Python 3.6 ___

[issue23749] asyncio missing wrap_socket (starttls)

2015-10-26 Thread Yury Selivanov
Yury Selivanov added the comment: Here's an example client implementation with writer.start_tls() (taken from my debug code): @asyncio.coroutine def client(addr): reader, writer = yield from asyncio.open_connection( *addr, loop=loop) prin

[issue25467] Put “deprecated” warnings first

2015-10-26 Thread Ezio Melotti
Ezio Melotti added the comment: > I don't want to be distracted by "new in 3.1" tags when reading > the 3.6 documentation. This is true, but on the other hand you might want to see the [new in 3.4] while looking at 3.6 docs and working on a program that must support Python 3.3+. Anyway we can

[issue25432] isinstance documentation: explain behavior when type is a tuple

2015-10-26 Thread feliep
feliep added the comment: I think that the following part could replace the part of the other text that's between ###. It's more objective and easier to understand. classinfo may could be a tuple of type objects, or may contains others tuples that contains type objects (other sequence types a

[issue20519] Replace uuid ctypes usage with an extension module.

2015-10-26 Thread Gustavo J. A. M. Carneiro
Gustavo J. A. M. Carneiro added the comment: One issue of note is regarding generate_time(). Originally I found ctypes bindings for this function, so I wrapped it as well in the extension module. However, it doesn't appear to be used... -- ___ Pyt

[issue20519] Replace uuid ctypes usage with an extension module.

2015-10-26 Thread Gustavo J. A. M. Carneiro
Gustavo J. A. M. Carneiro added the comment: This patch fixes the Mac OS X issue @haypo pointed out. -- Added file: http://bugs.python.org/file40865/issue20519_10941v2.diff ___ Python tracker __

[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-26 Thread R. David Murray
R. David Murray added the comment: What do you mean by older obsolete error code? It sounds like the problem is that user2 doesn't have read (or execute?) permission for that directory in the path. I'd think it would just skip it in that case, though. I don't have time to run tests myself r

[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-26 Thread jaystrict
jaystrict added the comment: Narrowing it down further: In $PATH there is a subdirectory of /home/user1. PATH="/home/user1/bin:/usr/local/sbin:/usr/local/bin:/usr/bin" Doing an strace on the example above shows the line stat("/home/user1/bin/python", 0x7fff9d365bb0) = -1 EACCES (Permission deni

[issue25467] Put “deprecated” warnings first

2015-10-26 Thread R. David Murray
R. David Murray added the comment: Insert "in my opinion" into that sentence. I don't want to be distracted by "new in 3.1" tags when reading the 3.6 documentation. It isn't new from my POV :) -- ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-26 Thread desbma
New submission from desbma: telnetlib.Telnet could have a context manager to call close() automatically. I can provide a patch if the idea is approved, although I have never contributed to Python. -- components: Library (Lib) messages: 253489 nosy: desbma priority: normal severity: nor

[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-26 Thread jaystrict
jaystrict added the comment: I just found that a "chmod o+x /home/user1" fixes the problem in the sense that now a FileNotFoundError is thrown. So I am very certain that you can reproduce this by making your home directory non-executable. Could it be that python tries to access the "original"

[issue25467] Put “deprecated” warnings first

2015-10-26 Thread Tony R.
Tony R. added the comment: > On Oct 26, 2015, at 1:49 PM, Ezio Melotti wrote: > > Not sure if there's a clever way to do it though (maybe a CSS class can be > added to the directives and the labels can be added with CSS :after). I was thinking something along these lines. Other possibilities

[issue25467] Put “deprecated” warnings first

2015-10-26 Thread Ezio Melotti
Ezio Melotti added the comment: > Note that the 'new' label should only appear for stuff that is new > in that release. This is not a problem if it says [new in x.y] explicitly. This way for each version-added/version-changed/deprecated/deprecated-remove directive we will also have a label.

[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-26 Thread jaystrict
jaystrict added the comment: I just tried the same thing in /home/user2 which is the home of user2 and in /. In both directories the result is the PermissionError. So the cause is not the CWD. -- ___ Python tracker

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-26 Thread Eric V. Smith
Eric V. Smith added the comment: Small cleanups. Fixed a bug in PyCompile_OpcodeStackEffect. -- Added file: http://bugs.python.org/file40864/format-opcode-1.diff ___ Python tracker _

[issue25467] Put “deprecated” warnings first

2015-10-26 Thread R. David Murray
R. David Murray added the comment: I think Ezio's idea is great. I would not want to see the notices at the top, but a label would make things clear (and the label could be hyperlinked to the note, since sometimes they are a bit of a distance away). Someone has to figure out the Sphinx progra

[issue25484] Operator issue with "in" on same level and preceding ==

2015-10-26 Thread Ezio Melotti
Ezio Melotti added the comment: https://docs.python.org/3/reference/expressions.html#comparisons says that "a op1 b op2 c ... y opN z is equivalent to a op1 b and b op2 c and ... y opN z" and this explains the "unexpected" result: >>> 1 in [1] == True False >>> 1 in [1] and [1] == True False

[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-26 Thread R. David Murray
R. David Murray added the comment: On some unix systems you cannot execute files in /tmp, even if x is set. Is that true for yours? Bascially, subprocess is just reporting the error that the OS is reporting to it, which is why I say the messages is almost certainly correct. --

[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-26 Thread jaystrict
jaystrict added the comment: user2 in fact has permissions in the CWD. The CWD has been set to /tmp intentionally, exactly for that reason that every user has "rwx" access there. -- status: pending -> open ___ Python tracker

[issue25484] Operator issue with "in" on same level and preceding ==

2015-10-26 Thread Ezio Melotti
Ezio Melotti added the comment: As far as I understand, this is treated as "x < y < z" or "x == y == z": >>> import ast >>> ast.dump(ast.parse("1 < 2 < 3")) 'Module(body=[Expr(value=Compare(left=Num(n=1), ops=[Lt(), Lt()], comparators=[Num(n=2), Num(n=3)]))]) >>> ast.dump(ast.parse("1 == 2 == 3

[issue25484] Operator issue with "in" on same level and preceding ==

2015-10-26 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti versions: +Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue25154] Drop the pyvenv script

2015-10-26 Thread Brett Cannon
Changes by Brett Cannon : -- status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue25467] Put “deprecated” warnings first

2015-10-26 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue25484] Operator issue with "in" on same level and preceding ==

2015-10-26 Thread Sapphire Becker
New submission from Sapphire Becker: So I found this while using == as xnor, here's a summary of the issue: >>> "h" in ["h"] == True False >>> ("h" in ["h"]) == True True >>> "h" in (["h"] == True) Traceback (most recent call last): File "", line 1, in TypeError: argument of type 'bool' is not

[issue24570] IDLE Autocomplete and Call Tips Do Not Pop Up on OS X with ActiveTcl 8.5.18

2015-10-26 Thread Jose M. Alcaide
Jose M. Alcaide added the comment: My previous comment was incorrect, sorry. I thought that this issue was fixed in time for the release of Python 3.5, but it wasn't (fix was committed on Sep 26, two weeks after 3.5's release). My apologies. -- ___

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-26 Thread Eric V. Smith
New submission from Eric V. Smith: Currently, the f-string f'a{3!r:10}' evaluates to bytecode that does the same thing as: ''.join(['a', format(repr(3), '10')]) That is, it literally calls the functions format() and repr(). The same holds true for str() and ascii() with !s and !a, respectivel

[issue20438] inspect: Deprecate getfullargspec?

2015-10-26 Thread Ned Batchelder
Ned Batchelder added the comment: This is the situation I am in: coverage.py uses getargspec in a very simple way in its tooling. I support 2.7 and 3.5, so I have to do this: try: getargspec = inspect.getfullargspec except AttributeError: getargspec = inspect.getargspec

[issue20438] inspect: Deprecate getfullargspec?

2015-10-26 Thread R. David Murray
R. David Murray added the comment: The thing is, we've adopted a policy that if something exists in python2.7 we shouldn't delete it in python3 until after 2.7 is officially out of maintenance (at the earliest), in order to facilitate single-source porting to python3. That policy was adopted

[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-26 Thread R. David Murray
R. David Murray added the comment: It is almost certainly the case that the error message is correct. The most likely explanation given your pasted session is that user2 does not have permission in the CWD. When you use --login, the CWD changes to user2's home, which it of course has permiss

[issue25467] Put “deprecated” warnings first

2015-10-26 Thread Ezio Melotti
Ezio Melotti added the comment: > I’m not sure I understand what you mean by “tag”. >> funcname(args) [new in 3.2] [deprecated in 3.5] >> Func description here. I mean some kind of tag/label next to the name of the function in the documentation (red/orange for deprecations, green for new-in

[issue25444] Py Launch Icon

2015-10-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am the current IDLE maintainer, so that is my interest. I am not responsible for the launcher icon and don't care about it either way. The second one is the one used for IDLE, but Windows has a different format for icons and the little one on the title bar

[issue25467] Put “deprecated” warnings first

2015-10-26 Thread Tony R.
Tony R. added the comment: > Thanks for the report and the patch. Thank you for the review! > I think a better way to handle this would be to add a "tag" next to the > function name for both deprecations and "new in", and leave the actual > deprecation/new-in notes at the bottom, something li

[issue25465] Pickle uses O(n) memory overhead

2015-10-26 Thread Herbert
Herbert added the comment: Hi Eric, I would assume that for the right range-parameter (in my case 30 * 1000 ** 2), which just fits in memory, your system would also crash after a pickle.dump. That is, I had this behavior on two of my machine both running a Ubuntu setup though. Nevertheless,

[issue25425] white-spaces encountered in 3.4

2015-10-26 Thread pavan kumar Dharmavarapu
pavan kumar Dharmavarapu added the comment: Terry: Thanks for you comments and your help we will keep your mail as reference , I will be posting regarding this in near future since we are developing some of our applications. On Mon, Oct 26, 2015 at 6:06 AM, Terry J. Reedy wrote: > > Terry J.

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-26 Thread Atsuo Ishimoto
New submission from Atsuo Ishimoto: I expect following code prints '\x1c' when I resize terminal window on Linix/Mac terminal. import select, os, signal rfd, wfd = os.pipe() os.set_blocking(wfd, False) signal.set_wakeup_fd(wfd) select.select([rfd], [], []) pri

[issue25467] Put “deprecated” warnings first

2015-10-26 Thread Ezio Melotti
Ezio Melotti added the comment: Thanks for the report and the patch. I think a better way to handle this would be to add a "tag" next to the function name for both deprecations and "new in", and leave the actual deprecation/new-in notes at the bottom, something like: funcname(args) [new in 3

[issue25476] close() behavior on non-blocking BufferedIO objects with sockets

2015-10-26 Thread eryksun
eryksun added the comment: I meant that you need a check in buffered_close such as the following: if (res == NULL) { if (PyErr_ExceptionMatches(PyExc_BlockingIOError)) goto end; PyErr_Fetch(&exc, &val, &tb); } else Py_DECREF(res); For 2.7 you could cr

[issue25480] string format in large number

2015-10-26 Thread tryme
New submission from tryme: I am new to python and I don't know if it really is a bug. But indeed when I see sth is not right it is worthwhile to point out. Using fresh installed ubuntu desktop with build in python3. typing the command line by line in terminal just for learning. below is the sc

[issue25311] Add f-string support to tokenize.py

2015-10-26 Thread Eric V. Smith
Eric V. Smith added the comment: I've fixed this particular problem, but the tokenize module definitely has some other issues. It recompiles regexes very often when it doesn't need to, it treats single- and triple-quoted strings differently (leading to some code bloat), etc. I may open another

[issue25476] close() behavior on non-blocking BufferedIO objects with sockets

2015-10-26 Thread David Beazley
David Beazley added the comment: Please don't make flush() close the file on a BlockingIOError. That would be an unfortunate mistake and make it impossible to implement non-blocking I/O correctly with buffered I/O. -- ___ Python tracker

[issue25311] Add f-string support to tokenize.py

2015-10-26 Thread Eric V. Smith
Changes by Eric V. Smith : -- keywords: -patch stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Pyth

[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-26 Thread jaystrict
New submission from jaystrict: When running subprocess.check_output(['doesnotexist']) as another user, I expect a FileNotFoundError, but a PermissionError is thrown. How to reproduce: [user1 tmp]$ su --login user2 Password: [user2 ~]

[issue25311] Add f-string support to tokenize.py

2015-10-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset 21f6c4378846 by Eric V. Smith in branch 'default': Issue 25311: Add support for f-strings to tokenize.py. Also added some comments to explain what's happening, since it's not so obvious. https://hg.python.org/cpython/rev/21f6c4378846 -- nos

[issue25480] string format in large number

2015-10-26 Thread Eric V. Smith
Eric V. Smith added the comment: You should read: https://docs.python.org/3/tutorial/floatingpoint.html -- components: -Build nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue25444] Py Launch Icon

2015-10-26 Thread Nils Lindemann
Nils Lindemann added the comment: it seems i have still not explained my issue in an understandable way: the three first icons in the file list in the screenshot, aka the icons which are used in eg py 3.2, these icons are cool. the icon i do not like, is the launcher icon which is used in eg p

[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-26 Thread Florin Papa
Florin Papa added the comment: Hi all, I updated the patch after fixing crashes that occurred at compile and run time on Ubuntu 15.10, with kernel version 4.2.0-16-generic, LD version 2.25.1 and GCC version 5.2.1. The Python MPX binary will be built with –O0 because other optimization levels

[issue25154] Drop the pyvenv script

2015-10-26 Thread Eric V. Smith
Eric V. Smith added the comment: There's a typo here in 'executable': + '`{} -m venv`'.format(exeutable), file=sys.stderr) And this could now be: print('WARNING: the pyenv script is deprecated in favour of ' f'`{executable} -m venv`', file=sys.stderr) ! And since there

[issue25476] close() behavior on non-blocking BufferedIO objects with sockets

2015-10-26 Thread eryksun
eryksun added the comment: Per issue 16597, when an exception occurs in flush(), the file is closed anyway. You'd have to check the exception and only skip to the end for EWOULDBLOCK or EAGAIN. That way you're not introducing a regression for ENOSPC and other exceptions for which retrying will