[issue14905] zipimport needs to support namespace packages when no 'directory' entry exists

2020-08-13 Thread Phil Connell


Phil Connell  added the comment:

One version of the bug described here (and fixed in the old implementation 
under issue17633) exists in the Python implementation of zipimport:

$ unzip -l namespace1.zip
Archive:  namespace1.zip
  Length  DateTimeName
-  -- -   
0  08-13-2020 06:30   one/
0  08-13-2020 06:30   one/two/
0  08-13-2020 06:30   one/two/three.py
- ---
0 3 files
$ unzip -l namespace2.zip
Archive:  namespace2.zip
  Length  DateTimeName
-  -- -   
0  08-13-2020 06:37   alpha/beta/gamma.py
- ---
0 1 file
$ PYTHONPATH=namespace1.zip:namespace2.zip ./python
Python 3.10.0a0 (heads/master:c51db0ea40, Aug 13 2020, 06:41:20)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import one
>>> import alpha
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'alpha'
>>>

In short, imports where there's no separate entry for directories in the zip 
file don't work.

Any opinions on whether this *is* the problem this issue is trying to track?

--

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-11-21 Thread Phil Connell


Phil Connell  added the comment:

The attached patch (wrap_threadstate.diff) is enough to stop the crash. It's a 
slightly dirty proof-of-concept, but equally could be the basis for a solution.

The main functional issue is that there's still a race on the Py_BLOCK_THREADS 
side: it's possible that the "is threadstate still valid" check can pass, but 
the interpreter is finalised while the daemon thread is trying to reacquire the 
GIL in PyEval_RestoreThread.

(The Py_UNBLOCK_THREADS side is non-racy as the GIL is held while the ts and 
wrapper updates are done).

--
Added file: https://bugs.python.org/file48732/wrap_threadstate.diff

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-11-21 Thread Phil Connell


Phil Connell  added the comment:

Just to summarise, I'm fairly sure this is exactly what Victor saw: a daemon 
thread attempts to reacquire the GIL via Py_END_ALLOW_THREADS after interpreter 
finalisation. Obviously the threadstate pointer held by the thread is then 
invalid...so we crash.

So I see basically two options:

1. Don't (always) free threadstate structures in Py_Finalize, and figure out a 
way to avoid leaking them (if Python is re-initialized in the same process).

2. Ban this behaviour entirely, e.g. have Py_Finalize fail if there are live 
threads with threadstate objects.

