[issue27446] struct: allow per-item byte order

2017-03-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with the other reviewers.  Am going to mark this as closed.

If the need arises, just make multiple struct unpacks.

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



[issue29908] Inconsistent crashing with an access violation

2017-03-25 Thread Cameron Mckain

Changes by Cameron Mckain :


--
type:  -> crash

___
Python tracker 

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



[issue29908] Inconsistent crashing with an access violation

2017-03-25 Thread Cameron Mckain

New submission from Cameron Mckain:

Almost every time I attempt to run my Django server ("python manage.py 
runserver") from PyCharm, python.exe crashes with the error "Unhandled 
exception at 0x7647BD9E (ucrtbase.dll) in python.exe: 0xC005: Access 
violation reading location 0x03BF8000." and "Process finished with exit code 
-1073741819 (0xC005)" is printed in the console. These errors only happen 
about 90% of the time.

--
messages: 290504
nosy: Cameron Mckain
priority: normal
severity: normal
status: open
title: Inconsistent crashing with an access violation

___
Python tracker 

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



[issue29907] Unicode encoding failure

2017-03-25 Thread Robert Baker

New submission from Robert Baker:

Using Python 2.7 (not IDLE) on Windows 10.

I have tried to use a Python 2.7 program to print the name of Czech composer 
Antonín Dvořák. I remembered to add the "u" before the string, but regardless 
of whether I encode the caron-r as a literal character (pasted from Windows 
Character Map) or as \u0159, it gives the error that character 0159 is 
undefined. This is incorrect; that character has been defined as "lower case r 
with caron above" for several years now. (The interpreter has no problem with 
the ANSI characters in the string.)

--
messages: 290503
nosy: Robert Baker
priority: normal
severity: normal
status: open
title: Unicode encoding failure
type: behavior
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



[issue29906] Add callback parameter to concurrent.futures.Executor.map

2017-03-25 Thread Aron Bordin

New submission from Aron Bordin:

I'm facing some situations where would be helpful to be able to add a default 
function callback when calling the Executor.map. So, when making calls with 
this command we could get the executor result easily.

I think that we could provide a callback parameter to the map function, that 
adds the callable to the future (similar to add_done_callback).

--
components: Library (Lib)
messages: 290502
nosy: aron.bordin
priority: normal
severity: normal
status: open
title: Add callback parameter to concurrent.futures.Executor.map
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29905] TypeErrors not formatting values correctly

2017-03-25 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
pull_requests: +725

___
Python tracker 

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



[issue29903] struct.Struct Addition

2017-03-25 Thread Martin Panter

Martin Panter added the comment:

For the native alignment case (prefix code @), perhaps you can already use the 
“ctypes” module, which supports structures with more complicated embedded 
fields.

For the the unaligned modes (prefixes =, <, > and !), I am a little 
sympathetic. In the past, I wanted to make various structures that extended 
from a common base structure:

HSF_VOL_DESC = Struct("< B 5s B")

# Python 3's "Struct.format" is a byte string!
NSR_DESC = Struct(HSF_VOL_DESC.format.decode() + "B")

But I think if Issue 21071 was fixed (change Struct.format to text string, or 
perhaps add a new attribute), I would be happy enough writing

NSR_DESC = Struct(HSF_VOL_DESC.format_str + "B")

Transforming Aviv’s examples:

s3 = Struct(s1.format_str + s2.format_str[1:])
s3 = Struct(s1.format_str + "B")  # if s2 is not needed on its own
ver2 = Struct(ver1.format_str + "I")
version_a = Struct(start.format_str + union_b.format_str[1:])

--
nosy: +martin.panter

___
Python tracker 

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



[issue21071] struct.Struct.format is bytes, but should be str

2017-03-25 Thread Martin Panter

Martin Panter added the comment:

A backwards-compatible way forward would be to preserve (and document) the 
“format” attribute as a byte string, and add a new attribute which is 
definitely a text string. Not sure of a good name; perhaps “Struct.text_format” 
or “format_str” is a start.

