[issue26449] Tutorial on Python Scopes and Namespaces uses confusing 'read-only' terminology

2016-02-29 Thread Martijn Pieters

Martijn Pieters added the comment:

+1 for "... can only be read". read-only can too easily be construed to mean 
that the variable cannot be set from *anywhere*, even the original scope. 
Another alternative would be "... is effectively read-only", but "... can only 
be read" is simpler.

--

___
Python tracker 

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



[issue25718] itertools.accumulate __reduce__/__setstate__ bug

2016-02-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping again.

--

___
Python tracker 

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



[issue26449] Tutorial on Python Scopes and Namespaces uses confusing 'read-only' terminology

2016-02-29 Thread Steve Holden

Steve Holden added the comment:

I don't agree there is any place for the term "read-only" in this document. A 
reader who doesn't understand it or seeks clarification is likely to end up at 
a page like https://en.wikipedia.org/wiki/Read-only. I submit that nowhere 
except the documentation under discussion are they likely to find any 
suggestion that a read-only variable can in fact be changed, and hence I regard 
the discussion as extremely misleading.

Surely it would be better to focus on the fundamental point here, which is that 
IN THE ABSENCE OF A global OR nonlocal DECLARATION, ASSIGNMENT BINDS IN THE 
LOCAL NAMESPACE in a function.

If this point is correctly emphasised it should then be relatively easy to 
explain that in the absence of such an assignment in the function body in 
question, the standard name resolution algorithm operates, and that the global 
and non-local declarations change the effect of assignments to operate on the 
namespace that is identified by the standard name resolution algorithm.

It's too easy to confuse newcomers, and there seems to be general agreement 
that this piece is confusing. I'll be happy to attempt a rewrite of this 
section if we can agree on the goals.

--
nosy: +holdenweb

___
Python tracker 

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



[issue19241] MINGW: install import library

2016-02-29 Thread Scott Corbin

Changes by Scott Corbin :


Added file: http://bugs.python.org/file42048/0AANH-66nZTUDUk9PVA

___
Python tracker 

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



[issue19241] MINGW: install import library

2016-02-29 Thread Scott Corbin

Changes by Scott Corbin :


Removed file: http://bugs.python.org/file42048/0AANH-66nZTUDUk9PVA

___
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-02-29 Thread Michael Felt

Michael Felt added the comment:

it was, partly, about the technical details - but I feel I have found the key 
bits - /full/path/libNAME.a(libNAME.so) + dlflags RTLD_NOW + RTLD_MEMBER for 
"native" AIX support.

Additionally, a patch should not break what might be working for some (via 
google I read of suggestions for other languages, e.g., java, where .so members 
are extracted or installed side-by-side with the .a archive) - as the IBM 
run-rime loader also accepts/looks for both .a and .so. And/or for when 
/sbin/ldconfig is available. And when available, is this used as last case, or 
preferred?

Lastly, we cannot assume we will know the name of the member based on the name 
of the library. In many cases, e.g., libiconv.a the IBM names are shr.o, shr4.o 
and shr4_64.o - and these are the only member names unless GNU libiconv.a has 
been added (and then libconv.a also contains libiconv.so.2 (so version support 
is also desired!)) in both 32 and 64 bit mode.

One technical detail I have not been able to discover yet: how to determine 
whether in 32-bit or 64-bit mode. This will be important for libraries that 
have shr4.o and shr4_64.o as the members that need to be dlopened.

Lastly: about adding the "stanza": python is a new language for me. Any 
assistance with a patch - to keep it properly 'pythonized'

In short, I shall continue my studies/learning. Assistance from anyone wiser 
than me is welcome!

--

___
Python tracker 

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



[issue26458] Is the default value assignment of a function parameter evaluated multiple times if it is Parameter=None

2016-02-29 Thread Albert Freeman

New submission from Albert Freeman:

def f(a, L=[]):
L.append(a)
return L

Seems to behave differently to
def f(a, L=None):
L = []
L.append(a)
return L
Which behaves the same as (as far as I noticed) to the below code in the 
documentation (In the tutorial under 4. More Control Flow Tools)
def f(a, L=None):
if L is None:
L = []
L.append(a)
return L

I am using CPython 3.5.1, what is the point of "if L is None:" in the lowermost 
above example? And why is None treated differently to []?

--
assignee: docs@python
components: Documentation
messages: 261000
nosy: docs@python, tocretpa
priority: normal
severity: normal
status: open
title: Is the default value assignment of a function parameter evaluated 
multiple times if it is Parameter=None
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



[issue26458] Is the default value assignment of a function parameter evaluated multiple times if it is Parameter=None

2016-02-29 Thread Ezio Melotti

Ezio Melotti added the comment:

This is not a bug, see 
https://docs.python.org/3.6/faq/programming.html#why-are-default-values-shared-between-objects

