[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
closest equivalent if the character is not encodable with current codepage (for 
example drops diacritics) and silently replaces it with "?" if can't find 
anything appropriate. We can't do anything with this from Python side except 
using Unicode API.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
# default button.
# Convention also dictates that if the keyboard focus moves among the
# the buttons that the  binding affects the button with the focus.

I expected the same behavior in IDLE Query dialog. If this behavior considered 
outdated, I'm nice to close this issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 Python 2 and Python 3, but not on 
other operating systems:

---
# encoding: utf-8

from __future__ import unicode_literals

import os
import shutil

os.mkdir('temp')

with open('temp/Слава Україні.html', 'w'):
pass

print(os.listdir(b'temp')[0])

shutil.rmtree(b'temp')
---

The error on Python 2.7 is this:

? ???.html
Traceback (most recent call last):
  File "C:\Users\jaraco\p\cherrypy\issue-1467.py", line 15, in 
shutil.rmtree(b'temp')
  File "C:\Program Files\Python27\lib\shutil.py", line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
  File "C:\Program Files\Python27\lib\shutil.py", line 250, in rmtree
os.remove(fullname)
WindowsError: [Error 123] The filename, directory name, or volume label syntax 
is incorrect: 'temp\\? ???.html'

This issue might be related to issue25911 or issue24230 or issue18713 or 
issue16656 or issue9820 and probably others.


It's not obvious to me browsing through those tickets why Windows should behave 
differently when a bytestring is passed to listdir. Perhaps I'll delve into 
those tickets in more depth.

--
nosy: +jason.coombs
title: shutil.rmtree failes on non ascii filenames -> shutil.rmtree fails on 
non ascii filenames
versions: +Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 than 
returning zero.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 a fix is to change line 381 from plain “int” to “signed 
int”, and 382 to “signed short”. I can make a patch later if that will help. 
Hopefully with these changes the C compiler will use signed integer logic, 
matching what I believe the ctypes library uses for c_int and c_short.

Using a type other than short is not right, because the Python test is 
explicitly trying to test c_short behaviour. If your compiler does not support 
“signed short” bitfields, maybe we just have to accept that ctypes supports it 
even though the compiler doesn’t, and skip the test.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 
http://bugs.python.org/file43942/int_to_bytes_overflow_cornercase2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 bottom, as per 
http://www.tkdocs.com/tutorial/idle.html#idledialogs

Open to a patch that does that?

--
nosy: +markroseman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 that fix 
this up, a bit more akin to what you see in the 'query dialog' subsection if 
you scroll down a bit in http://www.tkdocs.com/tutorial/idle.html#idledialogs

Separately, would you be open to a patch changing things to use the "inline" 
error handling illustrated on the goto line dialog on that page (i.e. showing 
error message in query dialog in red vs. popping up an alert)?

Older code for that can be found here btw: 
https://github.com/roseman/idle/blob/master/querydialog.py

--
Added file: http://bugs.python.org/file43940/dlgonmac.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19837] Wire protocol encoding for the JSON module

2016-07-29 Thread Kevin Dwyer

Changes by Kevin Dwyer :


--
nosy: +kdwyer

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: # $(srcdir)/Lib/importlib/_bootstrap.py 
> Programs/_freeze_importlib
>   ./Programs/_freeze_importlib \
>   $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h

They do read like this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
was, but typing `logger` in the shell just showed the opaque ``. I would like to know the name of the logger 
without bothering to do `logger.name`.

I suggest that we do a run over the `logging` module and see which classes 
could have a helpful `__repr__` added to them. I might have time to do this, 
but first I want to know whether there is a general agreement that such a patch 
would be welcome.

--
components: Library (Lib)
messages: 271646
nosy: cool-RR, vinay.sajip
priority: normal
severity: normal
status: open
title: Implement `__repr__` methods for logging.Logger and others
type: enhancement
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 [["a", "b"], ["a", "c"]]. I have special-cased when 
the list contains another list or tuple, but I still feel dirty doing it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 understand the information from the docs with 3.patch applied. 
The documentation doesn't clearly state that `-O` causes an `optimize` value of 
1. If it did it'll be a bit easier to understand. Still too difficult in my 
opinion (which is why I would personally put this information directly in 
cmdline.rst) but maybe a bit easier.

--
Added file: http://bugs.python.org/file43938/3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 direct 
calculation.  Instead of the above, I suggest this.

"For general collections, such as list, tuple, collections.deque, and most 
iterables, the expression `x in y` is usually equivalent to `any(x is e or x == 
e for e in y)`."

Hash-based collections should not be mentioned in such a sentence as the 
equivalency is completely wrong, as Steven noted.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 explain them.  To understand what it does you must follow the 
"links" to the referenced optimization options.  If python had separate options 
for the individual optimizations we could do likewise, but we don't, so linking 
to the technical explanation seems like the logical thing to do instead.

Perhaps we can get the opinion of some other devs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
install
$ ../install/bin/python3 -m test -v test_sysconfig
[snip]
==
FAIL: test_srcdir (test.test_sysconfig.TestSysConfig)
--
Traceback (most recent call last):
  File "/path_to/tmp/install/lib/python3.6/test/test_sysconfig.py", line 346, 
in test
_srcdir
self.assertTrue(os.path.isdir(srcdir), srcdir)
AssertionError: False is not true : 
/path_to/tmp/install/lib/python3.6/config-3.6m

==
FAIL: test_get_makefile_filename (test.test_sysconfig.MakefileTests)
--
Traceback (most recent call last):
  File "/path_to/tmp/install/lib/python3.6/test/test_sysconfig.py", line 414, 
in test
_get_makefile_filename
self.assertTrue(os.path.isfile(makefile), makefile)
AssertionError: False is not true : 
/path_to/tmp/install/lib/python3.6/config-3.6m/Makefile

--
Ran 21 tests in 0.063s

FAILED (failures=2, skipped=2)
test test_sysconfig failed
test_sysconfig failed
1 test failed:
test_sysconfig
Total duration: 0:00:01

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 else I cannot forsee?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 $PYTHONHOME to [:]
Failed to import the site module
Traceback (most recent call last):
  File 
"/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test/../../../Lib/site.py",
 line 571, in 
main()
  File 
"/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test/../../../Lib/site.py",
 line 557, in main
known_paths = addusersitepackages(known_paths)
  File 
"/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test/../../../Lib/site.py",
 line 281, in addusersitepackages
user_site = getusersitepackages()
  File 
"/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test/../../../Lib/site.py",
 line 257, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
  File 
"/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test/../../../Lib/site.py",
 line 247, in getuserbase
USER_BASE = get_config_var('userbase')
  File "/data/prj/aixtools/python/python-3.6.0.162/Lib/sysconfig.py", line 587, 
in get_config_var
return get_config_vars().get(name)
  File "/data/prj/aixtools/python/python-3.6.0.162/Lib/sysconfig.py", line 536, 
in get_config_vars
_init_posix(_CONFIG_VARS)
  File "/data/prj/aixtools/python/python-3.6.0.162/Lib/sysconfig.py", line 408, 
in _init_posix
from _sysconfigdata import build_time_vars
ImportError: No module named '_sysconfigdata'

I guess I will have to install it, rather than only work from a test directory.

> The test seems to be comparing ctypes and native C bit-field structures, 
> c_int and c_short versus native int and short. ... int always means signed 
> int.

I believe int means signed on AIX as well - as the comment from the compiler is 
that type "unsigned" is assumed for a bitfield.

Note: the single line of code is:
  +382  short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7;

And from your comments I am wondering if the fix is 'simple' - to:

  +382  unsigned short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7;


I can at least try that.

Looking at Python-3.6.0.0a2:

the line concerned is identical - so that is the verification (for now) that it 
is also in Python3

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 that, and people on Stack Overflow.)