The discussion so far assumes that we should support this, i.e. #1. Any 
thoughts on that? (I'll have a think about whether this is actually doable!)

--

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



[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-11-21 Thread Phil Connell


Phil Connell  added the comment:

Based on Victor's info from https://bugs.python.org/issue36114#msg337090 I 
believe the crash is essentially what's reproduced in the attached program.

>From the root of a (built) cpython clone run:

gcc -c -o fini_crash.o -IInclude -I. fini_crash.c && gcc -o fini_crash 
fini_crash.o libpython3.9.a -lcrypt -lpthread -ldl -lutil -lm && ./fini_crash

The output should be:

MAIN: allow other thread to execute 
   
OTHER: acquired GIL 
   
OTHER: released GIL 
   
MAIN: interpreter finalized
OTHER: attempt to acquire GIL...crash!
[1]266749 segmentation fault (core dumped)  ./fini_crash

And running it through valgrind:

$ valgrind --suppressions=Misc/valgrind-python.supp fini_crash  

   -- COMMAND -- 13:4[12/5973]
==266836== Memcheck, a memory error detector
==266836== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==266836== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==266836== Command: fini_crash
==266836==
MAIN: allow other thread to execute   
OTHER: acquired GIL
OTHER: released GIL 
   
MAIN: interpreter finalized
OTHER: attempt to acquire GIL...crash!  
   
==266836== Thread 2:
   
==266836== Invalid read of size 8   
   
==266836==at 0x15607D: PyEval_RestoreThread (ceval.c:389)   

   
==266836==by 0x15479F: evil_main (in /home/phconnel/dev/cpython/fini_crash)
==266836==by 0x48B94CE: start_thread (in /usr/lib/libpthread-2.30.so)
==266836==by 0x4B232D2: clone (in /usr/lib/libc-2.30.so)
==266836==  Address 0x4d17270 is 16 bytes inside a block of size 264 free'd
==266836==at 0x48399AB: free (vg_replace_malloc.c:540)
==266836==by 0x1773FF: tstate_delete_common (pystate.c:829)
==266836==by 0x1773FF: _PyThreadState_Delete (pystate.c:848)
==266836==by 0x1773FF: zapthreads (pystate.c:311)
==266836==by 0x1773FF: PyInterpreterState_Delete (pystate.c:321)
==266836==by 0x174920: finalize_interp_delete (pylifecycle.c:1242)
==266836==by 0x174920: Py_FinalizeEx.part.0 (pylifecycle.c:1400)
==266836==by 0x15487B: main (in /home/phconnel/dev/cpython/fini_crash)
==266836==  Block was alloc'd at
==266836==at 0x483877F: malloc (vg_replace_malloc.c:309)
==266836==by 0x178D7C: new_threadstate (pystate.c:557)
==266836==by 0x178D7C: PyThreadState_New (pystate.c:629)
==266836==by 0x178D7C: PyGILState_Ensure (pystate.c:1288)
==266836==by 0x154759: evil_main (in /home/phconnel/dev/cpython/fini_crash)
==266836==by 0x48B94CE: start_thread (in /usr/lib/libpthread-2.30.so)
==266836==by 0x4B232D2: clone (in /usr/lib/libc-2.30.so)
==266836== 
==266836== Invalid read of size 8
==266836==at 0x156081: PyEval_RestoreThread (ceval.c:389)
==266836==by 0x15479F: evil_main (in /home/phconnel/dev/cpython/fini_crash)
==266836==by 0x48B94CE: start_thread (in /usr/lib/libpthread-2.30.so)
==266836==by 0x4B232D2: clone (in /usr/lib/libc-2.30.so)
==266836==  Address 0x4c3a0f0 is 16 bytes inside a block of size 2,960 free'd
==266836==at 0x48399AB: free (vg_replace_malloc.c:540)
==266836==by 0x174920: finalize_interp_delete (pylifecycle.c:1242)
==266836==by 0x174920: Py_FinalizeEx.part.0 (pylifecycle.c:1400)
==266836==by 0x15487B: main (in /home/phconnel/dev/cpython/fini_crash)
==266836==  Block was alloc'd at
==266836==at 0x483877F: malloc (vg_replace_malloc.c:309)
==266836==by 0x177153: PyInterpreterState_New (pystate.c:205)
==266836==by 0x1732BF: pycore_create_interpreter (pylifecycle.c:526)
==266836==by 0x1732BF: pyinit_config.constprop.0 (pylifecycle.c:695)
==266836==by 0x1766B7: pyinit_core (pylifecycle.c:879)
==266836==by 0x1766B7: Py_InitializeFromConfig (pylifecycle.c:1055)
==266836==by 0x1766B7: Py_InitializeEx (pylifecycle.c:1093)
==266836==by 0x154801: main (in /home/phconnel/dev/cpython/fini_crash)
==266836==

--
Adde

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-11-12 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue38778] Document that os.fork is not allowed in subinterpreters

2019-11-12 Thread Phil Connell


New submission from Phil Connell :

Add a comment to the os.fork docs to note that forking from a subinterpreter is 
no longer allowed (see issue34651)

--
assignee: docs@python
components: Documentation
messages: 356459
nosy: docs@python, eric.snow, pconnell
priority: normal
severity: normal
status: open
title: Document that os.fork is not allowed in subinterpreters
versions: Python 3.8

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



[issue36723] Unittest Discovery for namespace subpackages dot notation fails

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue25597] unittest.mock does not wrap dunder methods (__getitem__ etc)

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue25299] argparse: TypeError: __init__() takes at least 4 arguments (4 given)

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue35617] unittest discover does not work with implicit namespaces

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue38505] Mock.call_args and Mock.call_args_list not propagated to parent Mock

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue37052] Add examples for mocking async for and async context manager in unittest.mock docs

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue18108] shutil.chown should support dir_fd and follow_symlinks keyword arguments

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue38494] Add assert_not_called_with

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue38122] AsyncMock force always creating an AsyncMock for child mocks

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue38384] An assertion failure in test_pickle

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue7897] Support parametrized tests in unittest

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue38091] Import deadlock detection causes deadlock

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue30587] Mock with spec object does not ensure method call signatures

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue32092] mock.patch with autospec does not consume self / cls argument

2019-10-28 Thread Phil Connell


Change by Phil Connell :


--
nosy: +pconnell

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



[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-26 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue21999] shlex: bug in posix more handling of empty strings

2014-07-18 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue9232] Allow trailing comma in any function argument list.