In the first case L is evaluated once at compile time.
In the second case L is always set to a new empty list, regardless of what you 
pass as second argument to f.
In the third case L is set to a new empty list only if you don't pass a second 
argument (or if you pass None).

--
nosy: +ezio.melotti
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue14157] time.strptime without a year fails on Feb 29

2016-02-29 Thread Andrej Antonov

Andrej Antonov added the comment:

$ python
Python 3.5.1 (default, Dec  7 2015, 12:58:09) 
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> 
>>> import time
>>> 
>>> time.strptime("Feb 29", "%b %d")
time.struct_time(tm_year=1900, tm_mon=2, tm_mday=29, tm_hour=0, tm_min=0, 
tm_sec=0, tm_wday=0, tm_yday=60, tm_isdst=-1)
>>> 
>>> 
>>> import datetime
>>> 
>>> datetime.datetime.strptime("Feb 29", "%b %d")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/_strptime.py", line 511, in _strptime_datetime
return cls(*args)
ValueError: day is out of range for month

--
nosy: +polymorphm

___
Python tracker 

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



[issue26456] import _tkinter + TestForkInThread leaves zombie with stalled thread

2016-02-29 Thread Martin Panter

Martin Panter added the comment:

I should point out that I think this problem didn’t used to happen. As far as I 
know, it could be a bug in a recently upgraded glibc or something. On another 
Linux computer I cannot produce the problem. When I get a chance I will try 
upgrading packages to see if that triggers the problem.

--

___
Python tracker 

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



[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5bfb4147405e by Martin Panter in branch '2.7':
Issue #26385: Cleanup NamedTemporaryFile if fdopen() fails, by SilentGhost
https://hg.python.org/cpython/rev/5bfb4147405e

New changeset a1c125f21db4 by Martin Panter in branch '3.5':
Issue #26385: Cleanup NamedTemporaryFile if open() fails, by SilentGhost
https://hg.python.org/cpython/rev/a1c125f21db4

New changeset 865cf8eba51a by Martin Panter in branch 'default':
Issue #26385: Merge NamedTemporaryFile fix from 3.5
https://hg.python.org/cpython/rev/865cf8eba51a

--
nosy: +python-dev

___
Python tracker 

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



[issue14157] time.strptime without a year fails on Feb 29

2016-02-29 Thread Sriram Rajagopalan

Sriram Rajagopalan added the comment:

datetime.strptime() uses the return value of _strptime() [ which returns 1900 
for 29th Feb without an year ] and eventually ends up calling 
datetime_new()->check_date_args() [ datetimemodule.c ] with 29th Feb 1900 and 
eventual failure.

Should we enhance check_date_args to take a year_dont_care flag and validate 
the input year argument only if it is explicitly passed?

--
nosy: +Sriram Rajagopalan

___
Python tracker 

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



[issue18195] error when deep copying module is confusing

2016-02-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Python 3.6:

Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/copy.py", line 97, in copy
rv = reductor(4)
TypeError: can't pickle module objects

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue4356] Add "key" argument to "bisect" module functions

2016-02-29 Thread Neil Girdhar

Neil Girdhar added the comment:

I'm also looking for bisect with a key argument (numpy array of records, want 
to search on one element).  However, I don't see bisect in the what's new: 
https://docs.python.org/3.6/whatsnew/3.6.html ?  Any luck with the 
implementation?

--
nosy: +neil.g

___
Python tracker 

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



[issue26404] socketserver context manager

2016-02-29 Thread Aviv Palivoda

Aviv Palivoda added the comment:

The examples did not close the server but I am not sure if that was a mistake. 
The server is not being closed only on examples where it is expected to run 
until there is a keyboard interrupt. However you can see that when you send 
keyboard interrupt to a server you start using python -m http.server you will 
do close the server.

--

___
Python tracker 

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



[issue26459] Windows build instructions are very inaccurate

2016-02-29 Thread Maciej Fijalkowski

New submission from Maciej Fijalkowski:

I've tried following the dev guide (still not successful) to compile a debug 
version of cpython 2.7 and a couple issues that I run into:

* The VS2010 vs VS2008 confustion - the docs say "most versions before 3.3 use 
VS2008" - what does it mean by "most"? The current cpython trunk seems to work 
only on 2010 (with a variety of fun errors).

* VS2010 is hard to download, as is 2008 - direct links would help

* nowhere it's mentioned that you need to run stuff from VS console

* the readme and the devguide disagree on a few points - readme seems to be 
better, but also not ideal

* the docs don't say how to get svn.exe (that is install tortoiseHG, but then 
select extra tools from somewhere)

* the build seems to require perl, despite claiming it's not

Other things are misguiding too, but fixing all of the above would be a massive 
step forward

