[issue27655] [Patch] Don't require presence of POLLPRI

2016-08-02 Thread Ed Schouten

Ed Schouten added the comment:

Believe it our not, dealing with the absence of those system calls is more 
contained than you'd think. What is pretty nice about Python is that (almost) 
all of the file system operations are performed through posixmodule.c. Most of 
the changes in that area are thus made to that source file (and configure.ac).

Furthermore, it looks like posixmodule.c can be simplified a lot. What makes it 
so incredibly complex right now is that it wants to fall back to non-at() 
operations in case no directory file descriptor is provided, which is not 
needed. If that would get fixed, we'd kill two birds with one stone: the code 
would get a lot simpler, while almost automatically gaining support for 
CloudABI. But let's save this discussion for a separate thread.

--

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-02 Thread Ethan Furman

Ethan Furman added the comment:

The 80-column thing isn't fixed yet, but I redid the patch:

- removed AutoNameEnum since there was some question of casing, etc
- redid the methodology of auto-generating values:
instead of adding it all to the prepared namespace or the metaclass, I
now look for a special method in the Enum class, and if present use
that
- removed settings (no AutoNumber, AutoName, nor Unique)
- redid AutoEnum to use the _generate_next_value_ technique
- updated docs

Let me know what you think!

--
Added file: http://bugs.python.org/file43972/issue26988.stoneleaf.03.patch

___
Python tracker 

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



[issue27667] subprocess32 unable to be installed via pip and python install

2016-08-02 Thread Cambridge

New submission from Cambridge:

OS:RHEL 5.11
PYTHON:2.7.11/12

When i use pip or python install to install this extension:
pip install subprocess32-3.2.7.tar.gz

The error messages:

Processing ./subprocess32-3.2.7.tar.gz
Installing collected packages: subprocess32
  Running setup.py install for subprocess32 ... error