2014-07-09 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue12154] PyDoc Partial Functions

2014-04-23 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue17277] incorrect line numbers in backtrace after removing a trace function

2014-04-23 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue19533] Unloading docstrings from memory if -OO is given

2014-04-23 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue7757] sys.path is incorrect when prefix is ""

2014-04-23 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue2292] Missing *-unpacking generalizations

2014-02-07 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue20217] Build failure in posixmodule.c with SCHED_SPORADIC available

2014-01-10 Thread Phil Connell

New submission from Phil Connell:

Typo in revision 71704 that causes build failures on systems with 
SCHED_SPORADIC available. See attached patch.

(Can reproduce by #defining SCHED_SPORADIC just above where it's used in 
posixmodule.c)

--
components: Extension Modules
files: sched_sporadic_build.diff
keywords: patch
messages: 207865
nosy: benjamin.peterson, isoschiz, pconnell
priority: normal
severity: normal
status: open
title: Build failure in posixmodule.c with SCHED_SPORADIC available
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33409/sched_sporadic_build.diff

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



[issue20217] Build failure in posixmodule.c with SCHED_SPORADIC available

2014-01-10 Thread Phil Connell

Phil Connell added the comment:

Where I actually mean changeset 71704:89e92e684b37

--

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



[issue16669] Docstrings for namedtuple

2013-12-05 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue19291] Add docs for asyncio package (Tulip, PEP 3156)

2013-11-23 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue13344] closed sockets don't raise EBADF anymore

2013-11-23 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue18036] "How do I create a .pyc file?" FAQ entry is out of date

2013-11-23 Thread Phil Connell

Phil Connell added the comment:

I've had a stab at creating a patch for this.

As well as mentioning __pycache__, I've tweaked some wording to reflect the 
fact that .pyc files are regenerated if the source file's length changes (as 
per issue13645).

--
Added file: http://bugs.python.org/file32798/issue18036.diff

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



[issue16596] Skip stack unwinding when "next", "until" and "return" pdb commands executed in generator context

2013-11-23 Thread Phil Connell

Phil Connell added the comment:

Full run of the test suite was clean, so the fix is ready to go.

--

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



[issue16596] Skip stack unwinding when "next", "until" and "return" pdb commands executed in generator context

2013-11-23 Thread Phil Connell

Phil Connell added the comment:

It looks like call_exc_trace is leaking refs to Py_None.

I believe the attached patch fixes the issue (it certainly fixes Antoine's 
failing invokation :)

--
Added file: http://bugs.python.org/file32794/issue16596_leak.diff

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



[issue13907] test_pprint relies on set/dictionary repr() ordering

2013-11-23 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue18864] Implementation for PEP 451 (importlib.machinery.ModuleSpec)

2013-11-23 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue16596] Skip stack unwinding when "next", "until" and "return" pdb commands executed in generator context

2013-11-16 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue16596>
___
___
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

2013-10-23 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue16195] Difficult or impossible to figure out how garbage collector and weak references should interact for user-defined extension types

2013-10-04 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

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



[issue1565525] tracebacks eat up memory by holding references to locals and globals when they are not wanted

2013-08-29 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue1565525>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18594] C accelerator for collections.Counter is slow

2013-08-03 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18594>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18566] In unittest.TestCase docs for setUp() and tearDown() don't mention AssertionError

2013-08-03 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18566>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17669] Segfault caused by weird combination of imports and yield from

2013-07-29 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue17669>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18565] Test for closing delegating generator with cleared frame (Issue17669)

2013-07-27 Thread Phil Connell

Phil Connell added the comment:

Good suggestion, updated patch attached.

--
Added file: http://bugs.python.org/file31055/gen_close_with_cleared_frame.diff

___
Python tracker 
<http://bugs.python.org/issue18565>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18565] Test for closing delegating generator with cleared frame (Issue17669)

2013-07-26 Thread Phil Connell

New submission from Phil Connell:

This is a testcase for issue17669 - it passes against the latest default (and 
hits the same segfault under 3.3.0).


I came up with this while tracking down a thorny generator finalisation crash 
that turned out to be a variant on 17669.

The root cause was gen_close being called on a generator that's delegating to 
another, and whose frame has already had frame_clear called (so f_stacktop is 
NULL).

It's reproduced by creating a reference cycle that's broken by clearing the 
delegating generator's frame.