--
assignee: docs@python
components: Documentation
messages: 261009
nosy: docs@python, fijall
priority: normal
severity: normal
status: open
title: Windows build instructions are very inaccurate
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



[issue26459] Windows build instructions are very inaccurate

2016-02-29 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue17231] Mark __del__ not being called in cycles as an impl detail

2016-02-29 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue17232] Improve -O docs

2016-02-29 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue17232] Improve -O docs

2016-02-29 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue17231] Mark __del__ not being called in cycles as an impl detail

2016-02-29 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
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-02-29 Thread David Edelsohn

David Edelsohn added the comment:

AIX traditionally used member names like shr.o or shr.o or 
shr.o insider the archive, with _64 designating a 64 bit object 
when there is a naming collision.

GNU libtool defaults to the SO name and version number insider the archive.

AIX objects (and shared objects) contain a bit in the header that specifies 32 
bit or 64 bit.  Both 32 bit and 64 bit objects are intended to be archived 
together.  The linker only processes objects of the correct mode.

AIX shared objects contain a bit that specifies if the object may be used at 
link-edit time or only should be used for loading.  This is controlled by the 
AIX strip -e/-E option (yes, I know, strange place to hide that option).

This combination of features allows all of the libraries to be placed in a 
single /usr/lib directory and all of the objects to be collected into a single 
archive, avoiding /usr/lib64 and explosion of shared objects and symbolic links 
clutter.  Various packages have created /usr/local/lib64 anyway using 
Linux/Solaris/SVR4-style naming.

--

___
Python tracker 

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



[issue24823] ctypes.create_string_buffer does not add NUL if len(init) == size

2016-02-29 Thread Berker Peksag

Changes by Berker Peksag :


--
components:  -Devguide

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-02-29 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue26459] Windows build instructions are very inaccurate

2016-02-29 Thread Steve Dower

Steve Dower added the comment:

Agreed. The PCBuild/readme.txt file should clear up a few of those points, but 
the docs aren't exactly beginner friendly (and by that I mean beginning Windows 
users, not beginning C developers).

We probably need someone to write a dedicated document for building Python 2.7 
at this stage. The dev guide should only really be for versions under active 
development. Unless someone else gets there first, I'll look at making it more 
approachable.

--
versions: +Python 3.6 -Python 2.7

___
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-02-29 Thread Michael Felt

Michael Felt added the comment:

Oops: forgot the example output:

root@x064:[/data/prj/aixtools/src]python -m ctypes.util
libm.a(libm.so)
libc.a(libc.so)
libbz2.a(libbz2.so)
libcrypto.a(libcrypto.so)



libcrypt.a(libcrypt.so)


--

___
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-02-29 Thread Michael Felt

Michael Felt added the comment:

The following demonstrates the basics.

cdll.LoadLibrary will load a .so file if it can be located (you will have to 
believe me as I forgot to include the test in this last batch)