--

___
Python tracker 

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



[issue29905] TypeErrors not formatting values correctly

2017-03-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +giampaolo.rodola, haypo, josiahcarlson, stutzbach, yselivanov

___
Python tracker 

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



[issue29905] TypeErrors not formatting values correctly

2017-03-25 Thread Jim Fasarakis-Hilliard

New submission from Jim Fasarakis-Hilliard:

Specifically, in both Lib/async/proactor_events.py and asynchat.py there's a 
comma where a % should be thereby not formatting the value correctly:

TypeError('data argument must be byte-ish (%r)', type(data))
TypeError('data argument must be byte-ish (%r)', type(data))

proposed fix is to change them to:

TypeError('data argument must be a bytes-like object, not %r' % 
type(data).__name__)
TypeError('data argument must be a bytes-like object, not %r' % 
type(data).__name__)

--
components: Library (Lib)
messages: 290499
nosy: Jim Fasarakis-Hilliard
priority: normal
severity: normal
status: open
title: TypeErrors not formatting values correctly
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue27446] struct: allow per-item byte order

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I concur with Martin.

--
nosy: +mark.dickinson, meador.inge, serhiy.storchaka
resolution:  -> rejected

___
Python tracker 

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



[issue10030] Patch for zip decryption speedup

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Brian, you requested tests, but PR 550 doesn't add new API and doesn't change 
the behavior of public API. No new tests are needed.

--
nosy: +brian.curtin
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue27446] struct: allow per-item byte order

2017-03-25 Thread Martin Panter

Martin Panter added the comment:

This seems too obscure to be worth supporting in the built-in library IMO. The 
use case loses one line of code but gains a more complicated structure format 
string.

--
nosy: +martin.panter

___
Python tracker 

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



[issue29904] Fix a number of error message typos

2017-03-25 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
pull_requests: +724

___
Python tracker 

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



[issue29903] struct.Struct Addition

2017-03-25 Thread Aviv Palivoda

Aviv Palivoda added the comment:

I have two use cases for this feature:
1.

struct a {
int a;
#ifdef VER2
unsigned int b;
#endif
}

Now I may do:
>>> ver1 = Struct("i")
>>> ver2 = ver1 + Struct("I")

2.

struct a {
int a;
union inner {
int b;
unsigned int c;
} u;
}

As you can see with this feature I may do:
>>> start = Struct("i")
>>> union_b = Struct("i")
>>> union_c = Struct("I")
>>> version_a = start + union_b
>>> version_b = start + union_c

If you have a big struct with many options in the union this save's copying the 
initial format.

> As for the concrete implementation, it looks to me that Struct('2L') + 
> Struct('25B') results to Struct('2L5B').

I will fix the case when there is no format provided.

--

___
Python tracker 

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



[issue29904] Fix a number of error message typos

2017-03-25 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Sure, Serhiy, I'll make a PR in a bit.

--

___
Python tracker 

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



[issue29904] Fix a number of error message typos

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Do you want to create a pull request?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue13349] Non-informative error message in index() and remove() functions

2017-03-25 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Additional instances of this:

 - function indexOf of operator.py.
 - function _PySequence_IterSearch of abstract.c

--

___
Python tracker 

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



[issue29904] Fix a number of error message typos

2017-03-25 Thread Jim Fasarakis-Hilliard

New submission from Jim Fasarakis-Hilliard:

Specifically, the list I've currently found in .py files:

- _pyio.py:

ValueError("flush of closed file")
ValueError("flush of closed file")

"of" -> "on" for both.

- configparser.py:

ValueError("Required argument `source' not given.")
ValueError("Cannot specify both `filename' and `source'. "

fix ` on the quotes on argument names.

- windows_utils.py

ValueError("I/O operatioon on closed pipe")

"operatioon" -> "operation"

- proactor_events.py, asynchat.py:

TypeError('data argument must be byte-ish (%r)',
raise TypeError('data argument must be byte-ish (%r)',

AFAIK, "byte-ish" isn't used elsewhere, the author probably mean to go for 
"bytes-like object".

- _header_value_parser.py:

errors.HeaderParseError("expected atom at a start of "

"at a start of " -> "at the start of "

- http/cookiejar.py:

raise ValueError("filename must be string-like")

I think "must be a str" was intended.

--
messages: 290491
nosy: Jim Fasarakis-Hilliard
priority: normal
severity: normal
status: open
title: Fix a number of error message typos
versions: Python 3.7

___
Python tracker 

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



[issue29903] struct.Struct Addition

2017-03-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with Serhiy that this proposal is likely to cause more problems than 
it solves.

--
nosy: +rhettinger

___
Python tracker 

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



[issue29898] PYTHONLEGACYWINDOWSIOENCODING isn't implemented

2017-03-25 Thread Steve Dower

Steve Dower added the comment:

Sure, but you're proposing a change to a correctly documented (apart from the 
variable name) and released behavior. It can't be changed in 3.6, and I don't 
see a compelling reason to have different behavior in 3.7.

--

___
Python tracker 

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



[issue29903] struct.Struct Addition

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is the purpose of this feature? Note that the layout of the structure 
consisting of two structures is not the same as the layout of the structure 
consisting of the same fields as separate structures.

struct {
struct {
char a;
short b;
} s1;
struct {
char c;
int d;
} s2;
}

and

struct {
char a;
short b;
char c;
int d;
}

can have different sizes and offsets of fields.

As for the concrete implementation, it looks to me that Struct('2L') + 
Struct('25B') results to Struct('2L5B').

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29720] potential silent truncation in PyLong_AsVoidPtr

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't think there is a bug. There are several ways to get the integer 
representation of the pointer. PyLong_FromVoidPtr() is the most 
straightforward. From Python side id() uses it. printf("%p") is a way of 
getting string representation of the pointer, that string can be converted to 
integer. This way is used in object.__repr__(). Usually %p formats the pointer 
as hexadecimal, but the sign is not defined. Therefore when the pointer is 
converted to the integer it can be interpreted as either signed or unsigned 
integer. PyLong_AsVoidPtr() should accept both representations.

--
nosy: +mark.dickinson, serhiy.storchaka
resolution:  -> not a bug

___
Python tracker 

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



[issue29903] struct.Struct Addition

2017-03-25 Thread Aviv Palivoda

Changes by Aviv Palivoda :


--
pull_requests: +723

___
Python tracker 

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



[issue29903] struct.Struct Addition

2017-03-25 Thread Aviv Palivoda

New submission from Aviv Palivoda:

I would like to suggest that the struct.Struct class will support addition. For 
example you will be able to do:

>>> s1 = Struct(">L")
>>> s2 = Struct(">B")
>>> s3 = s1 + s2
>>> s3.format
b">LB"

--
components: Extension Modules
messages: 290486
nosy: mark.dickinson, meador.inge, palaviv
priority: normal
severity: normal
status: open
title: struct.Struct Addition
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29899] zlib missing when --enable--optimizations option appended

2017-03-25 Thread Ned Deily

Ned Deily added the comment:

--enable-optimizations does not exist in Python 3.4.x so any failures there 
must be due to something else.  Are there any build errors?  Can you show 
exactly where the message comes from?

--
nosy: +ned.deily

___
Python tracker 

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



[issue29902] copy breaks staticmethod

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Copying and pickling of staticmethod objects are not supported. Starting from 
3.6 this raises an exception (see issue22995).

>>> bar.y = copy(staticmethod(foo))
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython3.6/Lib/copy.py", line 96, in copy
rv = reductor(4)
TypeError: can't pickle staticmethod objects

--
components: +Interpreter Core
nosy: +alexandre.vassalotti, barry, serhiy.storchaka
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



[issue18059] Add multibyte encoding support to pyexpat

2017-03-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue18059] Add multibyte encoding support to pyexpat

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Marc-Andre, there are at least two issues about supporting East Asian encodings 
(issue13612 and issue15877). I think this means that that encodings are used in 
XML in wild. Current support of encodings (8-bit + UTF-8 + UTF-16) is enough 
for my needs, but I never have deal with East Asian languages.

Currently the CodecInfo object has an optional flag _is_text_encoding. I think 
we can add more private attributes (flags and precomputed tables) for using 
with the expat parser. If they are not set (third-party encodings) the current 
autodetection code can be used as a fallback.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue29533] urllib2 works slowly with proxy on windows

2017-03-25 Thread Julia Dolgova

Julia Dolgova added the comment:

Could someone look into my PR, please...

--

___
Python tracker 

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



[issue29902] copy breaks staticmethod

2017-03-25 Thread Bruce Frederiksen

New submission from Bruce Frederiksen:

Doing a copy on a staticmethod breaks it:

Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from copy import copy
>>> def foo(): pass
... 
>>> class bar: pass
... 
>>> bar.x = staticmethod(foo)
>>> bar.x.__name__
'foo'
>>> bar.y = copy(staticmethod(foo))
>>> bar.y.__name__
Traceback (most recent call last):
  File "", line 1, in 
RuntimeError: uninitialized staticmethod object

--
components: Library (Lib)
messages: 290481
nosy: dangyogi
priority: normal
severity: normal
status: open
title: copy breaks staticmethod
type: behavior
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



[issue29900] Remove unneeded wrappers in pathlib

2017-03-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29900] Remove unneeded wrappers in pathlib

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 62a99515301fa250feba1a2e0f2d8ea2a29d700e by Serhiy Storchaka in 
branch 'master':
bpo-29900: Simplify pathlib implementation. (#814)
https://github.com/python/cpython/commit/62a99515301fa250feba1a2e0f2d8ea2a29d700e


--

___
Python tracker 

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



[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-25 Thread Louie Lu

Louie Lu added the comment:

Add unittest. Since IPv6 do not support prefix netmask (':ff00::'), it have 
only test like this:

>>> a = ipaddress.ip_interface(('dead:beaf::', '32'))
>>> b = ipaddress.ip_interface('dead:beaf::/32')
>>> str(a) == str(b)

--

___
Python tracker 

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



[issue29901] Support path-like objects in zipapp

2017-03-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29901] Support path-like objects in zipapp

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 4aec9a8be2f2574f249008eb8be76c070fea37eb by Serhiy Storchaka in 
branch 'master':
bpo-29901: Improve support of path-like objects in zipapp. (#815)
https://github.com/python/cpython/commit/4aec9a8be2f2574f249008eb8be76c070fea37eb


--

___
Python tracker 

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



[issue29694] race condition in pathlib mkdir with flags parents=True

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You can monkey-patch os.mkdir and pathlib._NormalAccessor.mkdir.

Without tests we can't be sure that the patch fixes the issue and that the bug 
will be not reintroduced by future changes. Tests are required for this change.

--

___
Python tracker 

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



[issue29862] Fix grammar typo in importlib.reload() exception

2017-03-25 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

I merged Mandeep's PR and backported it into 3.5 and 3.6.
Thanks all :)

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue29862] Fix grammar typo in importlib.reload() exception

2017-03-25 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 55717b4b487a9ccc119ca501fad71937fa01d1f6 by Mariatta in branch 
'3.5':
bpo-29862: Fix grammar in importlib.reload() exception (GH-809) (GH-812)
https://github.com/python/cpython/commit/55717b4b487a9ccc119ca501fad71937fa01d1f6


--

___
Python tracker 

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



[issue29862] Fix grammar typo in importlib.reload() exception

2017-03-25 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 8b82236952619c3838865ff535e5ce77b59b4a78 by Mariatta in branch 
'3.6':
bpo-29862: Fix grammar in importlib.reload() exception (GH-809) (GH-811)
https://github.com/python/cpython/commit/8b82236952619c3838865ff535e5ce77b59b4a78


--

___
Python tracker 

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



[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-25 Thread Eric V. Smith

Eric V. Smith added the comment:

Thanks! Yes, we'll need tests.

I'm out of town most of the weekend, but I'll look at this as soon as I can.

--

___
Python tracker 

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



[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-25 Thread Louie Lu

Louie Lu added the comment:

Eric: I made the patch, reference to which IPv*Network dealing with tuple. 
Should I also add the unittest for it?

Also, can you help me code review this, thanks.

--

___
Python tracker 

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



[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-25 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +722

___
Python tracker 

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



[issue29737] Optimize concatenating empty tuples

2017-03-25 Thread STINNER Victor

STINNER Victor added the comment:

I like the change. It prevents to duplicate tuples and so reduce the memory
footprint. PGO compilation helps branch prediction anyway.

--

___
Python tracker 

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



[issue29901] Support path-like objects in zipapp

2017-03-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +721

___
Python tracker 

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



[issue29901] Support path-like objects in zipapp

2017-03-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch simplifies support of pathlib.Path in zipapp. As a side effect 
zipapp now supports other path-like objects, not just pathlib.Path.

--
components: Library (Lib)
messages: 290470
nosy: paul.moore, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Support path-like objects in zipapp
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-25 Thread Eric V. Smith

Eric V. Smith added the comment:

While an IPv4Interface may be a subclass of an IPv4Address, it definitely has 
more information attached to it: the netmask of the network it's on. So an 
interface (like a network) needs to allow additional parameters to specify the 
netmask.

It should be true that IPv4Interface is like IPv4Network, but it will allow 
arbitrary host bits. A IPv4Network in strict mode will have all zeros for the 
host bits, while a IPv4Network in non-strict mode will allow ones in the host 
bits (see Ilya's original example).

If you look at IPv4Interface.__init__, it actually does just that: creates an 
IPv4Network with strict=False, then extracts the network parts. I'm not exactly 
sure why it also has the int(address[1]) code there, too, since IPvv4Network 
deals with the address[1] part. I would think extracting _prefixlen from the 
network (as it does later in __init__ for the non-tuple case) would be good 
enough.

--

___
Python tracker 

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



[issue29900] Remove unneeded wrappers in pathlib

2017-03-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +720

___
Python tracker 

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



[issue29900] Remove unneeded wrappers in pathlib

2017-03-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Since functions in the os module support path-like objects, the code of the 
pathlib module can be simplified. The wrappers that explicitly convert Path to 
str no longer needed.

--
components: Library (Lib)
messages: 290468
nosy: pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Remove unneeded wrappers in pathlib
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29898] PYTHONLEGACYWINDOWSIOENCODING isn't implemented

2017-03-25 Thread Eryk Sun

Eryk Sun added the comment:

I prefer the name PYTHONLEGACYWINDOWSIOENCODING for symmetry with both 
PYTHONIOENCODING and PYTHONLEGACYWINDOWSFSENCODING, but I suppose you changed 
it to make it more visually distinguished from the latter.

I discovered this issue due to the modified behavior of PYTHONIOENCODING. It's 
not really a disruptive change, but it looks wrong based solely on the --help 
text description of PYTHONIOENCODING. An alternative would be to set 
Py_LegacyWindowsStdioFlag in _Py_InitializeEx_Private either when 
PYTHONLEGACYWINDOWSSTDIO is set or when PYTHONIOENCODING isn't a 
case-insensitive match for "utf-8" with an optional :errors spec. That way 
people get exactly what they asked for, even if it's mojibake nonsense given 
the console's current input and output codepages.

--

___
Python tracker 

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



[issue29737] Optimize concatenating empty tuples

2017-03-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The PR already was merged when you wrote your comment Raymond. If you insist I 
can revert it. But 0f7b0b397e12514ee213bc727c9939b66585cbe2 depends on it.

--

___
Python tracker 

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