--
components: Interpreter Core
files: gen_close_with_cleared_frame.diff
keywords: patch
messages: 193765
nosy: benjamin.peterson, isoschiz, pconnell
priority: normal
severity: normal
status: open
title: Test for closing delegating generator with cleared frame (Issue17669)
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31048/gen_close_with_cleared_frame.diff

___
Python tracker 
<http://bugs.python.org/issue18565>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18208] Wrong bytecode generated for 'in' operation

2013-06-14 Thread Phil Connell

Phil Connell added the comment:

Thanks Amaury. That's quite surprising, but I wouldn't advocate changing such 
long standing behaviour.

I'm closing the issue.

--
status: pending -> closed

___
Python tracker 
<http://bugs.python.org/issue18208>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18208] Wrong bytecode generated for 'in' operation

2013-06-14 Thread Phil Connell

New submission from Phil Connell:

The following two expressions should have the same value:

Python 3.4.0a0 (default:fae92309c3be, Jun 14 2013, 09:29:54) 
[GCC 4.8.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1 in [2] == False
False
>>> (1 in [2]) == False
True


It looks like this is a compiler issue - there shouldn't be a jump if the 'in' 
expression is false:

>>> dis.dis("1 in [2] == False")
  1   0 LOAD_CONST   0 (1)
  3 LOAD_CONST   1 (2)
  6 BUILD_LIST   1
  9 DUP_TOP 
 10 ROT_THREE   
 11 COMPARE_OP   6 (in)
 14 JUMP_IF_FALSE_OR_POP24
 17 LOAD_CONST   2 (False)
 20 COMPARE_OP   2 (==)
 23 RETURN_VALUE
>>   24 ROT_TWO 
 25 POP_TOP 
 26 RETURN_VALUE
>>>

--
components: Interpreter Core
messages: 191108
nosy: benjamin.peterson, brett.cannon, georg.brandl, isoschiz, ncoghlan, 
pconnell
priority: normal
severity: normal
status: open
title: Wrong bytecode generated for 'in' operation

___
Python tracker 
<http://bugs.python.org/issue18208>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18129] Fatal Python error: Cannot recover from stack overflow.

2013-06-08 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18129>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18112] PEP 442 implementation

2013-06-08 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +isoschiz, pconnell

___
Python tracker 
<http://bugs.python.org/issue18112>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18111] Add a default argument to min & max

2013-06-08 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18111>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17792] Unhelpful UnboundLocalError due to del'ing of exception target

2013-05-30 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue17792>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18047] Descriptors get invoked in old-style objects and classes

2013-05-25 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18047>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18042] Provide enum.unique class decorator

2013-05-25 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18042>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18043] No mention of `match.regs` in `re` documentation

2013-05-25 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18043>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18036] "How do I create a .pyc file?" FAQ entry is out of date

2013-05-25 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18036>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18035] telnetlib incorrectly assumes that select.error has an errno attribute

2013-05-25 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18035>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18033] Example for Profile Module shows incorrect method

2013-05-25 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18033>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18032] set methods should specify whether they consume iterators "lazily"

2013-05-25 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue18032>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-13 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +isoschiz, pconnell

___
Python tracker 
<http://bugs.python.org/issue17947>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17908] Unittest runner needs an option to call gc.collect() after each test

2013-05-10 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue17908>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17927] Argument copied into cell still referenced by frame

2013-05-08 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +isoschiz

___
Python tracker 
<http://bugs.python.org/issue17927>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17927] Argument copied into cell still referenced by frame

2013-05-08 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue17927>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6028] Interpreter aborts when chaining an infinite number of exceptions

2013-04-25 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue6028>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2013-04-22 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue7475>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17807] Generator cleanup without tp_del

2013-04-21 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pitrou

___
Python tracker 
<http://bugs.python.org/issue17807>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17807] Generator cleanup without tp_del

2013-04-21 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +isoschiz, pconnell -pitrou

___
Python tracker 
<http://bugs.python.org/issue17807>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17804] streaming struct unpacking

2013-04-20 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue17804>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16863] Python 2 error in Argparse tutorial

2013-04-19 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue16863>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17306] Improve the way abstract base classes are shown in help()

2013-04-19 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue17306>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11698] Improve repr for structseq objects to show named, but unindexed fields

2013-04-19 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue11698>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2013-04-19 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue11549>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16394] Reducing tee() memory footprint

2013-04-19 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue16394>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12489] email.errors.HeaderParseError if base64url is used

2013-04-19 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue12489>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15992] Strict aliasing violations in Objects/unicodeobject.c

2013-04-19 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue15992>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17123] Add OCSP support to ssl module

