[issue27366] PEP487: Simpler customization of class creation

2016-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: Martin's latest patch looks good to me, so I'm applying it now and will push it once a local run of the test suite gives it the thumbs up :) -- ___ Python tracker

[issue24672] shutil.rmtree fails on non ascii filenames

2016-07-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue16700. On Windows there are two sets of API: Unicode and bytes. File names are stored in Unicode (UTF-16) in modern filesystems and encoded to bytes by system for bytes API. Unfortunately this encoding is lossfull. Windows try to find the

[issue27621] Finish IDLE Query dialog appearance and behavior.

2016-07-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In Tk widgets tk_dialog and tk_messageBox (corresponding Tkinter widgets dialog.Dialog and messagebox.Message) pressing Return invokes focused button. The comment in tk_dialog implementation: # 4. Create a binding for on the dialog if there is a #

[issue26942] android: test_ctypes crashes on armv7 and aarch64

2016-07-29 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: You're right. I thought the default malloc() implementation is better, and now I think a unified implementation on Android brings less surprises. -- Added file: http://bugs.python.org/file43945/libffi-pr240.patch ___

[issue24672] shutil.rmtree fails on non ascii filenames

2016-07-29 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've confirmed the issue. It does indeed only occur if the string passed to rmtree is bytes. I discovered this during my investigation of https://github.com/cherrypy/cherrypy/issues/1467. The following script will replicate the failure on Windows systems on

[issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero

2016-07-29 Thread Martin Panter
Martin Panter added the comment: I’m not familiar with the implementation, but it does seem like this should be fixed within _PyLong_AsByteArray(). Also, what about int.from_bytes(b"", ..., signed=True)? There are existing tests for this case, but it seems like it should be an error, rather

[issue27643] test_ctypes fails on AIX with xlc

2016-07-29 Thread Martin Panter
Martin Panter added the comment: Looks like your Python 3 build is messed up. Maybe it doesn’t like running from a different directory. I would try from the main build directory, and note the test_bitfields has an S: ./python -m unittest -v ctypes.test.test_bitfields What I am suggesting as

[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-29 Thread Rémi Rampin
Rémi Rampin added the comment: Here it goes - Clarified that _proxy suffix should be lowercase - Indented ..note: blocks under function/class -- Added file: http://bugs.python.org/file43944/python-3.5-httpoxy.patch ___ Python tracker

[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-29 Thread Rémi Rampin
Changes by Rémi Rampin : Added file: http://bugs.python.org/file43943/python-2.7-httpoxy.patch ___ Python tracker ___

[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-29 Thread Rémi Rampin
Changes by Rémi Rampin : Removed file: http://bugs.python.org/file43801/python-3.5-httpoxy.patch ___ Python tracker ___

[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-29 Thread Rémi Rampin
Changes by Rémi Rampin : Removed file: http://bugs.python.org/file43800/python-2.7-httpoxy.patch ___ Python tracker ___

[issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero

2016-07-29 Thread Anders Lorentsen
Anders Lorentsen added the comment: I updated my patch to account for that second corner case. But ideally, shouldn't it rather be accounted for in the function that does the actual conversion, that is, in _PyLong_AsByteArray? -- Added file:

[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-29 Thread Guido van Rossum
Guido van Rossum added the comment: Mercurial revs: fd0dce6d33e7, 15a35a8da24b, 4ecea1ea11bf, 4ecea1ea11bf. -- ___ Python tracker ___

[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-29 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! Should go live later today. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue27524] Update os.path for PEP 519/__fspath__()

2016-07-29 Thread Brett Cannon
Brett Cannon added the comment: Here is a patch that includes the previous tests as long with fixes which don't involve stat or lstat (once those functions are updated themselves then os.path will be ported). -- Added file: http://bugs.python.org/file43941/os_path.diff

[issue27477] IDLE: Switch dialogs to ttk widgets.

2016-07-29 Thread Mark Roseman
Mark Roseman added the comment: Great start. Needs to have a ttk.Frame directly inside the toplevel window to avoid whitespace showing around grey widgets (like in query dialog shot). I'd also like to see the spacing adjusted (all platforms) and button positions changed on Mac to go at the

[issue27621] Finish IDLE Query dialog appearance and behavior.

2016-07-29 Thread Mark Roseman
Mark Roseman added the comment: Terry, thanks for the TkDocs correction. As you'll note from the attached dlgonmac.png, there's a bit of tweaking needed with regard to geometry management etc. to get the background right. Now that ttk is ok (so to speak), would you be open to some patches

[issue19837] Wire protocol encoding for the JSON module

2016-07-29 Thread Kevin Dwyer
Changes by Kevin Dwyer : -- nosy: +kdwyer ___ Python tracker ___ ___

[issue1521950] shlex.split() does not tokenize like the shell

2016-07-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset ea99e2f0b829 by Vinay Sajip in branch 'default': Closes #1521950: Made shlex parsing more shell-like. https://hg.python.org/cpython/rev/ea99e2f0b829 -- nosy: +python-dev resolution: -> fixed stage: patch review -> resolved status: open ->

[issue27613] Empty iterator with fake __len__ is rendered as a single bracket ] when using json's iterencode

2016-07-29 Thread ppperry
Changes by ppperry : -- title: Empty iterator is rendered as a single bracket ] when using json's iterencode -> Empty iterator with fake __len__ is rendered as a single bracket ] when using json's iterencode ___ Python tracker

[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-29 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I have only one optional comment on the second revision. -- nosy: +gvanrossum ___ Python tracker ___

[issue26942] android: test_ctypes crashes on armv7 and aarch64

2016-07-29 Thread Xavier de Gaye
Xavier de Gaye added the comment: > By msg264746, only ARM fails, so I patch libffi for arm and aarch64 triplets > only Why not for all Android architectures (*-linux-android*) as it is done in PR120 ? -- stage: -> patch review ___ Python tracker

[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-29 Thread Michael Lee
Michael Lee added the comment: Ok, here's revision 2 of my patch, after applying the changes from the last round of feedback. -- Added file: http://bugs.python.org/file43939/document_newtype_rev2.patch ___ Python tracker

[issue27641] Do not build Programs/_freeze_importlib when cross-compiling

2016-07-29 Thread Xavier de Gaye
Xavier de Gaye added the comment: Nice. FWIW cross-compilation for Android works fine with comment-out-regen.patch. > In native compiling mode, everything should be as normal. When > cross-compiling, the rules for regenerating files should read like > > Python/importlib.h: #

[issue27650] Implement `__repr__` methods for logging.Logger and others

2016-07-29 Thread Ram Rachum
New submission from Ram Rachum: A while ago I was debugging through code that uses the `logging` module, and I was looking at `Logger` objects and possibly other kinds of objects (maybe handlers? It was a while ago.) I was frustrated because I was trying to figure out what a particular logger

[issue27524] Update os.path for PEP 519/__fspath__()

2016-07-29 Thread Brett Cannon
Brett Cannon added the comment: Ran into the first nasty snag: people are abusing os.path.commonprefix() and it's extremely generic approach. Instead of passing in a list of file paths they are passing a list of lists of file path *parts*, e.g. instead of ["a/b", "a/c"] they are passing in

[issue27604] More details about `-O` flag

2016-07-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: The -O entry is unchanged from when the Using doc was added in 2007. I believe there has been discussion about being more specific and that Guido said something, but that is the most I will say. -- ___ Python

[issue27604] More details about `-O` flag

2016-07-29 Thread Ram Rachum
Ram Rachum added the comment: Hi David, I attached a patch that follows your instructions, but to be honest, if I wasn't the person writing this patch and I wanted to find the information "Does Python do any optimization besides dumping asserts when I do -O?" I'm not sure I'd be able to

[issue27644] Expand documentation about type aliases and NewType in the typing module

2016-07-29 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Should I edit the patch to include a sentence or two describing this > distinction, just remove the word "almost", or do something else? I think the best way is to remove the "almost" and briefly explain that you cannot subclass types returned by NewType.

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on Linux

2016-07-29 Thread Vinay Sajip
Changes by Vinay Sajip : Added file: http://bugs.python.org/file43937/refresh-2016-07-29.diff ___ Python tracker ___

[issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode

2016-07-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am surprised that dumping to a string and to a file give different answers. This strikes me as a bug in any case. I would expect the the main difference would be file.write(chunk) versus temlist.append(chunk). -- nosy: +terry.reedy

[issue27605] Inconsistent calls to __eq__ from built-in __contains__

2016-07-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Here is a more accurate 'equivalent': "any(x is e or for e in )" where 'candidate members' is "members with the same hash as x" for built-in hash-based collections and 'all members' for built-in unsorted sequences". I am sure that built-in range does a

[issue27604] More details about `-O` flag

2016-07-29 Thread R. David Murray
R. David Murray added the comment: I think the cmdline ref telling you that optimizations are enabled or disabled is enough. If someone wants technical information they can click on the link. For comparison, the gcc man page lists what optimizations the -O levels enable, but does not

[issue27604] More details about `-O` flag

2016-07-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ram > (At least my boss and team members have asked that, and people on Stack Overflow.) Ram, to me it would have been helpful if you had said this initially. It gives a doc change request a bit more force. -- nosy: +terry.reedy

[issue27453] $CPP invocation in configure must use $CPPFLAGS

2016-07-29 Thread STINNER Victor
STINNER Victor added the comment: ndk-clang-preprocessor.patch LGTM. -- ___ Python tracker ___ ___

[issue27641] Do not build Programs/_freeze_importlib when cross-compiling

2016-07-29 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- nosy: +xdegaye ___ Python tracker ___ ___ Python-bugs-list

[issue23968] rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET)

2016-07-29 Thread Xavier de Gaye
Xavier de Gaye added the comment: To reproduce the problem on any system where Python is built with configure: $ mkdir -p tmp/build tmp/install $ cd tmp $ hg clone https://hg.python.org/cpython cpython $ cd build $ $(cd ../cpython && pwd)/configure --prefix=$(cd ../install && pwd) && make

[issue27643] test_ctypes fails on AIX with xlc

2016-07-29 Thread Michael Felt
Michael Felt added the comment: FYI - after a couple of test compiles, it seems that IBM XLC does not report a message when the size specified is int, unsigned or long (i.e., does not like short). Are you interested in the results using a size other than short - or would that break something

[issue27643] test_ctypes fails on AIX with xlc

2016-07-29 Thread Michael Felt
Michael Felt added the comment: > I presume this also affects Python 3. I presume this as well - however, harder to verify... michael@x071:[/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test]../../../python test_bitfield.py Could not find platform dependent libraries Consider setting

[issue27453] $CPP invocation in configure must use $CPPFLAGS

2016-07-29 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- nosy: +haypo stage: -> commit review ___ Python tracker ___

[issue27604] More details about `-O` flag

2016-07-29 Thread Ram Rachum
Ram Rachum added the comment: I uploaded a new patch. I added another thing: Mentioning explicitly that no other optimizations are currently being made. I think this is important because it's often the question that the user is asking themselves. (At least my boss and team members have asked

[issue17599] mingw: detect REPARSE_DATA_BUFFER

2016-07-29 Thread Steve Dower
Steve Dower added the comment: I think the WDK is still separate from the Windows SDK, so probably best to keep the custom definition with a comment specifying which file it came from (so whoever diagnoses an obscure issue in the future can find it quickly). With the comment, I'm fine with

[issue27435] ctypes and AIX - also for 2.7.X (and later)

2016-07-29 Thread Michael Felt
Michael Felt added the comment: """ Lib/ctype support for LoadLibrary interface to dlopen() for AIX Similar kind of support (i.e., as a separate file) as has been done for Darwin support ctype.macholib.* rather than as been done with for "ce", "nt", "solaris", and "bsd" with separate, detailed

[issue27648] Message of webbrowser.py something wrong.

2016-07-29 Thread 김태환
김태환 added the comment: I think you’re right. I also think that Korean message(final line) prints by chrome. (Another lines printed by my own codes, please don’t care) But I used webbrowser.open() code to outside of __main__. I will test my codes from other web browser (like Firefox) Thank

[issue8797] urllib2 basicauth broken in 2.6.5: RuntimeError: maximum recursion depth exceeded in cmp

2016-07-29 Thread R. David Murray
R. David Murray added the comment: Kim: if you can prove it is broken, please open a new issue, this one is closed (you can reference it by just typing # followed by the issue number, and the tracker will automatically make a link). -- ___ Python

[issue27649] multiprocessing on Windows does not properly manage class attributes

2016-07-29 Thread R. David Murray
R. David Murray added the comment: Right this is a fork vs spawn issue, not a bug. I don't know why Eryk changed the versions the way he did, but FYI we use that field to indicate which version we will apply a patch to, so it is pretty much irrelevant when there isn't actually a bug :)

[issue27649] multiprocessing on Windows does not properly manage class attributes

2016-07-29 Thread Ian Cordasco
Ian Cordasco added the comment: Why did you remove Python 3.3? It's still affected by this behaviour. -- ___ Python tracker ___

[issue27624] unclear documentation on Queue.qsize()

2016-07-29 Thread R. David Murray
R. David Murray added the comment: Doug: side note. Raymond teaches Python, and makes a study of what works and doesn't work in communicating it to students, so he isn't rejecting this lightly. -- ___ Python tracker

[issue27648] Message of webbrowser.py something wrong.

2016-07-29 Thread R. David Murray
R. David Murray added the comment: Since python isn't internationalized, or even set up for someone else to do it (other than getopt/optparse/argparse, and webbrowser doesn't use those outside of __main__), I don't see how that message could be coming from Python. Most likely the message is

[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-07-29 Thread R. David Murray
R. David Murray added the comment: Returning the undecoded payload is a good idea. Let's go with that. The email module, unlike most stdlib packages, has a mandate that the parser should never raise an error. Instead we do our best to guess (very unlike everything else in python!) and note

[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-29 Thread Rémi Rampin
Rémi Rampin added the comment: I was away for a bit, I will make the requested changes tonight. -- ___ Python tracker ___

[issue27649] multiprocessing on Windows does not properly manage class attributes

2016-07-29 Thread Eryk Sun
Eryk Sun added the comment: Queuing the class doesn't do anything here. It gets pickled as a module attribute; the queue isn't marshaling the class dict. For example: >>> pickletools.dis(pickle.dumps(mccabe.McCabeChecker)) 0: \x80 PROTO 3 2: cGLOBAL 'mccabe

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on Linux

2016-07-29 Thread Michael Felt
Michael Felt added the comment: Vinay - I am in favor, but if the root cause of the holdup is unclear documentation then let's address the root cause. Stronger, I am in agreement. The first patch I submitted for AIX included using LIBPATH (and could have added LD_LIBRARY_PATH) - but that was

[issue8797] urllib2 basicauth broken in 2.6.5: RuntimeError: maximum recursion depth exceeded in cmp

2016-07-29 Thread Kim Randell
Kim Randell added the comment: I don't have an example case, but from reading the code it looks as though the AbstractDigestAuthHandler has exactly the same faults as the old version of AbstractBasicAuthHandler (i.e. using req.headers.get instead of req.get_header, and corresponding retry

[issue27640] add the '--disable-test-suite' option to configure

2016-07-29 Thread Xavier de Gaye
Xavier de Gaye added the comment: Thanks for the review Martin. I will update the patch accordingly later. -- ___ Python tracker ___

[issue26851] android compilation and link flags

2016-07-29 Thread Chi Hsuan Yen
Changes by Chi Hsuan Yen : -- nosy: +Chi Hsuan Yen ___ Python tracker ___ ___

[issue27649] multiprocessing on Windows does not properly manage class attributes

2016-07-29 Thread Ian Cordasco
New submission from Ian Cordasco: In trying to add support for multiprocessing on Windows in Flake8, I found that the behaviour of the module is significantly different than on Unix. If you have a class that has class-level attributes on Unix, and you change them, put the class into a Queue

[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-29 Thread Ian Cordasco
Changes by Ian Cordasco : -- nosy: +icordasc ___ Python tracker ___ ___

[issue27627] clang fails to build ctypes on Android armv7

2016-07-29 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- nosy: +thomas-petazzoni ___ Python tracker ___ ___

[issue27606] Android cross-built for armv5te with clang and '-mthumb' crashes with SIGSEGV or SIGILL

2016-07-29 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- nosy: +thomas-petazzoni ___ Python tracker ___ ___

[issue22724] byte-compile fails for cross-builds

2016-07-29 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- nosy: +thomas-petazzoni ___ Python tracker ___ ___

[issue27453] $CPP invocation in configure must use $CPPFLAGS

2016-07-29 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- nosy: +thomas-petazzoni ___ Python tracker ___ ___

[issue23968] rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET)

2016-07-29 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- nosy: +thomas-petazzoni ___ Python tracker ___ ___

[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-29 Thread Petr Viktorin
Petr Viktorin added the comment: The conversation seems to have stalled. Rémi, are you still working on the patch? Should someone take over? -- nosy: +encukou ___ Python tracker

[issue27577] Make implementation and doc of tuple and list more compliant

2016-07-29 Thread Xiang Zhang
Xiang Zhang added the comment: Nice to know your opinions. :) Adjust the patch to use Terry's sentence. -- components: +Documentation -Interpreter Core Added file: http://bugs.python.org/file43934/tuple_and_list_parameter_name_v2.patch ___ Python

[issue27639] UserList.__getitem__ doesn't account for slices

2016-07-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Take a look at the following code from UserList.py in Python2.7 to get an idea of how this was implemented previously: def __getslice__(self, i, j): i = max(i, 0); j = max(j, 0) return self.__class__(self.data[i:j]) def

[issue27639] UserList.__getitem__ doesn't account for slices

2016-07-29 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg271612 ___ Python tracker ___

[issue27577] Make implementation and doc of tuple and list more compliant

2016-07-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree with Raymond's comments. No 'note', and once in each doc. Perhaps 'for __ and __, the actual name of parameter 'iterable' is still 'sequence'. ('Still' would be appropriate if the functions predate iterables.) --

[issue27577] Make implementation and doc of tuple and list more compliant

2016-07-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Can you limit the doc change to just a single occurrence for list and tuple. I'm averse to filling docs with redundant, noisy notes over a very minor nuance that is more of a curiosity than an actual issue. Also, can you inline the text rather than using

[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-07-29 Thread Jami Lindh
Jami Lindh added the comment: It might also make sense to return the payload undecoded. The documentation for get_payload() function says: "[...] the payload will be decoded if this header’s value is quoted-printable or base64. If some other encoding is used, or Content-Transfer-Encoding

[issue27639] UserList.__getitem__ doesn't account for slices

2016-07-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: As far as I can tell, there has never been a need or request for UserList slice support in its 17 year history. And since the collections ABCs were added, this class has mostly fallen into disuse and probably doesn't warrant API expansion (the module only

[issue27624] unclear documentation on Queue.qsize()

2016-07-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry Doug, I don't find any of the suggestions to be an improvement and I concur with David Murray that the docstring for qsize() isn't the place for a tutorial on race conditions and LBYL vs EAPF which are general threading topics rather than a queue

[issue27131] Unit test random shuffle

2016-07-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've just looked at the existing tests for random.shuffle() and found that they already cover this case and do a much more thorough job. The suggested patch doesn't add anything. Sorry, I'm going to close this one -- there isn't any problem being