I disagree with your suggestion to limit the change only to veryhigh.rst and 
link to there from cmdline.rst. I think this is an important piece of 
information so it should be available in cmdline.rst which is more visible than 
the technical veryhigh.rst. If you feel strongly about this issue let me know 
and I'll do it your way.

--
Added file: http://bugs.python.org/file43936/2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the patch. If you haven't built on MSVC then 
keep an eye on the build bots until it goes through in case something 
unpredictable happens.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 if: sections in utils.py
Author: M Felt, aixtools.net, July 2016
"""

--
keywords: +patch
Added file: http://bugs.python.org/file43935/issue27435_ctypes_aix_support.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 you for replying! 

On 2016년 7월 29일 (금) at 오후 10:58 "R. David Murray"

<
mailto:
> wrote:

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 coming from chrome itself. I'm going to close this 
as third party. If it turns out I'm wrong we can reopen.

--

nosy: +r.david.murray

resolution: -> third party

stage: -> resolved

status: open -> closed

___

Python tracker <
mailto:rep...@bugs.python.org
>

<
http://bugs.python.org/issue27648
>

___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

--
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 coming from chrome itself.  I'm going to close this 
as third party.  If it turns out I'm wrong we can reopen.

--
nosy: +r.david.murray
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 'defects' in the message.  The reason this 
is the case is Postel's Law, which has become one of the guiding principles in 
dealing with email over the years: "be conservative in what you do, and 
generous in what you accept".  So, the generator will raise errors (if the 
original input didn't come from the parser), but the parser will not, if at all 
possible.

(For those who want aggressive error checking, python3 the 'raise_on_defect' 
policy setting.)

For the versions, we use that field to indicate which versions the bug will get 
fixed in, which is why I removed 3.4.

--
versions:  -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 McCabeChecker'
   24: qBINPUT 0
   26: .STOP
highest protocol among opcodes = 2

Unpickling this is basically getattr(sys.modules['mccabe'], 'McCabeChecker'). 
So you'll see the same result if you only put ('max_complexity', 10) in the 
queue and hard code the class in the _target function. 

Of course for a system that uses fork() the class attribute is the same in the 
child process. In 3.4+ you can force spawning by initially calling 
multiprocessing.set_start_method('spawn'). Then you'll see the same result as 
in Windows.

--
nosy: +eryksun
versions:  -Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

> In my view, the best should not be the enemy of the good, and pragmatism 
> beats purity. I don't have the resources to test this functionality on all 
> platforms - just Windows and Linux - and am not familiar with other platforms 
> like AIX, Solaris or the BSDs. The documentation makes clear that the 
> behaviour of find_library is system-dependent and makes no promises of a 
> particular level of consistency, either with dlopen() or across platforms.

* Again, basically I agree with the principles. I do not have the resources for 
all linux platforms, Solaris, BSD, Windows, etc..
* As far as "other platforms" and dlopen() behavior - from the man pages I have 
referenced I see more similarity than difference.
* behaviour of find_library is system-dependent - exactly - but unfortunately, 
for now AIX is whatever is in the else: box. That it works at all is a 
statement of the flexibility of AIX - and the sweat and tears of AIX admins to 
get the pieces to fit.

> Nor can we guarantee in the documentation that find_library() will exactly 
> emulate dlopen(), since that may not hold on all platforms - and in fact, 
> since Windows is in the mix, there is little point in trying to tie 
> find_library() behaviour to that of dlopen() directly.

Good points. However, while it cannot be guaranteed - upfront - (although I 
would say that I could make them mimic each other on AIX given the leeway, 
better directive) - it can be stated as an objective for "posix".
:) Windows is windows - maybe someone who knows windows well enough could make 
something very close.

> The purpose of find_library as currently documented seems adequately 
> described, and the documentation update in my latest patch clarifies things 
> further.

Obviously, here is where we disagree. If it was 'adequately' described you 
could have used the documentation as a justification years ago. Your change 
touches on it, but still leaves a great deal to discuss - and especially - 
convince those who may actually commit.

> I'm not sure the agreement you seek will come any time soon, as it has not 
> come in the last five years; it doesn't seem possible to aim for e.g. exact 
> behaviour of dlopen(), because (a) it's not the same on Windows and (b) 
> potentially varies too widely across POSIX platforms. Can you propose some 
> change to the find_library() contract which you can assure will be 
> implementable across all platforms? Certainly, fidelity with dlopen() isn't 
> it.

As you mentioned earlier - the implementations are system-dependent - so yes, 
we could argue for find_library search behavior that emulates dlopen() (better 
perhaps "LoadLibrary()") - but not define any particular behavior - precisely 
because it may be different on different platforms. Again, the objective is to 
replicate that platform's LoadLibrary search behavior - whatever that may be.

Once we have established what is needed/desired as a goal, over time 
implementations will catch up. Linux will be leading the way because you have, 
presumably, already implemented it.

Michael

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 workarounds). Should it be updated to match?

--
nosy: +Kim Randell

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26851] android compilation and link flags

2016-07-29 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
nosy: +Chi Hsuan Yen

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 (or have it attached to an object that moves through a 
Queue) then the values you set will be preserved [1]. On Windows [2], the 
attributes are reset.


As a minimal reproduction, I've thrown together this project: 
https://github.com/sigmavirus24/windows-multiprocessing-bug which is running 
tox on AppVeyor 
(https://ci.appveyor.com/project/sigmavirus24/windows-multiprocessing-bug) and 
Travis CI (https://travis-ci.org/sigmavirus24/windows-multiprocessing-bug) so 
the behaviours can be compared.

For application developers, it would be wonderful if we could rely on the 
standard library behaving the same way in this case across both operating 
systems.

[1] 
https://travis-ci.org/sigmavirus24/windows-multiprocessing-bug/jobs/148276925#L158
 
https://travis-ci.org/sigmavirus24/windows-multiprocessing-bug/jobs/148276926#L158
 
https://travis-ci.org/sigmavirus24/windows-multiprocessing-bug/jobs/148276927#L157

[2] 
https://ci.appveyor.com/project/sigmavirus24/windows-multiprocessing-bug/build/1.0.2#L24

--
components: Windows
messages: 271618
nosy: icordasc, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: multiprocessing on Windows does not properly manage class attributes
type: behavior
versions: Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22724] byte-compile fails for cross-builds

2016-07-29 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
nosy: +thomas-petazzoni

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 __setslice__(self, i, j, other):
i = max(i, 0); j = max(j, 0)
if isinstance(other, UserList):
self.data[i:j] = other.data
elif isinstance(other, type(self.data)):
self.data[i:j] = other
else:
self.data[i:j] = list(other)
def __delslice__(self, i, j):
i = max(i, 0); j = max(j, 0)
del self.data[i:j]

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the ..note directive which adds more visual clutter than 
is warranted for something so minor.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 header 
is missing, the payload is returned as-is (undecoded)."

Even though the header's value tries to convince you "base64" is the encoding, 
it is - in this case - either broken base64 or not. Hence it might fall into 
the category "some other encoding is used", justifying the "payload is returned 
as-is (undecoded)".

As to the original payload Claudiu posted, in that the mailserver has truncated 
the email. This already provides the user with non-base64 string that they try 
to convince you to decode as base64. My argument is still valid in this case.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 narrowly missed being omitted from Python 3 all 
together).

Aside from the question of whether this should be done (I am -0 on it), this 
patch looks correct as far as it goes.  If slice support does get added to 
__getitem__, it should also be conferred on __setitem__ and __delitem__ as well.

Besides the question of whether anyone would ever need this, there is also a 
minor performance consideration in that it will mildly degrade the performance 
of any existing code that uses UserList.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

Also, I'm reluctant to change Guido's original wording which has served well 
for a decade.  While I'm sure you can invent ways to misread the word 
"approximate", it does communicate that this method cannot relied upon to 
return the exact size.  If we were seeing recurring source of confusion, there 
might be a basis for a change, but that is not the case.

Sorry, but I'm going to close this one.  Every person might find a different 
way to wordsmith this one, but I think we should favor Guido's choice.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com