Complete output from command /usr/bin/python -u -c "import setuptools, 
tokenize;__file__='/tmp/pip-ekkMER-build/setup.py';exec(compile(getattr(tokenize,
 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" 
install --record /tmp/pip-EebZzY-record/install-record.txt 
--single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying subprocess32.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_posixsubprocess' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -fPIC -I/usr/local/python-2.7/include/python2.7 -c 
_posixsubprocess.c -o build/temp.linux-x86_64-2.7/_posixsubprocess.o
_posixsubprocess.c: In function 'subprocess_cloexec_pipe':
_posixsubprocess.c:764: warning: implicit declaration of function 'pipe2'
_posixsubprocess.c:764: error: 'O_CLOEXEC' undeclared (first use in this 
function)
_posixsubprocess.c:764: error: (Each undeclared identifier is reported only 
once
_posixsubprocess.c:764: error: for each function it appears in.)
error: command 'gcc' failed with exit status 1


Command "/usr/bin/python -u -c "import setuptools, 
tokenize;__file__='/tmp/pip-ekkMER-build/setup.py';exec(compile(getattr(tokenize,
 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" 
install --record /tmp/pip-EebZzY-record/install-record.txt 
--single-version-externally-managed --compile" failed with error code 1 in 
/tmp/pip-ekkMER-build/

--
components: Extension Modules
messages: 271812
nosy: ldrljq
priority: normal
severity: normal
status: open
title: subprocess32 unable to be installed via pip and python install
type: compile error
versions: Python 2.7

___
Python tracker 

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



[issue27667] subprocess32 unable to be installed via pip and python install

2016-08-02 Thread Cambridge

Cambridge added the comment:

If 3.2.7 don't support RHEL5?

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue27667] subprocess32 unable to be installed via pip and python install

2016-08-02 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report. The stdlib version of subprocess module has a little bit 
codebase now (there is no subprocess_cloexec_pipe() routine anymore, for 
example) so we can't do anything here. Could you please report this to 
https://github.com/google/python-subprocess32 ?

--
nosy: +berker.peksag
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



[issue27666] "stack smashing detected" in PyCursesWindow_Box

2016-08-02 Thread SilentGhost

Changes by SilentGhost :


--
components: +Extension Modules -Library (Lib)
nosy: +twouters

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2016-08-02 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy:  -christian.heimes

___
Python tracker 

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



[issue12319] [http.client] HTTPConnection.request not support "chunked" Transfer-Encoding to send data

2016-08-02 Thread Rolf Krahl

Rolf Krahl added the comment:

Thanks for your review!  Here comes a new version of the patch.  I believe I 
addressed all review comments.

Since I didn't get any feedback on my questions raised above, I resolved them 
as follows:

1. I dropped the EncodingError exception introduced by an earlier version of 
the patch by Damien.  This error is raised when the caller sets an illegal 
combination of headers.  Since the error does not occur as a result of talking 
to the HTTP server, I think an HTTPException or a child thereof is just wrong.  
A ValueError is more appropriate here and that is what the code raises now.

2. I changed the test whether a file-like is a text stream to isText = 
isinstance(readable.read(0), str).  This relies only on the read() method and 
is the most generic test.  The original code would fail for StringIO and other 
text streams that do not have the mode attribute.  Note that I needed to fix a 
test that violated the file object protocol with a read() method that ignored 
the size parameter.

--
Added file: http://bugs.python.org/file43973/issue12319_9.patch

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-08-02 Thread Martin Panter

Martin Panter added the comment:

For the record, I presume you are referring to Issue 27435.

--

___
Python tracker 

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



[issue27668] list illogical affectation

2016-08-02 Thread antoine Zellmeyer

New submission from antoine Zellmeyer:

>>> tab = [['x']*3]*3
>>> tab
[['x', 'x', 'x'], ['x', 'x', 'x'], ['x', 'x', 'x']]
>>> tab[1][0] = 5
>>> tab
[[5, 'x', 'x'], [5, 'x', 'x'], [5, 'x', 'x']]
>>> 

why not only the element tab[1][0] is changed ?

--
assignee: terry.reedy
components: IDLE, Interpreter Core, Macintosh
messages: 271817
nosy: antoine Zellmeyer, ned.deily, ronaldoussoren, terry.reedy
priority: normal
severity: normal
status: open
title: list illogical affectation
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, 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



[issue27668] list illogical affectation

2016-08-02 Thread SilentGhost

SilentGhost added the comment:

Because elements of the tab list are the same list. And since list is a mutable 
type, modifying list object will be visible to via all the reference / names 
that point to that object. There are various ways to work around this 
behaviour, typically a list comprehension is used.

P.S. Please don't add spurious components to the issue, it adds people to the 
nosy list.

--
components:  -IDLE, Macintosh
nosy: +SilentGhost
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



[issue27668] list illogical affectation

2016-08-02 Thread Emanuel Barry

Emanuel Barry added the comment:

To add to what SilentGhost just said; the '*' operator for lists doesn't create 
new lists, but simply creates new references to the same list (i.e. it doesn't 
re-evaluate the expression).

To create separate lists, you can do a list comprehension such as:

[['x'] * 3 for _ in range(3)]

More information is available on the FAQ: 
https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x

--
assignee: terry.reedy -> 
nosy: +ebarry

___
Python tracker 

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



[issue27666] "stack smashing detected" in PyCursesWindow_Box

2016-08-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
stage:  -> needs patch

___
Python tracker 

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



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

2016-08-02 Thread Martin Panter

Martin Panter added the comment:

For 2.7, adding the automatic RTLD_MEMBER mode does not seem like a bug fix to 
me. Currently, I understand this code could load two separate libraries:

file = CDLL("libcrypto.a(libcrypto.so.1.0.0)")
member = CDLL("libcrypto.a(libcrypto.so.1.0.0)", DEFAULT_MODE | 0x0004)

With your proposed change, the first line will do the same as the second line, 
and Python will no longer provide a way to load a file named like in the first 
operation. Maybe this is okay for the next version of Python 3 (because it is 
only breaking a rare corner case), but my view is it is not worth changing 2.7.

--
nosy: +martin.panter
title: ctypes and AIX - also for 2.7.X (and later) -> ctypes library loading 
and AIX - also for 2.7.X (and later)

___
Python tracker 

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



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

2016-08-02 Thread Martin Panter

Martin Panter added the comment:

If you are still figuring out Mercurial, maybe see 
 and 
 if you haven’t already.

--

___
Python tracker 

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



[issue27657] urlparse fails if the path is numeric

2016-08-02 Thread Martin Panter

Martin Panter added the comment:

Depends on how you define “looks like an IP address”. Does the www.cwi.nl:80 
case look like an IP address? What about “path:80” or “localhost:80”? If there 
is any code relying on the bug, it may just as easily involve host name as a 
numeric IP address.

--

___
Python tracker 

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-08-02 Thread Berker Peksag

Berker Peksag added the comment:

The test code in issue27558_v2.patch looks OK to me.

--

___
Python tracker 

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



[issue27657] urlparse fails if the path is numeric

2016-08-02 Thread R. David Murray

R. David Murray added the comment:

Ah, good point, I misread the scope of the problem.

--

___
Python tracker 

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



[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-08-02 Thread Emanuel Barry

Emanuel Barry added the comment:

Obligatory monthly ping.

--

___
Python tracker 

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



[issue24844] Python 3.5rc1 compilation error with Apple clang 4.2 included with Xcode 4

2016-08-02 Thread Mojca Miklavec

Changes by Mojca Miklavec :


--
keywords: +patch
Added file: 
http://bugs.python.org/file43974/python3.5.2-should-not-use-libatomic-with-old-clang.diff

___
Python tracker 

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



[issue24844] Python 3.5rc1 compilation error with Apple clang 4.2 included with Xcode 4

2016-08-02 Thread Mojca Miklavec

Changes by Mojca Miklavec :


Added file: 
http://bugs.python.org/file43975/python3.5.2-should-not-use-libatomic-with-old-clang.diff

___
Python tracker 

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



[issue24844] Python 3.5rc1 compilation error with Apple clang 4.2 included with Xcode 4

2016-08-02 Thread Mojca Miklavec

Changes by Mojca Miklavec :


Removed file: 
http://bugs.python.org/file43974/python3.5.2-should-not-use-libatomic-with-old-clang.diff

___
Python tracker 

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



[issue9303] Migrate sqlite3 module to _v2 API to enhance performance

2016-08-02 Thread Dima Tisnek

Dima Tisnek added the comment:

Can someone review Aviv's patch?

--

___
Python tracker 

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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2016-08-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

True. Then we should use the condition "new_allocated > PY_SSIZE_T_MAX". This 
can be even more efficient.

--

___
Python tracker 

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



[issue6926] socket module missing IPPROTO_IPV6, IPPROTO_IPV4

2016-08-02 Thread Berker Peksag

Berker Peksag added the comment:

Py_WINVER has been updated to use 0x0600 (_WIN32_WINNT_VISTA) in 57e2549cc9a6 
(issue 23451) Since the consensus was to keep 2.7 as is I'm closing this as 
'out of date'.

--
nosy: +berker.peksag
resolution:  -> out of date
stage: needs patch -> 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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2016-08-02 Thread Xiang Zhang

Xiang Zhang added the comment:

So how about list_resize_v2.patch?

--
Added file: http://bugs.python.org/file43976/list_resize_v2.patch

___
Python tracker 

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



[issue24637] locals dictionary in PyRun_String

2016-08-02 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage:  -> patch review
versions:  -Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue24637] locals dictionary in PyRun_String

2016-08-02 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

the patch makes sense for me.

--
nosy: +matrixise

___
Python tracker 

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



[issue27594] Assertion failure when running "test_ast" tests with coverage.

2016-08-02 Thread Quentin Pradet

Changes by Quentin Pradet :


--
nosy: +Quentin.Pradet

___
Python tracker 

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



[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-08-02 Thread Ethan Furman

Ethan Furman added the comment:

Did a little rewording and trimming (and formatting).  Tried to keep the ideas 
while not being so verbose.

--
Added file: http://bugs.python.org/file43977/issue27242.stoneleaf.01.patch

___
Python tracker 

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



[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-08-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-08-02 Thread Emanuel Barry

Emanuel Barry added the comment:

Thanks Ethan for the improved patch! Pointed out a typo and some nits, but 
other than that it's mostly good. I'm not that good at brevity, and I think 
your patch is much better on that regard :)

--

___
Python tracker 

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



[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-08-02 Thread Ethan Furman

Ethan Furman added the comment:

Fixed the typos (thanks!), removed the self-reference, and went with "similar 
names and purposes".

--

___
Python tracker 

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



[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Марк Коренберг

Changes by Марк Коренберг :


--
keywords: +patch
Added file: http://bugs.python.org/file43978/host_net.patch

___
Python tracker 

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



[issue27574] Faster parsing keyword arguments

2016-08-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--

___
Python tracker 

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



[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Stefan Krah

Stefan Krah added the comment:

Марк, sorry for all this negativity. ;)

But I'm also -1.  What is wrong with socket.ntohs() etc.?

--
nosy: +skrah

___
Python tracker 

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



[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Марк Коренберг

Марк Коренберг added the comment:

1. I forgot to say: since I add new items to `if.. elif...elif.` chain 
after testing for 'big' and 'little', this change will not slowdown current 
external code.
2. Well, slowdown of to_bytes() between 'big' and 'net' on my PC give about 3 
percents.
3. to_bytes(2, sys.byteorder) is timed exactly as 'host'.


./python -m timeit -s 'import sys' -n 1000 '(1234).to_bytes(2, 
sys.byteorder)' # iteration counter is required to stabilize results.

4. As I think, Python should also be simple and intuitive. If everyone thinks 
as those, who set (-1) on this issue, we will neve add 
.to_bytes()/.from_bytes(), since there are already TWO (!) modules to do 
conversion to/from bytes: `ctypes` 
(https://docs.python.org/3/library/ctypes.html#ctypes.BigEndianStructure) and 
`struct`. Answer is: it is unsuitable and not comfort for the programmer. Why 
not to make really good practical API ?

And also, I want to call @gvanrossum.. I'm disappointed. This change is so 
obvious thing, that I don't understand how to explain...

--

___
Python tracker 

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



[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Марк Коренберг

Марк Коренберг added the comment:

@skrah, what about integers with length not equal to 2 or 4 bytes, and also 
signed ?

--

___
Python tracker 

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



[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Марк Коренберг

Changes by Марк Коренберг :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Марк Коренберг

Марк Коренберг added the comment:

Well, I provide the patch, as you can see it is very simple.

--

___
Python tracker 

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



[issue24214] UTF-8 incremental decoder doesn't support surrogatepass correctly

2016-08-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch slows down decoding up to 20%.

$ ./python -m timeit -s 'b = b"\xc4\x80"*1' -- 'b.decode()'
Unpatched:  1 loops, best of 3: 50.8 usec per loop
Patched:1 loops, best of 3: 63.3 usec per loop

And I'm not sure that fixing only for the surrogatepass handler is enough. 
Other standard error handlers look working, but what if a user handler consumes 
more then one byte?

--
components: +Interpreter Core
priority: normal -> high

___
Python tracker 

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



[issue27241] Catch exceptions raised in pstats add (repl)

2016-08-02 Thread Joe Jevnik

Joe Jevnik added the comment:

bump

--

___
Python tracker 

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



[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm also -1.

--

___
Python tracker 

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



[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Марк, thank you for the suggestion, but we've decided to decline the request.

--
nosy: +rhettinger
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



[issue24082] Obsolete note in argument parsing (c-api/arg.rst)

2016-08-02 Thread Berker Peksag

Berker Peksag added the comment:

The patch looks good to me. Note that the patch in issue 24278 also removes the 
same note.

--
nosy: +berker.peksag
stage:  -> patch review
type:  -> behavior
versions: +Python 3.5, Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26109] _Py_DumpTraceback should be PyAPI_FUNC

2016-08-02 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report. This has already been fixed in 4f5e4155c259 ( Python 
3.5+)

--
nosy: +berker.peksag
resolution:  -> out of date
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



[issue20767] Some python extensions can't be compiled with clang 3.4

2016-08-02 Thread Evelyn Mitchell

Evelyn Mitchell added the comment:

The patch looks reasonable, but needs to be tested on FreeBSD.

--
nosy: +Evelyn Mitchell

___
Python tracker 

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



[issue22557] Local import is too slow

2016-08-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Brett.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue22557] Local import is too slow

2016-08-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 64f195790a3a by Serhiy Storchaka in branch 'default':
Issue #22557: Now importing already imported modules is up to 2.5 times faster.
https://hg.python.org/cpython/rev/64f195790a3a

--
nosy: +python-dev

___
Python tracker 

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



[issue27241] Catch exceptions raised in pstats add (repl)

2016-08-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d9e25fe35f46 by Stefan Krah in branch '3.5':
Issue #27241: Catch exception when running pstats as main.
https://hg.python.org/cpython/rev/d9e25fe35f46

--
nosy: +python-dev

___
Python tracker 

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



[issue27241] Catch exceptions raised in pstats add (repl)

2016-08-02 Thread Stefan Krah

Stefan Krah added the comment:

Yes, I agree this is nicer. Thanks for the patch.

--
nosy: +skrah

___
Python tracker 

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



[issue27241] Catch exceptions raised in pstats add (repl)

2016-08-02 Thread Stefan Krah

Changes by Stefan Krah :


--
assignee:  -> skrah
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.5

___
Python tracker 

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




[issue20767] Some python extensions can't be compiled with clang 3.4

2016-08-02 Thread koobs

koobs added the comment:

Nothing is required (as far as I'm aware) other than commit/merge on a two line 
change scoped only to FreeBSD.

The issue was reported for and on FreeBSD and the patch has been carried 
locally in all FreeBSD Python ports/packages (2.7, 3.3, 3.4, 3.5) for over two 
years:

https://svnweb.freebsd.org/ports?view=revision&revision=346428
https://svnweb.freebsd.org/ports?view=revision&revision=351610

--

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2016-08-02 Thread Evelyn Mitchell

Evelyn Mitchell added the comment:

I think this patch should pass to the next stage.
Thank you, koobs.

--

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2016-08-02 Thread Stefan Krah

Stefan Krah added the comment:

We can of course commit this, but could you also lobby here?

   https://llvm.org/bugs/show_bug.cgi?id=18164


I'm seeing this quite often that we fix something here and no one insists on 
the upstream bug trackers.

--

___
Python tracker 

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



[issue27669] Bug in re.fullmatch() specific to Windows XP

2016-08-02 Thread Geoffrey Odhner

New submission from Geoffrey Odhner:

I have found a bug in python’s re.fullmatch() function when it’s running on 
Windows XP.  On Mac OS X or Windows 7 the bug doesn’t occur.  When I use 
fullmatch() with a regular expression that ends with ‘$’ it fails to match the 
string (on XP, but it matches on Mac OS and Win 7), but when I use that same 
regular expression with match() it works.  I’m not in urgent need of a fix, 
since replacing those particular calls with match() gets around the problem and 
is giving consistent behavior across platforms, but the inconsistency in 
behavior in fullmatch() between platforms should be fixed.  I’m using python 
3.4.3 on all three platforms.

--
components: Regular Expressions
messages: 271853
nosy: ezio.melotti, ggodhner, mrabarnett
priority: normal
severity: normal
status: open
title: Bug in re.fullmatch() specific to Windows XP
type: behavior
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



[issue27669] Bug in re.fullmatch() specific to Windows XP

2016-08-02 Thread Zachary Ware

Zachary Ware added the comment:

Since this is not a security issue, 3.4 is in security fix only mode, and 
Windows XP is no longer supported in Python 3.5+, this will not be fixed.  
Thus, I'm closing the issue.

However, this is bizarre :).  There is no Windows-version-specific code in the 
re module, so the behavior should be exactly the same between XP and 7.  Are 
you absolutely certain you're using exactly the same regular expression with 
exactly the same input on all three platforms?

--
nosy: +zach.ware
resolution:  -> out of date
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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-02 Thread John Hagen

John Hagen added the comment:

@Ethan

I reviewed your latest patch.  I think it's a good step forward in terms of 
simplicity.  Most of my comments were not major.

Even before this patch, I was mulling around how enum.Unique, enum.UniqueEnum, 
and enum.unique seemed to violate the "There should be one obvious way to do 
it" principle, so I like that you omitted those in the latest patch.

Looks good to me, thanks for all of your work!

--

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2016-08-02 Thread koobs

koobs added the comment:

@Stefan I've notified our FreeBSD Clang/LLVM people of the upstream bug status, 
though there are indications that the "-Wl,-rpath" method is considered the 
recommended/canonical/future way to do things properly.

--

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2016-08-02 Thread Evelyn Mitchell

Evelyn Mitchell added the comment:

Stefan, I've commented on the llvm bugzilla.

Thanks for suggesting that.

--

___
Python tracker 

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



[issue23710] C API doc for PyObject_HEAD is outdated

2016-08-02 Thread Evelyn Mitchell

Evelyn Mitchell added the comment:

There is a patch, and it looks good to me. This should be moved into 'commit 
review' state.

--
nosy: +Evelyn Mitchell

___
Python tracker 

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



[issue27661] Add tzinfo= argument to datetime.combine

2016-08-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset adce94a718e3 by Alexander Belopolsky in branch 'default':
Closes #27661: Added tzinfo keyword argument to datetime.combine.
https://hg.python.org/cpython/rev/adce94a718e3

--
nosy: +python-dev
resolution:  -> fixed
stage: commit 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



[issue23710] C API doc for PyObject_HEAD is outdated

2016-08-02 Thread Evelyn Mitchell

Evelyn Mitchell added the comment:

Changed to commit review.

--
stage: needs patch -> commit review

___
Python tracker 

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



[issue27669] Bug in re.fullmatch() specific to Windows XP

2016-08-02 Thread Matthew Barnett

Matthew Barnett added the comment:

FTR, I can't reproduce it. This is what I get on Windows XP (32-bit):

Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> re.fullmatch('abc$', 'abc')
<_sre.SRE_Match object; span=(0, 3), match='abc'>
>>>

--

___
Python tracker 

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



[issue26267] UUID docs should say how to get "standard form"

2016-08-02 Thread Ammar Askar

Ammar Askar added the comment:

Fixed the str() representation as per Evelyn's comment.

--
Added file: http://bugs.python.org/file43979/uuiddocs.diff2

___
Python tracker 

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



[issue26267] UUID docs should say how to get "standard form"

2016-08-02 Thread Ammar Askar

Ammar Askar added the comment:

Whoops, didn't export the patch properly there so it didn't get picked up by 
the review tool, this should fix it.

--
Added file: http://bugs.python.org/file43980/uuiddocs.diff3

___
Python tracker 

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



[issue27669] Bug in re.fullmatch() specific to Windows XP

2016-08-02 Thread Geoffrey Odhner

Geoffrey Odhner added the comment:

I'm quite sure it's the same regular expression with the same code.  It was a 
puzzling bug, and I thought it might take more to track it down than it did.  I 
tried changing the file encoding on both the code and the data, and found that 
the problem didn't arise from that, or at least couldn't be fixed that way.  I 
copied the files to the XP machine via a flash drive, and every copy warned me 
that the properties for the files were being lost.  Otherwise the files were 
directly copied between machines.  Are strings stored identically on Windows XP 
and Windows 7?  If there is some variation in what the ends of strings look 
like on the two platforms, that might explain the discrepancy.

Since Matthew Barnett reports being unable to reproduce the problem, I'll 
provide you with the full code and data I've used as a demonstration of the 
problem.  The INCLUDE and DEFINE lines produce output for both match() and 
fullmatch() calls on Windows 7, but only for match() calls on Windows XP.

My command line for running this code was: .\test.py
This was run in the directory in which both files are saved.

Of course it's possible that I've missed some other bug in my code that causes 
these regular expressions to match differently between platforms, but match() 
and fullmatch() are working the same on both Mac OS and Windows 7.  I will 
appreciate your comments.

Best regards,

Geoff Odhner

> -Original Message-
> From: Zachary Ware [mailto:rep...@bugs.python.org]
> Sent: Tuesday, August 02, 2016 5:21 PM
> To: geoff...@odhner.net
> Subject: [issue27669] Bug in re.fullmatch() specific to Windows XP
> 
> 
> Zachary Ware added the comment:
> 
> Since this is not a security issue, 3.4 is in security fix only mode,
> and Windows XP is no longer supported in Python 3.5+, this will not be
> fixed.  Thus, I'm closing the issue.
> 
> However, this is bizarre :).  There is no Windows-version-specific code
> in the re module, so the behavior should be exactly the same between XP
> and 7.  Are you absolutely certain you're using exactly the same
> regular expression with exactly the same input on all three platforms?
> 
> --
> nosy: +zach.ware
> resolution:  -> out of date
> stage:  -> resolved
> status: open -> closed
> 
> ___
> Python tracker 
> 
> ___

--
Added file: http://bugs.python.org/file43981/test.py
Added file: http://bugs.python.org/file43982/test.txt

___
Python tracker 

___#! /usr/local/bin/python3

import sys, os, argparse, time, re, shutil, socket

class Box:
pass

def main(argv):
global errors
errors = False
regexes = Box()
regexes.define = re.compile('^[\t ]*DEFINE:[\t ]*'

'\$(?P\{)?(?P[A-Z0-9_.]+)(?(brace)\})'
'[\t ]*=[\t ]*'
'(?P((?P-)|([#A-Z]))?[.0-9]+)'
'[ \t\r]*(;.*|\(.*\))?$', flags=re.IGNORECASE)
regexes.include = re.compile('^[\t ]*INCLUDE:[\t ]*'
 '((?P[\'"])(?P[^\'"]+)'
 '(?P=quote)|(?P[^\t ]+))'
 '[ \t\r]*(;.*|\(.*\))?$', flags=re.IGNORECASE)

def process_file(filename):
nonlocal regexes
infile = open(filename, encoding='utf-8')
if not infile:
log_error(0, "Input file couldn't be opened ", filename)
return
file_contents = infile.read()
lines = file_contents.split('\n')

for lineno in range(0, len(lines)):
line = lines[lineno].strip()
lines[lineno] = line

found = regexes.include.fullmatch(line)
if found:
print('Include line fullmatch: ', line, file=sys.stderr)

found = regexes.include.match(line)
if found:
print('Include line match: ', line, file=sys.stderr)

found = regexes.define.fullmatch(line)
if found:
print('Define line fullmatch: ', line, file=sys.stderr)

found = regexes.define.match(line)
if found:
print('Define line match: ', line, file=sys.stderr)

process_file('test.txt')


if __name__ == "__main__":
global errors
main(sys.argv[1:])
sys.exit(errors)


INCLUDE:Constants.cnc

DEFINE: $Version.Number = #500
;; Shared Variables:
DEFINE: $Configured.Head.Thickness  = #501
DEFINE: $Top.Fillet.Radius  = #507
DEFINE: $Bottom.Fillet.Radius   = #508
DEFINE: $Groove.Undercut   

[issue20215] socketserver can not listen IPv6 address

2016-08-02 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue23710] C API doc for PyObject_HEAD is outdated

2016-08-02 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
nosy: +matrixise

___
Python tracker 

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



[issue20215] socketserver.TCPServer can not listen IPv6 address

2016-08-02 Thread Gregory P. Smith

Gregory P. Smith added the comment:

TL;DR - We really need reliable tests for the exact behavior we want before 
coming up with patches.

attached is a patch (-gps01) that would do the same thing as Lib/smtpd.py 
does... But I'm not convinced it is a good idea.

Would forcing a socket.getaddrinfo() call from the constructor cause problems?  
This would be new behavior over what TCPServer did in the past.  Could it 
trigger a blocking reverse DNS lookup where there wasn't one in the past?

What about when server_address[0] is ''?  getaddrinfo() fails on that, but the 
existing code works and binds to 0.0.0.0.  Presumably this should bind via 
AF_INET6 if the host supports it but a simple getaddrinfo() call doesn't tell 
us that.

--
title: socketserver can not listen IPv6 address -> socketserver.TCPServer can 
not listen IPv6 address
Added file: http://bugs.python.org/file43983/issue20215-gps01.diff

___
Python tracker 

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



[issue27669] Bug in re.fullmatch() specific to Windows XP

2016-08-02 Thread Matthew Barnett

Matthew Barnett added the comment:

When I tried it, I got matches for both 'match' and 'fullmatch' (output 
attached as 'output.txt') as expected.

--
Added file: http://bugs.python.org/file43984/output.txt

___
Python tracker 

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



[issue27670] Use https instead of http in the PYTHON_VERSION constant

2016-08-02 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

The current url for bugs.python.org uses http and not https.

I propose a patch with https,

--
components: Interpreter Core
messages: 271867
nosy: matrixise
priority: normal
severity: normal
status: open
title: Use https instead of http in the PYTHON_VERSION constant
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



[issue27670] Use https instead of http in the PYTHON_VERSION constant

2016-08-02 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
keywords: +patch
Added file: http://bugs.python.org/file43985/issue27670.diff

___
Python tracker 

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



[issue20215] socketserver.TCPServer can not listen IPv6 address

2016-08-02 Thread Paul Marks

Changes by Paul Marks :


--
nosy: +Paul Marks

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-02 Thread Ethan Furman

Ethan Furman added the comment:

Okay, I think I'm done making changes unless any more mistakes are found.

Thanks everyone for the pushing, prodding, and feedback!

--
Added file: http://bugs.python.org/file43986/issue26988.stoneleaf.05.patch

___
Python tracker 

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



[issue20215] socketserver.TCPServer can not listen IPv6 address

2016-08-02 Thread Martin Panter

Martin Panter added the comment:

I also have reservations about using getaddrinfo() like this. Some potential 
problems:

1. IPv4-only compatibility: On my Linux computer, getaddrinfo("localhost", 0) 
returns AF_INET6 before AF_INET. Some programs, like Firefox and BSD netcat, 
will try both v4 and v6 and probably succeed (netcat first warned about 
“connection refused” for IPv4). However, other programs only support IPv4 at 
all or by default. Socat supports v6 but requires an explicit TCP6 or pf=ip6 
argument. Gnu netcat only seems to support IPv4. This could also have been a 
problem with smtpd, or maybe SMTP clients are supposed to be smarter and it is 
okay (I am not familiar with the protocol).

2. Similarly, maybe getaddrinfo() could return AF_INET first even though the 
user made a subclass with address_family = AF_INET6.

3. It seems a waste to do a DNS lookup just to choose the address_family and 
throw away the resolved addresses, only to then call bind() which will do the 
lookup all over again. If DNS times out, the delay until error reporting will 
be twice as long.

4. getaddrinfo(("", None)) has a short delay (DNS timeout?) for me. The Python 
documentation says the empty string "" is special-cased to mean INADDR_ANY 
(IPv4). It also says there is no special case for the IPv6 equivalent 
(in6addr_any), although it does seem to work in some cases, including bind(). 
But getaddrinfo() would parse the string in the underlying platform, not in 
Python.

Some ideas:

1. Don’t look up hostnames, and only determine IPv6 if a numerical IP address 
is specified. I think this closer to the original proposal. Maybe use 
AI_NUMERICHOST? Or the simplistic test proposed in Issue 24209?

2. For the empty string address "", if the platform supports dual stack, use 
AF_INET6, bind to “::” and clear the IPV6_V6ONLY option. See Issue 3213.

3. Bind sockets to all addresses returned by getaddrinfo(), not just the first. 
But this would be a much bigger and more radical change. Maybe just something 
to dream about. :)

4. Add an address_family parameter to the constructor, so the user can change 
to AF_INET6 without subclassing.

--

___
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-08-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The file has the correct format for review, applies cleanly, and tests pass.  
The relief is gone (easy).  The buttons are no longer symmetrical; this looks 
'wrong' to me.  (My reaction might be different if the widget was much wider, 
so the buttons were clearly right-justified rather than looking like their 
placement had a bug.)  This results from using 3 columns instead of 2.  I want 
to try the latter.   I will switch error messages to the widget, see what 
happens, and deal with needed test changes.  I will post before committing so 
you can test on Mac first.

--

___
Python tracker 

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



[issue20215] socketserver.TCPServer can not listen IPv6 address

2016-08-02 Thread Paul Marks

Paul Marks added the comment:

First off, the server_address=('localhost', port) case: this feature is 
fundamentally broken without support for multiple sockets, because the server 
can listen on at most one address, and any single choice will often be 
inconsistent with clients' expectations.

For the (ip, port) case, the only question is whether an IPv4 address should 
create an AF_INET or dualstack (IPV6_V6ONLY=0) AF_INET6 socket; the latter 
needs a.b.c.d -> :::a.b.c.d translation.

Then there's the typical ('', port) case.  This should ideally create a server 
that accepts a connection on any supported family:
- If the system supports dualstack AF_INET6 sockets, use one.
- If the system only supports AF_INET sockets, use AF_INET.
- If the system only supports AF_INET6 sockets, use AF_INET6.
- If the system supports AF_INET and AF_INET6, but not dualstack, then you need 
multiple sockets.  Or go with AF_INET and hope nobody needs IPv6 on such a 
system.

(The legacy-free simple approach is to hard-code AF_INET6 and let the OS decide 
whether the socket should be dualstack or IPv6-only, but that only supports 2/4 
of the above cases.)

Users of "conn, addr = self.get_request()" often expect addr to be an IPv4 
2-tuple, especially when handling IPv4 requests.  So you have to normalize 
(':::192.0.2.1', 1234, 0, 0) to ('192.0.2.1', 1234).  For real IPv6 
requests, it's often more convenient to keep returning 2-tuples ('2001:db8::1', 
1234) instead of 4-tuples.

Another thing to watch out for is this HTTPServer code:
host, port = self.socket.getsockname()[:2]
self.server_name = socket.getfqdn(host)

getfqdn() has a special case for '0.0.0.0', which doesn't recognize the IPv6 
equivalents:
>>> import socket
>>> socket.getfqdn('0.0.0.0')
   'redacted.corp.google.com'
>>> socket.getfqdn('::')
   '::'
   >>> socket.getfqdn(':::0.0.0.0')
   ':::0.0.0.0'

--

___
Python tracker 

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



[issue20215] socketserver.TCPServer can not listen IPv6 address

2016-08-02 Thread Martin Panter

Martin Panter added the comment:

Paul, if the user specifically wants to bind to a numeric IPv4 address, is 
there any advantage of choosing the dual-stack IPV6_V6ONLY=0 mode with a mapped 
:::a.b.c.d address?

--

___
Python tracker 

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



[issue1005895] curses for win32

2016-08-02 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue20215] socketserver.TCPServer can not listen IPv6 address

2016-08-02 Thread Paul Marks

Paul Marks added the comment:

> if the user specifically wants to bind to a numeric IPv4 address, is there 
> any advantage of choosing the dual-stack [...]?

If you're in a position to write AF_INET6-only code, then dualstack sockets can 
make things a bit cleaner (one family for all IP communication).  But given 
that Python couldn't reasonably drop support for AF_INET-only systems, there's 
not a compelling reason to prefer dualstack sockets for IPv4 stuff.

They're just two windows into the same kernel code, so the decision is mostly 
arbitrary.

However, Python likes to expose IP addresses as plain strings without 
transparent :::0.0.0.0/96 handling, which tends to make dualstack sockets a 
leaky abstraction.  Ideally, you'd be able to talk to the kernel using AF_INET 
or AF_INET6 without normal users knowing the difference.

--

___
Python tracker 

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



[issue27570] Avoid memcpy(. . ., NULL, 0) etc calls

2016-08-02 Thread Martin Panter

Martin Panter added the comment:

Patch 3 fixes some more cases I found in the array module:

>>> a + a
Modules/arraymodule.c:809:5: runtime error: null pointer passed as argument 1, 
which is declared to never be null
Modules/arraymodule.c:809:5: runtime error: null pointer passed as argument 2, 
which is declared to never be null
Modules/arraymodule.c:810:5: runtime error: null pointer passed as argument 1, 
which is declared to never be null
Modules/arraymodule.c:810:5: runtime error: null pointer passed as argument 2, 
which is declared to never be null
array('B')
>>> a * 3
Modules/arraymodule.c:840:9: runtime error: null pointer passed as argument 1, 
which is declared to never be null
Modules/arraymodule.c:840:9: runtime error: null pointer passed as argument 2, 
which is declared to never be null
array('B')
>>> a += a
Modules/arraymodule.c:952:5: runtime error: null pointer passed as argument 1, 
which is declared to never be null
Modules/arraymodule.c:952:5: runtime error: null pointer passed as argument 2, 
which is declared to never be null

I wondered if there is a good argument for fixing these, or if it is only a 
theoretical problem. Apparently GCC can do optimizations about null pointer 
tests: . I don’t think any of the 
cases I found are instances of this problem, but I think fixing them helps keep 
the UB sanitizer output clean, so any errors causing practical behaviour 
problems will be easier to find.

--
Added file: http://bugs.python.org/file43987/memcpy-null.v3.patch

___
Python tracker 

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



[issue24278] Docs on Parsing arguments should say something about mem mgmt for formatters returning C strings

2016-08-02 Thread Martin Panter

Martin Panter added the comment:

Will commit this soon, apart from dropping “such as bytearray” for s#, which I 
don’t remember the reasoning.

--
stage: patch review -> commit review
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



[issue26267] UUID docs should say how to get "standard form"

2016-08-02 Thread Berker Peksag

Berker Peksag added the comment:

> It also indents the attributes and descriptions to emphasize that they are 
> part of the UUID instance, not the uuid module. 

Thanks for the patch, but please revert unrelated changes.

--
nosy: +berker.peksag
stage: needs patch -> patch review

___
Python tracker 

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