[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

[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

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

[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

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

[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

[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

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

[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

[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

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

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

[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

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

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

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

[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

[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

[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

[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'),

[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

[issue26176] EmailMessage example doesn't work

2016-02-29 Thread Maciej Szulik
Changes by Maciej Szulik : -- nosy: +maciej.szulik ___ Python tracker ___ ___

[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

[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(, 0, sizeof(struct tm));

[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

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

[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

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

[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

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

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

[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

[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

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

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

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

[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

[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

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

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

[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

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

[issue17232] Improve -O docs

2016-02-29 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue17232] Improve -O docs

2016-02-29 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag ___ Python tracker ___ ___

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

[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

[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

[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

[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

[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

[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

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

[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

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

[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

[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

[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

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

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

[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

[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

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