Further, when given the AIX format for loading a member of an archive
(e.g., libc.a(shr.o) or libcrypto.a(libcrypto.so), the dlload occurs as 
expected.

in ctypes/utils.py
This looks in the standard directories (as the example, but not complete, see 
below) to demonstrate how to respond.
Note: it is also looking for a .so file, and if it finds one, it returns the 
.so name, otherwise it looks for a .a file - and when it finds it, just appends 
the libNAME.so in the correct format.

What is not done, and probably different from ldconfig behavior!

1. The complete path is not returned (so cdll.LoadLibrary will still follow 
default search - which I hope includes, read uses, the default for the python 
executable

2. The member name is not verified for existence (e.g., libconv.a(libiconv.so) 
is not expected to find libiconv.a(libiconv.so.2)

3. Since member verification is not being performed, shr.o, shr4.o, shr*_64.o

And many many thanks for the strip -e/-E info. Hard to find!

root@x064:[/data/prj/aixtools/src]diff -u python-2.7.11/Lib/ctypes/__init__.py 
/opt/lib/python2.7/ctypes/__init__.py
--- python-2.7.11/Lib/ctypes/__init__.py2015-12-05 19:46:56 +
+++ /opt/lib/python2.7/ctypes/__init__.py   2016-02-29 17:36:43 +
@@ -11,6 +11,7 @@
 from _ctypes import _Pointer
 from _ctypes import CFuncPtr as _CFuncPtr
 from _ctypes import __version__ as _ctypes_version
+# from _ctypes import RTLD_LOCAL, RTLD_GLOBAL, RTLD_NOW ## fails
 from _ctypes import RTLD_LOCAL, RTLD_GLOBAL
 from _ctypes import ArgumentError
 
@@ -356,6 +357,14 @@
 if use_last_error:
 flags |= _FUNCFLAG_USE_LASTERROR
 
+if _sys.platform.startswith("aix"):
+RTLD_NOW= 0x0002
+RTLD_MEMBER = 0x0004
+mode |= RTLD_NOW
+if name is not None:
+if name[-1] == ')':
+   mode |= RTLD_MEMBER
+
 class _FuncPtr(_CFuncPtr):
 _flags_ = flags
 _restype_ = self._func_restype_


root@x064:[/data/prj/aixtools/src]diff -u python-2.7.11/Lib/ctypes/util.py 
/opt/lib/python2.7/ctypes/util.py
--- python-2.7.11/Lib/ctypes/util.py2015-12-05 19:46:56 +
+++ /opt/lib/python2.7/ctypes/util.py   2016-02-29 17:42:41 +
@@ -84,6 +84,23 @@
 continue
 return None
 
+if os.name == "posix" and sys.platform.startswith("aix"):
+def _findLib_aix(name):
+paths='/usr/lib:/lib:/usr/lpp/xlC/lib'
+for dir in paths.split(":"):
+shlib = os.path.join(dir, "lib%s.so" % name)
+if os.path.exists(shlib):
+return shlib
+libfile = os.path.join(dir, "lib%s.a" % name)
+if os.path.exists(libfile):
+shlib = "lib%s.a(lib%s.so)" % (name, name)
+return shlib
+
+return None
+
+def find_library(name):
+return _findLib_aix(name)
+
 elif os.name == "posix":
 # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
 import re, tempfile, errno
@@ -267,7 +284,16 @@
 print cdll.LoadLibrary("libcrypto.dylib")
 print cdll.LoadLibrary("libSystem.dylib")
 print cdll.LoadLibrary("System.framework/System")
+elif sys.platform.startswith("aix"):
+print find_library("crypto")
+x = find_library("crypto")
+print cdll.LoadLibrary(x)
+print cdll.LoadLibrary("libcrypto.a(libcrypto.so)")
+print cdll.LoadLibrary("libc.a(shr.o)")
+print find_library("crypt")
+print cdll.LoadLibrary("libcrypt.a(shr.o)")
 else:
+print cdll.LoadLibrary("libc.a")
 print cdll.LoadLibrary("libm.so")
 print cdll.LoadLibrary("libcrypt.so")
 print find_library("crypt")


p.s. Anyone know what flag to set in vi so that tabs are never inserted and/or 
spaces converted to tabs. Python seems to hate tab indents.

--

___
Python tracker 

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



[issue26460] datetime.strptime without a year fails on Feb 29

2016-02-29 Thread Sriram Rajagopalan

New submission from Sriram Rajagopalan:

$ python
Python 3.5.1 (default, Dec  7 2015, 12:58:09) 
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> 
>>> import time
>>> 
>>> time.strptime("Feb 29", "%b %d")
time.struct_time(tm_year=1900, tm_mon=2, tm_mday=29, tm_hour=0, tm_min=0, 
tm_sec=0, tm_wday=0, tm_yday=60, tm_isdst=-1)
>>> 
>>> 
>>> import datetime
>>> 
>>> datetime.datetime.strptime("Feb 29", "%b %d")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/_strptime.py", line 511, in _strptime_datetime
return cls(*args)
ValueError: day is out of range for month

The same issue is seen in all versions of Python

--
components: Library (Lib)
messages: 261014
nosy: Sriram Rajagopalan
priority: normal
severity: normal
status: open
title: datetime.strptime without a year fails on Feb 29
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



[issue14157] time.strptime without a year fails on Feb 29

2016-02-29 Thread Sriram Rajagopalan

Sriram Rajagopalan added the comment:

Opened issue 26460 for fixing the leap day bug in datetime.datetime.strptime()

--

___
Python tracker 

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



[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Ben Finney

Ben Finney added the comment:

> I have read the thread on Python-list

Thank you, and thanks for linking to that discussion.

> and still don't understand the purpose of your idea.

The purpose is to get a public API for making temporary filesystem paths with 
the same properties as are produced by ‘tempfile’, specifically as produced by 
a ‘tempfile._get_candidate_names’ generator.

The paths will be used in unit tests and will never touch the filesystem.

Some have suggested using ‘uuid’ or other random-generator APIs. Using an API 
that isn't explicitly designed to produce valid filesystem paths is both risky 
(the algorithm may not exactly produce the right behaviour), and confusing (a 
reader seeing use of an unrelated API will not find it obvious why that API was 
used for generating a filesystem path).

The unit tests need paths with properties that are already implemented in 
‘tempfile’, so it seems unreasonable to suggest that functionality should be 
re-implemented elsewhere since it is already in the standard library.

The request is for a “get the next path generated by a 
‘tempfile._get_candidate_names’ generator”, with an approved and documented 
public API. One suggested name is ‘tempfile.makepath’.

--

___
Python tracker 

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



[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Ethan Furman

Ethan Furman added the comment:

> The request is for a “get the next path generated by a
> ‘tempfile._get_candidate_names’ generator”, with an approved and
> documented public API.

I don't see any problem with this.  Patches welcome.

--
stage:  -> needs patch

___
Python tracker 

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



[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-29 Thread SilentGhost

Changes by SilentGhost :


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



[issue26407] csv.writer.writerows masks exceptions from __iter__

2016-02-29 Thread Ilja Everilä

Ilja Everilä added the comment:

I have 0 beef with it being the TypeError as long as the exception chain is 
kept intact, especially since PY3 makes it possible. With current behaviour 
heisenbugs would produce some serious hair pulling, until one figures out that 
it is actually the __iter__ raising an exception.

With that in mind, take an object implementing the __iter__ dunder correctly 
999,999 times out of a million. Is it not iterable?

Unfortunately I lack the experience with CPython C API to do something about 
this. Tests on the other hand I suppose I could manage, if a consensus on the 
behaviour can be reached.

--

___
Python tracker 

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



[issue26407] csv.writer.writerows masks exceptions from __iter__

2016-02-29 Thread Ilja Everilä

Ilja Everilä added the comment:

As a side note PyObject_GetIter actually raises a TypeError already for 
non-iterables (classes without __iter__ etc.), so csv_writerows duplicates the 
effort at the moment.

--

___
Python tracker 

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



[issue26456] import _tkinter + TestForkInThread leaves zombie with stalled thread

2016-02-29 Thread Zachary Ware

Zachary Ware added the comment:

I suspect this may be what causes several of the 2.7 builders to fail.  The 
ones that fail look like they complete successfully, but then sit with no 
output until buildbot kills them.

For example:

http://buildbot.python.org/all/builders/AMD64%20Debian%20PGO%202.7/builds/506/steps/compile/logs/stdio
http://buildbot.python.org/all/builders/s390x%20Debian%202.7/builds/258/steps/test/logs/stdio
http://buildbot.python.org/all/builders/s390x%20RHEL%202.7/builds/261/steps/test/logs/stdio
http://buildbot.python.org/all/builders/s390x%20SLES%202.7/builds/264/steps/test/logs/stdio
http://buildbot.python.org/all/builders/x86-64%20Ubuntu%2015.10%20Skylake%20CPU%202.7/builds/159/steps/test/logs/stdio

In each of those cases, test_tcl runs before test_thread (except on the SLES 
builder; but test_tk also imports _tkinter and does come before test_thread).

I can reproduce on Ubuntu 14.04.3, but not on a freshly updated Gentoo.

--
nosy: +zach.ware

___
Python tracker 

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



[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I see a problem. tempfile._get_candidate_names is implementation detail, and 
exposing it adds a burden for maintainers. It also adds cognitive burden for 
users of the tempfile module. And the idea itself looks doubtful and 
contradictory with the good practice of using the tempfile module.

I'm -1 for adding such function to the tempfile module.

--

___
Python tracker 

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



[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Ethan Furman

Ethan Furman added the comment:

I don't see the problem.  Every Python platform that has `mktemp` has an 
implementation to generate the names, and that implementation can become the 
public face instead of `mktemp`.  So no more of a burden than `mktemp` is; 
likewise for the "cognitive burden".

As far as appropriate location -- where else would you put it?

--

___
Python tracker 

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



[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

mktemp is deprecated, and I think we will get rid of it when 2.7 will be out of 
use. Do you want to add new deprecated from the start function?

> As far as appropriate location -- where else would you put it?

May be in third-party module on PyPI? It doesn't look as highly demanded 
function.

--

___
Python tracker 

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



[issue26460] datetime.strptime without a year fails on Feb 29

2016-02-29 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Python's time.strptime() behavior is consistent with that of glibc 2.19:

=== strptime_c.c ===
#define _XOPEN_SOURCE
#include 
#include 
#include 
#include 

int
main(void)
{
  struct tm tm;
  char buf[255];

  memset(&tm, 0, sizeof(struct tm));
  strptime("Feb 29", "%b %d", &tm);
  strftime(buf, sizeof(buf), "%d %b %Y %H:%M", &tm);
  puts(buf);
  exit(EXIT_SUCCESS);
}
===

$ gcc strptime_c.c 
$ ./a.out
29 Feb 1900 00:00


I'm not saying that the behavior is a good API, but given the unfortunate API 
at hand, parsing a date without specifying what year it is using strptime is a 
bad idea.

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



[issue26362] Approved API for creating a temporary file path

2016-02-29 Thread Ben Finney

Ben Finney added the comment:

Serhiy Storchaka

> mktemp is deprecated, and I think we will get rid of it when 2.7 will be out 
> of use.

That's fine. This is not a request to retain ‘tempfile.mktemp’.

I confused matters in my initial message, so your confusion is understandable 
on this point. To repeat:

The request is for a “get the next path generated by a 
‘tempfile._get_candidate_names’ generator”, with an approved and documented 
public API. One suggested name is ‘tempfile.makepath’.


> Do you want to add new deprecated from the start function?

No. I'm asking for already-implemented and currently-maintained (i.e. not 
deprecated) standard library code, that is currently neither public nor 
documented, to gain a public API.


Ethan Furman:

> I don't see any problem with this.  Patches welcome.

Thank you, I'll work on a patch soon.

--

___
Python tracker 

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



[issue26176] EmailMessage example doesn't work

2016-02-29 Thread Maciej Szulik

Changes by Maciej Szulik :


--
nosy: +maciej.szulik

___
Python tracker 

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



[issue26407] csv.writer.writerows masks exceptions from __iter__

2016-02-29 Thread Ilja Everilä

Ilja Everilä added the comment:

I'm starting to think my initial example code was too simplified and misled 
from the issue at hand. It very explicitly showed what happens when some class 
with __iter__ raises and is passed to csv_writerows. Even then:

>>> from collections.abc import Iterable
>>> class X:
...  def __iter__(self):
...   raise RuntimeError
... 
>>> x = X()
>>> issubclass(X, Iterable)
True
>>> isinstance(x, Iterable)
True

The glossary entry for iterable has nothing to say about exceptions. It only 
requires that they are able to return their members "one at a time". In a 
moderately complicated class this might be true most of the time, but that's 
not interesting; that 1 time when it can't is.

Now imagine you have a class with __iter__ using 1..N foreign libraries that 
all may blow up at the wrong phase of the moon (humor me). With the current 
implementation you get "TypeError: writerows() argument must be iterable", 
which goes out of its way to actually mislead you. Just letting the original 
exception through would be the obviously helpful thing to do. Which is what 
PyObject_GetIter does, before csv_writerows overwrites it.

--

___
Python tracker 

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



[issue26460] datetime.strptime without a year fails on Feb 29

2016-02-29 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

This is not no more bug than

>>> from datetime import *
>>> datetime.strptime('0228', '%m%d')
datetime.datetime(1900, 2, 28, 0, 0)

Naturally, as long as datetime.strptime('0228', '%m%d') is the same as 
datetime.strptime('19000228', '%Y%m%d'), datetime.strptime('0229', '%m%d') 
should raise a ValueError as long as datetime.strptime('19000229', '%m%d') does.

The only improvement, I can think of in this situation is to point the user to 
time.strptime() in the error message.  The time.strptime method works just fine 
in the recent versions (see issue 14157.)

>>> time.strptime('0229', '%m%d')[1:3]
(2, 29)

--
nosy: +belopolsky
type: behavior -> enhancement
versions:  -Python 2.7, Python 3.2, 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



[issue26460] datetime.strptime without a year fails on Feb 29

2016-02-29 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> Python's time.strptime() behavior is consistent with that of glibc 2.19

Gregory,

I believe OP is complaining about the way datetime.datetime.strptime() behaves, 
not time.strptime() which is mentioned as (preferred?) alternative.


See msg261015  in issue 14157 for context.

--

___
Python tracker 

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



[issue26404] socketserver context manager

2016-02-29 Thread Martin Panter

Martin Panter added the comment:

Server_close() was only documentated last year; see Issue 23254. For the 
examples that run until you interrupt them, the servers currently emit a 
resource warning (in addition to the KeyboardInterrupt traceback and the Python 
2 bytes warnings):

$ python -bWall TCPServer.py
127.0.0.1 wrote:
TCPServer.py:16: BytesWarning: str() on a bytes instance
  print(self.data)
b'hello world with TCP'
127.0.0.1 wrote:
TCPServer.py:16: BytesWarning: str() on a bytes instance
  print(self.data)
b'python is nice'
^CTraceback (most recent call last):
  File "TCPServer.py", line 28, in 
server.serve_forever()
  File "/usr/lib/python3.5/socketserver.py", line 237, in serve_forever
ready = selector.select(poll_interval)
  File "/usr/lib/python3.5/selectors.py", line 367, in select
fd_event_list = self._poll.poll(timeout)
KeyboardInterrupt
sys:1: ResourceWarning: unclosed 
[Exit 1]

If you ignore the warning, there isn’t much effective difference, because the 
socket gets closed when the process exits, or if you are lucky, when Python 
garbage collects the global “server” object. But IMO it is bad practice not to 
clean up resources properly, especially in an API example.

--

___
Python tracker 

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



[issue26461] PyInterpreterState_Head(), PyThreadState_Next() etc can't be sanely used

2016-02-29 Thread Maciej Fijalkowski

New submission from Maciej Fijalkowski:

All the internal uses of this API guard everything with HEAD_LOCK/HEAD_UNLOCK 
that's not exposed. It's not safe to traverse the whole API without holding 
those locks and those locks are static and module local

--
messages: 261030
nosy: fijall
priority: normal
severity: normal
status: open
title: PyInterpreterState_Head(), PyThreadState_Next() etc can't be sanely used

___
Python tracker 

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



[issue26461] PyInterpreterState_Head(), PyThreadState_Next() etc can't be sanely used

2016-02-29 Thread STINNER Victor

STINNER Victor added the comment:

Are you asking to expose the lock?

--
nosy: +haypo, pitrou, serhiy.storchaka

___
Python tracker 

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



[issue26461] PyInterpreterState_Head(), PyThreadState_Next() etc can't be sanely used

2016-02-29 Thread STINNER Victor

STINNER Victor added the comment:

fijal explained on IRC his use case: implement vmprof on Windows, a statistical 
profiler, using a C thread running in the Python process.

The _PyThread_CurrentFrames() API requires to be called with the GIL hold which 
is not acceptable for his use case. Having to wait for the GIL would serialize 
statistics plots and so would have a poor quality, probably similar to cProfile.

The use case is to implement something like _PyThread_CurrentFrames() without 
holding the GIL.

--

fijal mentioned pystate.c/.h functions which come with this comment:

/* Routines for advanced debuggers, requested by David Beazley.
   Don't use unless you know what you are doing! */

These functions are not safe if you don't hold head_mutex lock, but this lock 
is private in pystate.c (declared with "static").

I guess that they are safe to use if the whole process is stopped by a debugger 
like gdb.

--

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-02-29 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



[issue26460] datetime.strptime without a year fails on Feb 29

2016-02-29 Thread Gregory P. Smith

Gregory P. Smith added the comment:

time.strptime() is "working" (not raising an exception) as it appears not to 
validate the day of the month when a year is not specified, yet the return 
value from either of these APIs is a date which has no concept of an ambiguous 
year.

## Via the admittedly old Python 2.7.6 from Ubuntu 14.04: ##
# 1900 was not a leap year as it is not divisible by 400.
>>> time.strptime("1900 Feb 29", "%Y %b %d")
ValueError: day is out of range for month
>>> time.strptime("Feb 29", "%b %d")
time.struct_time(tm_year=1900, tm_mon=2, tm_mday=29, tm_hour=0, tm_min=0, 
tm_sec=0, tm_wday=0, tm_yday=60, tm_isdst=-1)

So what should the validation behavior be?

>>> datetime.datetime.strptime("Feb 29", "%b %d")
ValueError: day is out of range for month
>>> datetime.datetime.strptime("2016 Feb 29", "%Y %b %d")
datetime.datetime(2016, 2, 29, 0, 0)
>>> datetime.datetime.strptime("1900 Feb 29", "%Y %b %d")
ValueError: day is out of range for month
>>> datetime.datetime(year=1900, month=2, day=29)
ValueError: day is out of range for month

datetime objects cannot be constructed with the invalid date (as the 
time.strptime return value allows).

Changing the API to assume the current year or a +/- 6 months from "now" when 
no year is parsed is likely to break existing code.

--

___
Python tracker 

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



[issue26280] ceval: Optimize list

2016-02-29 Thread Zach Byrne

Zach Byrne added the comment:

The new patch "subscr2" removes the tuple block, and addresses Victor's 
comments. This one looks a little faster, down to 0.0215 usec for the same test.

--
Added file: http://bugs.python.org/file42049/subscr2.patch

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-02-29 Thread Julien

New submission from Julien:

Hi,

As I don't like warnings, and sphinx-doc was verbose about "Could not parse 
literal_block as "python3". highlighting skipped.", I fixed most of them.

Bonus: It's graphically better, as an example the XML block here: 
https://docs.python.org/3.5/library/pyexpat.html is now nicely colored: 
http://www.afpy.org/doc/python/3.5/library/pyexpat.html

--
assignee: docs@python
components: Documentation
files: literal_blocks_languages.patch
keywords: patch
messages: 261035
nosy: docs@python, sizeof
priority: normal
severity: normal
status: open
title: Patch to enhance literal block language declaration
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file42050/literal_blocks_languages.patch

___
Python tracker 

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



[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2016-02-29 Thread STINNER Victor

Changes by STINNER Victor :


--
title: ceval: Optimize list -> ceval: Optimize list[int] (subscript) operation 
similarly to CPython 2.7

___
Python tracker 

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



[issue26463] asyncio-related (?) segmentation fault

2016-02-29 Thread Nicholas Chammas

New submission from Nicholas Chammas:

Python 3.5.1, OS X 10.11.3.

I have an application that uses asyncio and Cryptography (via the AsyncSSH 
library). Cryptography has some parts written in C, I believe.

I'm testing my application by sending a keyboard interrupt while 2 tasks are 
working. My application doesn't clean up after itself correctly, so I get these 
warnings about pending tasks being destroyed, but I don't think I should ever 
be getting segfaults. I am able to consistently get this segfault by 
interrupting my application at roughly the same point.

I'm frankly intimidated by the segfault (it's been many years since I dug into 
one), but the most likely culprits are either Python or Cryptography since 
they're the only components of my application that have parts written in C, as 
far as I know.

I'm willing to help boil this down to something more minimal with some help. 
Right now I just have the repro at this branch of my application (which isn't 
too helpful for people other than myself): 

https://github.com/nchammas/flintrock/pull/77

Basically, launch a cluster on EC2, and as soon as one task reports that SSH is 
online, interrupt Flintrock with Control + C. You'll get this segfault.

--
components: Macintosh, asyncio
files: segfault.txt
messages: 261036
nosy: Nicholas Chammas, gvanrossum, haypo, ned.deily, ronaldoussoren, yselivanov
priority: normal
severity: normal
status: open
title: asyncio-related (?) segmentation fault
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file42051/segfault.txt

___
Python tracker 

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



[issue26463] asyncio-related (?) segmentation fault

2016-02-29 Thread Nicholas Chammas

Changes by Nicholas Chammas :


Added file: http://bugs.python.org/file42052/stacktrace.txt

___
Python tracker 

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



[issue26457] Error in ipaddress.address_exclude function

2016-02-29 Thread Xiang Zhang

Xiang Zhang added the comment:

In old ipaddr.py, IPv4Network('192.0.2.0/31').subnet() returns 
[IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.1/32')], but ipaddress 
returns only [IPv4Network('192.0.2.0/32')]. 

It seems simply change end to end+1 in 
https://hg.python.org/cpython/file/tip/Lib/ipaddress.py#l921 can solve the 
problem and pass the test. But maybe there are some side effects.

--

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-02-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +georg.brandl, serhiy.storchaka
stage:  -> patch review
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



[issue26456] import _tkinter + TestForkInThread leaves zombie with stalled thread

2016-02-29 Thread Martin Panter

Martin Panter added the comment:

Yes it looks like you might be right about those hanging buildbots. The 
occasional successes (e.g. 
)
 seem to happen when test_thread runs before any of the TK, TCL, and Idle tests.

The reason why this does not affect Python 3 is probably because the test only 
calls sys.exit() in Python 2; this code was added in r78527. In Python 3, the 
code was merged in revision 58c35495a934, but the code was apparently changed 
to call os._exit() at the same time. So one potential fix or workaround could 
be to change to os._exit() as in child-exit.patch.

It seems Tcl_FindExecutable() creates a thread, and this thread survives 
fork(). (Perhaps it is re-created?) Python exiting does not cause this thread 
to be stopped. Playing with “strace” it seems the threads that return from 
fork() in the parent and child both finish with _exit(0). However the “main” 
thread in the parent finishes with exit_group(0), which is documented as 
terminating all threads. Calling os._exit() also seems to call exit_group(), 
which explains why that fixes the problem in the child.

I can produce the problem in all versions of Python without using _tkinter, 
using the following code instead:

import _thread, os, time

def thread1():
pid = os.fork()
if not pid:
# In the child, the original main thread no longer exists. Start a
# new thread that will stall for 60 s.
_thread.start_new_thread(time.sleep, (60,))

_thread.start_new_thread(thread1, ())
time.sleep(2)  # Give fork() a chance to run

I’m not really sure, but maybe Python could improve its handling of this case, 
when fork() is called on a non-“main” thread and another thread is also running 
in the child process.

--
keywords: +patch
Added file: http://bugs.python.org/file42053/child-exit.patch

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-02-29 Thread Georg Brandl

Georg Brandl added the comment:

Thanks for the patch!

Most "bash" blocks should be "console" (since the prompt is shown). "pycon" 
should not be needed, since it is detected automatically.

--

___
Python tracker 

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



[issue26457] Error in ipaddress.address_exclude function

2016-02-29 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



[issue26404] socketserver context manager

2016-02-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree and consider this is an argument for adding the context manager methods 
and using them with 'with' in the examples.

--

___
Python tracker 

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



[issue26457] Error in ipaddress.address_exclude function

2016-02-29 Thread Xiang Zhang

Xiang Zhang added the comment:

I propose a patch simply add one to end so that the broadcast address network 
will appear in the result, which behaves the same as ipaddr.py. Corresponding 
tests are added. All tests are passed but I am afraid some logic may break.

--
keywords: +patch
Added file: http://bugs.python.org/file42054/address_exclude.patch

___
Python tracker 

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