2013-04-19 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue17123>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17633] zipimport's handling of namespace packages is incorrect

2013-04-18 Thread Phil Connell

Phil Connell added the comment:

Updated patch with markups suggested by Serhiy.

--
Added file: http://bugs.python.org/file29927/issue17633-2.diff

___
Python tracker 
<http://bugs.python.org/issue17633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16355] inspect.getcomments() does not work in the interactive shell

2013-04-18 Thread Phil Connell

Phil Connell added the comment:

Here's a patch that updates getcomments to match the behaviour of getsource, 
raising OSError if the source file can't be found and TypeError when passed a 
built-in.

Since this is a backwards-incompatible change, presumably it can only be 
applied to 3.4.

This is ready for review.

--
keywords: +patch
nosy: +pconnell
Added file: http://bugs.python.org/file29926/issue16355.diff

___
Python tracker 
<http://bugs.python.org/issue16355>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15852] typos in curses argument error messages

2013-04-18 Thread Phil Connell

Phil Connell added the comment:

The patch looks correct and complete, and still patches and passes the tests.

So, as far as I can see, this can be committed.

--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue15852>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17633] zipimport's handling of namespace packages is incorrect

2013-04-18 Thread Phil Connell

Phil Connell added the comment:

The attached patch is ready for review.

--
Added file: http://bugs.python.org/file29925/issue17633.diff

___
Python tracker 
<http://bugs.python.org/issue17633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17633] zipimport's handling of namespace packages is incorrect

2013-04-18 Thread Phil Connell

Changes by Phil Connell :


Removed file: http://bugs.python.org/file29696/test.diff

___
Python tracker 
<http://bugs.python.org/issue17633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17633] zipimport's handling of namespace packages is incorrect

2013-04-18 Thread Phil Connell

Changes by Phil Connell :


Removed file: http://bugs.python.org/file29679/zipimport_ns.diff

___
Python tracker 
<http://bugs.python.org/issue17633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9341] allow argparse subcommands to be grouped

2013-04-13 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue9341>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12820] Tests for Lib/xml/dom/minicompat.py

2013-04-06 Thread Phil Connell

Phil Connell added the comment:

I happened to spot this issue languishing, and the markups looked pretty 
straightforward, so I just went ahead and did them.

Updated patch attached.

--
nosy: +pconnell
Added file: http://bugs.python.org/file29698/minicompat_tests_markedup.diff

___
Python tracker 
<http://bugs.python.org/issue12820>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17633] zipimport's handling of namespace packages is incorrect

2013-04-06 Thread Phil Connell

Phil Connell added the comment:

Here's a test that fails without the patch and succeeds with the patch.

--
Added file: http://bugs.python.org/file29696/test.diff

___
Python tracker 
<http://bugs.python.org/issue17633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17633] zipimport's handling of namespace packages is incorrect

2013-04-06 Thread Phil Connell

Changes by Phil Connell :


Added file: http://bugs.python.org/file29679/zipimport_ns.diff

___
Python tracker 
<http://bugs.python.org/issue17633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17633] zipimport's handling of namespace packages is incorrect

2013-04-06 Thread Phil Connell

Changes by Phil Connell :


Removed file: http://bugs.python.org/file29679/zipimport_ns.diff

___
Python tracker 
<http://bugs.python.org/issue17633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2013-04-04 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue17636>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17633] zipimport's handling of namespace packages is incorrect

2013-04-04 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +isoschiz

___
Python tracker 
<http://bugs.python.org/issue17633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2013-04-04 Thread Phil Connell

Phil Connell added the comment:

I've raised issue17633 to track the issue in my last message.

--

___
Python tracker 
<http://bugs.python.org/issue14905>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17633] zipimport's handling of namespace packages is incorrect

2013-04-04 Thread Phil Connell

New submission from Phil Connell:

Only one level of namespace package nesting is handled correctly:

$ unzip -l foo.zip
Archive:  foo.zip
  Length  DateTimeName
-  -- -   
0  2013-04-03 17:28   a/b/c/foo.py
0  2013-04-03 17:34   a/
0  2013-04-03 17:34   a/b/
0  2013-04-03 17:34   a/b/c/
- ---
0 4 files
$ ls
foo.zip
$ PYTHONPATH=foo.zip ~/dev/cpython/python
Python 3.4.0a0 (default:3b1dbe7a2aa0+, Apr  3 2013, 17:31:54) 
[GCC 4.8.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import a
>>> import a.b
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'a.b'
>>>


The problem appears to be that check_is_directory constructs the wrong 
directory path (it should be 'a/b'):

check_is_directory (self=0x76d3dc88, prefix='a/', path='a.b')
at ./Modules/zipimport.c:280
280 dirpath = PyUnicode_FromFormat("%U%U%c", prefix, path, SEP);
(gdb) n
281 if (dirpath == NULL)
(gdb) p dirpath
$11 = 'a/a.b/'


I've attached a tentative initial patch that appears to fix the issue, although 
it probably needs some more thought (and definitely some more testing - the 
existing tests still pass though).

--
components: Extension Modules
files: zipimport_ns.diff
keywords: patch
messages: 186025
nosy: brett.cannon, eric.snow, ncoghlan, pconnell
priority: normal
severity: normal
status: open
title: zipimport's handling of namespace packages is incorrect
versions: Python 3.4
Added file: http://bugs.python.org/file29679/zipimport_ns.diff

___
Python tracker 
<http://bugs.python.org/issue17633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17630] Create a pure Python zipfile importer

2013-04-03 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue17630>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2013-04-03 Thread Phil Connell

Phil Connell added the comment:

The problem appears to be more general. zipimport fails for deeper hierarchies, 
even with directory entries.

With the supplied patch (zipimport-issue14905-2.patch) I see the following:

$ unzip -l foo.zip
Archive:  foo.zip
  Length  DateTimeName
-  -- -   
0  2013-04-03 17:28   a/b/c/foo.py
0  2013-04-03 17:34   a/
0  2013-04-03 17:34   a/b/
0  2013-04-03 17:34   a/b/c/
- ---
0 4 files
$ ls
foo.zip
$ PYTHONPATH=foo.zip ~/dev/cpython/python
Python 3.4.0a0 (default:3b1dbe7a2aa0+, Apr  3 2013, 17:31:54) 
[GCC 4.8.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import a
>>> import a.b
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'a.b'
>>>

--

___
Python tracker 
<http://bugs.python.org/issue14905>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2013-04-03 Thread Phil Connell

Changes by Phil Connell :


--
nosy: +pconnell

___
Python tracker 
<http://bugs.python.org/issue14905>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17577] Add lookahead/peek wrapper to itertools

2013-03-31 Thread Phil Connell

Phil Connell added the comment:

I like the suggested API: "iterator with indexing" is a good articulation of 
the request.

--

___
Python tracker 
<http://bugs.python.org/issue17577>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17577] Add lookahead/peek wrapper to itertools

2013-03-29 Thread Phil Connell

New submission from Phil Connell:

A recipe often requested on the likes of stackoverflow and activestate is a way 
to look 'ahead' in an iterator, without altering the values returned for 
subsequent next() calls.

Last time this came up on python-ideas, it got a reasonable reception:
  http://code.activestate.com/lists/python-ideas/19509/

So, having wanted (and implemented) this again, I thought it was worth a formal 
proposal.

Is this an idea worth pursuing?


I've attached a quick pure Python implementation, that adds a 'peek' method, 
used like this:

>>> it = lookahead(range(10))
>>> next(it)
0
>>> it.peek()
1
>>> next(it)
1
>>> it.peek(index=1)
3
>>> it.peek()
2
>>> next(it)
2

--
components: Library (Lib)
files: lookahead.py
messages: 185527
nosy: pconnell, rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: Add lookahead/peek wrapper to itertools
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file29606/lookahead.py

___
Python tracker 
<http://bugs.python.org/issue17577>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Phil Connell

Phil Connell added the comment:

I've updated the type to enhancement (it seems like a grey area to me - it's a 
behavioural fix for a niche use case).

I suggested a patch rather than simply subclassing RotatingFileHandler since:
  - The subclass would just have a copy of RotatingFileHandler's doRollover 
method with a one-line change.
  - The proposed fix is functionally equivalent to the current code for all 
currently working uses.


Thanks for the offer of having an extension linked from your blog. I don't 
think it's appropriate for this case (since it's just a slightly modified copy 
of the stdlib code - I'll probably just keep the patch along with a few other 
compatibility hacks we have) although I may have something for you in future 
(we do have a subclass that compresses old logs).

--
type: behavior -> enhancement

___
Python tracker 
<http://bugs.python.org/issue16449>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Phil Connell

Phil Connell added the comment:

Serhiy, there are also calls to os.rename in RotatingFileHandler.doRollover

--

___
Python tracker 
<http://bugs.python.org/issue16449>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >