[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-17 Thread paul j3

paul j3 added the comment:

'sample3.py' contains a '_handle_conflict_parent' function.

With the help of a change in '_add_container_actions' it determines whether a 
conflicting action occurs in multiple parsers (and argument_groups).  If it 
does, it deletes it from the correct group, without altering either the action, 
or other parsers.

If the action occurs in only 1 group, then the 'resolve' method is used.

The testing script mixes parents, subparsers, and various conflicts.

--
Added file: http://bugs.python.org/file36635/sample3.py

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



[issue22377] %Z in strptime doesn't match EST and others

2014-09-17 Thread R. David Murray

R. David Murray added the comment:

I don't think we are going to support a timezone list like that without PEP 431.

You should attach your patch to a new issue.  When I said this should the doc 
issue, that is because only a doc fix is acceptable for 3.4.  Adding more 
timezones to recognize would be an enhancement, given the complexity of the 
proposed solution.

On the other hand, if timezone names are ambiguous, I'm not sure there *is* a 
fix other than using the defacto standard names and offsets used by the email 
library.  Actually, isn't there a written standard that addresses this issue?  
I seem to remember reading a discussion of the problem somewhere...

--

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



[issue22420] Use print(file=sys.stderr) instead of sys.stderr.write() in IDLE

2014-09-17 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Reviewed the patch. Looks good to go.

--
nosy: +orsenthil

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



[issue22428] KeyboardInterrupt inside a coroutine causes AttributeError

2014-09-17 Thread Jack O'Connor

New submission from Jack O'Connor:

The following test script prints a KeyboardInterrupt traceback (expected), but 
also an AttributeError traceback (unexpected):


import asyncio
@asyncio.coroutine
def main():
raise KeyboardInterrupt
asyncio.get_event_loop().run_until_complete(main())


Traceback (most recent call last):
  File test.py, line 9, in module
asyncio.get_event_loop().run_until_complete(main())
  File /usr/lib/python3.4/asyncio/base_events.py, line 203, in 
run_until_complete
self.run_forever()
  File /usr/lib/python3.4/asyncio/base_events.py, line 184, in run_forever
self._run_once()
  File /usr/lib/python3.4/asyncio/base_events.py, line 817, in _run_once
handle._run()
  File /usr/lib/python3.4/asyncio/events.py, line 39, in _run
self._callback(*self._args)
  File /usr/lib/python3.4/asyncio/tasks.py, line 321, in _step
result = next(coro)
  File /usr/lib/python3.4/asyncio/tasks.py, line 103, in coro
res = func(*args, **kw)
  File test.py, line 6, in main
raise KeyboardInterrupt
KeyboardInterrupt
--- Logging error ---
Traceback (most recent call last):
--- Logging error ---
Traceback (most recent call last):
Exception ignored in: bound method Task.__del__ of 
Task(coro)exception=KeyboardInterrupt()
Traceback (most recent call last):
  File /usr/lib/python3.4/asyncio/futures.py, line 184, in __del__
  File /usr/lib/python3.4/asyncio/base_events.py, line 725, in 
call_exception_handler
  File /usr/lib/python3.4/logging/__init__.py, line 1296, in error
  File /usr/lib/python3.4/logging/__init__.py, line 1402, in _log
  File /usr/lib/python3.4/logging/__init__.py, line 1412, in handle
  File /usr/lib/python3.4/logging/__init__.py, line 1482, in callHandlers
  File /usr/lib/python3.4/logging/__init__.py, line 846, in handle
  File /usr/lib/python3.4/logging/__init__.py, line 977, in emit
  File /usr/lib/python3.4/logging/__init__.py, line 899, in handleError
  File /usr/lib/python3.4/traceback.py, line 169, in print_exception
  File /usr/lib/python3.4/traceback.py, line 153, in _format_exception_iter
  File /usr/lib/python3.4/traceback.py, line 18, in _format_list_iter
  File /usr/lib/python3.4/traceback.py, line 65, in _extract_tb_or_stack_iter
  File /usr/lib/python3.4/linecache.py, line 15, in getline
  File /usr/lib/python3.4/linecache.py, line 41, in getlines
  File /usr/lib/python3.4/linecache.py, line 126, in updatecache
  File /usr/lib/python3.4/tokenize.py, line 437, in open
AttributeError: 'module' object has no attribute 'open'


The issue is that Task._step() calls self.set_exception() for both Exceptions 
and BaseExceptions, but it reraises BaseExceptions. That means that the 
BaseEventLoop never gets to call future.result() to clear the exception when 
it's a BaseException. Future.__del__ eventually tries to log this uncleared 
exception, but something about the circumstances of program exit (caused by the 
same exception) has already cleaned up the builtins needed for logging.

Is that __del__ violating some best practices for finalizers by calling such a 
complicated function? Either way, I'm not sure this case should be considered 
an unretrieved exception at all. It's propagating outside the event loop 
after all. Should Task._step() be setting it in the first place, if it's going 
to reraise it? Should it be set without _log_traceback=True somehow?

--
components: asyncio
messages: 226985
nosy: gvanrossum, haypo, oconnor663, yselivanov
priority: normal
severity: normal
status: open
title: KeyboardInterrupt inside a coroutine causes AttributeError
type: behavior
versions: Python 3.4

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



[issue22419] wsgiref request length

2014-09-17 Thread Senthil Kumaran

Senthil Kumaran added the comment:

The patch looks good. Yeah, wsgiref server will see the benefiting of rejecting 
long url with 414.

--
nosy: +orsenthil

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



[issue22419] wsgiref request length

2014-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7a4d960fc801 by Senthil Kumaran in branch '2.7':
Issue #22419: Limit the length of incoming HTTP request in wsgiref server to 
65536 bytes.
https://hg.python.org/cpython/rev/7a4d960fc801

New changeset a4e0aee1a9b5 by Senthil Kumaran in branch '3.3':
Issue #22419: Limit the length of incoming HTTP request in wsgiref server to 
65536 bytes.
https://hg.python.org/cpython/rev/a4e0aee1a9b5

New changeset ba86978c8ab5 by Senthil Kumaran in branch '3.4':
Merge from 3.3
https://hg.python.org/cpython/rev/ba86978c8ab5

New changeset 07b928530cdf by Senthil Kumaran in branch 'default':
Merge from 3.4
https://hg.python.org/cpython/rev/07b928530cdf

--
nosy: +python-dev

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



[issue22419] wsgiref request length

2014-09-17 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks, fixed in all versions applicable for security release.

--
assignee:  - orsenthil
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue22419] wsgiref request length

2014-09-17 Thread Senthil Kumaran

Changes by Senthil Kumaran sent...@uthcode.com:


--
versions: +Python 2.7, Python 3.3, Python 3.4, Python 3.5

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



[issue17381] IGNORECASE breaks unicode literal range matching

2014-09-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This patch has a disadvantage - it slows down case-insensitive compiling of 
some very wide ranges, e.g. compile(r[\x00-\U0010]+, re.I) (this is worst 
case). In most cases this is not important, because such wide ranges are rare 
enough and compiled patterns are cached.

To get rid of this regression, we need new opcode. Due to preserving binary 
compatibility, this approach can't be applied to old releases. Here is a patch 
for 3.5.

Please make a review. This patches are needed to continue fixing of other re 
bugs.

--
keywords: +needs review
Added file: http://bugs.python.org/file36636/re_ignore_case_range-3.5.patch

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



[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread Josh Rosenberg

Changes by Josh Rosenberg shadowranger+pyt...@gmail.com:


--
nosy: +josh.rosenberg

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



[issue22417] PEP 476: verify HTTPS certificates by default

2014-09-17 Thread Senthil Kumaran

Changes by Senthil Kumaran sent...@uthcode.com:


--
nosy: +orsenthil

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



[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-17 Thread Frank Thommen

Frank Thommen added the comment:

strace gives me the error:

  unlink(/mnt/tmpu817xz) = -1 EIO (Input/output error)

But after escalating the issue to our server vendor it turned out that the 
problem lies in the filesystem option nbmand.  If this option is set to on 
- which it seems to be by default on our zfs filesystems - and the filesystem 
is exported and mounted with NFS v4, then tempfile.TemporaryFile fails:

[...]
V4 Call (Reply In 167) RENAME From: tmpr0OaMb To: .nfs0027af65
V4 Reply (Call In 166) RENAME Status: NFS4ERR_FILE_OPEN
[...]

I assume that this is nothing Python can check for and therefore not a Python 
problem.

Not sure what the policy is: Can I set the ticket to solved myself?

--

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



[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

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



[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-17 Thread STINNER Victor

STINNER Victor added the comment:

   unlink(/mnt/tmpu817xz) = -1 EIO (Input/output error)

If a system call can fail with EIO, I guess that not only Python is affected, 
by *any* program. So I don't see why Python should have a special case for 
broken filesystems.

I close the issue as not a bug.

--
resolution:  - not a bug
status: open - closed

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



[issue22428] asyncio: KeyboardInterrupt inside a coroutine causes AttributeError

2014-09-17 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
title: KeyboardInterrupt inside a coroutine causes AttributeError - asyncio: 
KeyboardInterrupt inside a coroutine causes AttributeError

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



[issue22385] Define a binary output formatting mini-language for *.hex()

2014-09-17 Thread Nick Coghlan

Nick Coghlan added the comment:

Retitled the issue and made it depend on issue 9951.

I now think it's better to tackle this more like strftime and have a method 
that accepts of particular custom formatting mini-language (in this case, the 
new hex() methods proposed in issue 9951), and then also support that 
mini-language in the __format__() method.

It would likely need a PEP to decide on the exact details of the formatting.

--
dependencies: +introduce bytes.hex method
title: Allow 'x' and 'X' to accept bytes-like objects in string formatting - 
Define a binary output formatting mini-language for *.hex()

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



[issue22385] Define a binary output formatting mini-language for *.hex()

2014-09-17 Thread Nick Coghlan

Nick Coghlan added the comment:

python-ideas post with a sketch of a possible mini-language: 
https://mail.python.org/pipermail/python-ideas/2014-September/029352.html

--

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



[issue22429] asyncio: pending call to loop.stop() if a coroutine raises a BaseException

2014-09-17 Thread STINNER Victor

New submission from STINNER Victor:

Attached script stops immediatly whereas I would expect that the second call to 
run_forever() keeps running. If you execute the script, you will see:

deque([Handle _raise_stop_error() at 
/home/haypo/prog/python/default/Lib/asyncio/base_events.py:94])

The first call to run_forever() keeps a pending call to loop.stop() (to 
_rase_stop_error() in fact).

I don't know if it should be called a bug or if this surprising behaviour 
should be documented.

See also the issue #22428.

--
components: asyncio
files: pending_stop.py
messages: 226994
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: pending call to loop.stop() if a coroutine raises a 
BaseException
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36637/pending_stop.py

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



[issue22428] asyncio: KeyboardInterrupt inside a coroutine causes AttributeError

2014-09-17 Thread STINNER Victor

STINNER Victor added the comment:

I see different issues in your example:


* If the coroutine raises an exception which doesn't inherit from Exception 
(but inherits from BaseException), run_until_complete() doesn't consume the 
exception from the temporary task object

= run_until_complete(coroutine) sets the _log_destroy_pending attribute of the 
temporary Task to False, but this attribute controls the Task was destroyed 
but it is pending! warning. The %s exception was never retrieved warning is 
controlled by the Future._log_traceback attribute (in Python 3.4+). This 
attribute is set to True in Future.set_exception().*


* If a Task is deleted late during Python shutdown, the logging module fails to 
log the traceback because the builtin function has been deleted.

= IMO it's an issue in the traceback module. It may catch the AttributeError 
on the call to linecache.getline(). It's not convinient to get a new exception 
(traceback) when trying to display a traceback... Maybe the traceback can check 
if Python is exiting before calling the linecache module?


* If you call again loop.run_forever(): it exits immediatly because a call to 
loop.stop() was scheduled by future.set_exception()

= I created the issue #22429


I don't think that it's a bug that Task._step() calls set_exception() for 
BaseException. Otherwise, how do you know that a task failed?

--

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



[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread STINNER Victor

STINNER Victor added the comment:

On Python 3.5 compiled in debug mode (or probably with python -Wd when compiled 
in release mode), I got this warning:

/home/haypo/prog/python/default/Lib/tempfile.py:708: ResourceWarning: 
Implicitly cleaning up TemporaryDirectory '/tmp/tmpcr8u3m8v'
  _warnings.warn(warn_message, ResourceWarning)

The script is really a corner case: the generator is garbage collected whereas 
it is not done. At the same time, the TemporaryDirectory object is also garbage 
collected. I guess that the exact order of object deletion is not reliable: the 
generator may be deleted before or after the TemporaryDirectory.

TemporaryDirectory._cleanup() is called by the finalizer (_weakref.finalize) of 
the TemporaryDirectory, which means that the TemporaryDirectory object is 
garbage collected.

TemporaryDirectory.cleanup() is called indirectly by 
TemporaryDirectory.__exit__().

I'm suprised that deleting a generator calls __exit__().

The following script has a more reliable behaviour: 
TemporaryDirectory.__exit__() is called when the generator is deleted, and 
TemporaryDirectory.cleanup() is not called.
---
import tempfile
import gc

def generator():
with tempfile.TemporaryDirectory():
print(before yield)
yield
print(after yield)
g = generator()
next(g)

g = None
gc.collect()
---

--

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



[issue22430] Build failure if configure flags --prefix or --exec-prefix is set

2014-09-17 Thread diff 812

New submission from diff 812:

only ./configure --prefix=/usr is running

--
components: Build
files: configure.log
messages: 226997
nosy: diff.812
priority: normal
severity: normal
status: open
title: Build failure if configure flags --prefix or --exec-prefix is set
versions: Python 2.7
Added file: http://bugs.python.org/file36638/configure.log

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



[issue22430] Build failure if configure flags --prefix or --exec-prefix is set

2014-09-17 Thread diff 812

diff 812 added the comment:

make command

--
Added file: http://bugs.python.org/file36639/make.log

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



[issue22430] Build failure if configure flags --prefix or --exec-prefix is set

2014-09-17 Thread diff 812

diff 812 added the comment:

make without --prefix key

--
Added file: http://bugs.python.org/file36640/make_ok.log

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



[issue22431] Change format of test runner output

2014-09-17 Thread Philipp Metzler

New submission from Philipp Metzler:

Can I change the test runner output format to
main.tests.tests.TimeSlotTestCase.test_creation ... ERROR
instead of
test_creation (main.tests.tests.TimeSlotTestCase) ... ERROR
so that I can easily just copypaste that line and run the test again without 
having to remove the brackets () and having to copy the name of the test behind 
the class and add a .?

--
components: Tests
messages: 227000
nosy: googol
priority: normal
severity: normal
status: open
title: Change format of test runner output
type: enhancement
versions: Python 2.7

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



[issue22431] Change format of test runner output

2014-09-17 Thread R. David Murray

R. David Murray added the comment:

I remember this feature being requested before (I vote +1 myself :), and I 
believe I recall a conversation involving Michael Foord where he approved it in 
principle, but I can't find an open issue for it.  As a new feature it can only 
go into 3.5, and would presumably need to be controlled by an option somewhere 
to preserve backward compatibility with things that parse unittest output.

If you want to work on a patch that would be welcome.

--
components: +Library (Lib) -Tests
nosy: +michael.foord, r.david.murray
versions: +Python 3.5 -Python 2.7

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



[issue22432] function crypt not working on OSX

2014-09-17 Thread Mark Wieczorek

New submission from Mark Wieczorek:

Hi, 

I just wanted to let you know of a bug that is related to the function crypt 
in osx (10.9.4). I have tried the default osx version of python (2.75), the 
brew version (2.7.8), and the macports version (2.7.7).

In short, the command

python -c 'import crypt; print crypt.crypt(test12345, $6$salt)'

produces the output : $6n8sgZJBMh4U

The correct output should be 

$6$salt$omHbK1V1Alwa0VKXqLaW38vdS1uUhfx8GTj7XXCJcNUJxABwmYe8Vhpyt2tnnaAFC6UTI7PNk9sTtSGWGnYop.

I have no idea what the problem is.

--
assignee: ronaldoussoren
components: Macintosh
messages: 227002
nosy: lunokhod, ronaldoussoren
priority: normal
severity: normal
status: open
title: function crypt not working on OSX
type: behavior
versions: Python 2.7

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



[issue22432] function crypt not working on OSX

2014-09-17 Thread Geoffrey Spear

Geoffrey Spear added the comment:

The same behavior exists in Python 3, however, I'm not sure it's a bug. The 
documentation says The characters in salt must be in the set [./a-zA-Z0-9]. 
Presumably the behavior when there is a $ in the salt is undefined by Python, 
and different on different platforms.

--
nosy: +geoffreyspear

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



[issue22432] function crypt not working on OSX

2014-09-17 Thread Mark Wieczorek

Mark Wieczorek added the comment:

It actually doesn't even matter what you use for salt. If you change salt, 
you get the same hash. That is bug #2 !

--

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



[issue22432] function crypt not working on OSX

2014-09-17 Thread Geoffrey Spear

Geoffrey Spear added the comment:

This is actually the expected behavior of crypt(3) on OS X. It doesn't support 
the $id$ modular format, and if the salt does not begin with an underscore only 
the first 2 bytes are used (presumably in your bug #2 you're changing parts 
of the salt beyond the first 2 bytes.)

Python's behavior differing based on the underlying C library on the system is 
documented; this is neither a bug in Python or in OS X crypt (although it could 
be argued that OS X crypt is kind of useless and insecure...)

--

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



[issue22432] function crypt not working on OSX

2014-09-17 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +r.david.murray
resolution:  - not a bug
stage:  - resolved
status: open - closed

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



[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread Jack O'Connor

Jack O'Connor added the comment:

My example script is definitely a corner case, but where this actually came up 
for me was in asyncio. Using a TemporaryDirectory inside a coroutine creates a 
similar situation.

--

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



[issue22433] Argparse considers unknown optional arguments with spaces as a known positional argument

2014-09-17 Thread Денис Кореневский

New submission from Денис Кореневский:

Argparse version 1.1 consider ANY unknown argument string containig ' ' (space 
character) as positional argument. As a result it can use such unknown optional 
argument as a value of known positional argument.

Demonstration code:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument(--known-optional-arg, -k, action=store_true)
parser.add_argument(known_positional, action=store, type=str)
parser.parse_known_args([--known-optional-arg, --unknown-optional-arg=with 
spaces, known positional arg])
parser.parse_known_args([--known-optional-arg, 
--unknown-optional-arg=without_spaces, known positional arg])

Bugfix is attached to issue and affects ArgumentParser._parse_optional() method 
body.

Sorry, if it is a better way to report (or, possibly, fix) a bug than this 
place. It is my first python bug report.

Thanks.

--
components: Extension Modules
files: argparse.py.patch
keywords: patch
messages: 227007
nosy: DenKoren
priority: normal
severity: normal
status: open
title: Argparse considers unknown optional arguments with spaces as a known 
positional argument
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file36641/argparse.py.patch

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



[issue22434] Use named constants internally in the re module

2014-09-17 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Regular expression parser parses a pattern to a tree, marking nodes by string 
identifiers. Regular expression compiler converts this three into plain list of 
integers. Node's identifiers are transformed to sequential integers. Resulting 
list is not human readable. Proposed patch converts string constants in the 
sre_constants module to named integer constants. These constants doesn't need 
converting to integers, because they are already integers, and when printed 
they looks human-friendly. Now intermediate result of regular expression 
compiler looks much more readable.

Example.

 import re, sre_compile, sre_parse
 sre_compile._code(sre_parse.parse('[a-z_][a-z_0-9]+', re.I), re.I)

Before patch:

[17, 4, 0, 2, 2147483647, 16, 7, 27, 97, 122, 19, 95, 0, 29, 16, 1, 2147483647, 
16, 11, 10, 0, 67043328, 2147483648, 134217726, 0, 0, 0, 0, 0, 1, 1]

After patch:

[INFO, 4, 0, 2, MAXREPEAT, IN_IGNORE, 7, RANGE, 97, 122, LITERAL, 95, FAILURE, 
REPEAT_ONE, 16, 1, MAXREPEAT, IN_IGNORE, 11, CHARSET, 0, 67043328, 2147483648, 
134217726, 0, 0, 0, 0, FAILURE, SUCCESS, SUCCESS]

This patch also affects debugging output when regular expression is compiled 
with re.DEBUG (identifiers are uppercased and MAXREPEAT is displayed instead of 
2147483647 in repeat statements).

Besides debugging output these changes are invisible for ordinal user. They are 
needed only for developing and debugging the re module itself. The patch 
doesn't affect performance and almost not affects memory consumption.

--
components: Regular Expressions
files: re_named_consts.patch
keywords: patch
messages: 227008
nosy: ezio.melotti, mrabarnett, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Use named constants internally in the re module
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file36642/re_named_consts.patch

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



[issue22433] Argparse considers unknown optional arguments with spaces as a known positional argument

2014-09-17 Thread Денис Кореневский

Денис Кореневский added the comment:

I've signed 'Contributor's Agreement'.

Bug demonstration code listed in issue description is in file attached to 
comment.

It can be run with following command:
python argparse_bug_example.py

--
Added file: http://bugs.python.org/file36643/argparse_bug_example.py

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



[issue22434] Use named constants internally in the re module

2014-09-17 Thread Guido van Rossum

Guido van Rossum added the comment:

Love it!

--
nosy: +gvanrossum

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



[issue22430] Build failure if configure flags --prefix or --exec-prefix is set

2014-09-17 Thread Ned Deily

Ned Deily added the comment:

It is difficult to tell what the problem you encountered here is without more 
information.  Python is supported on many different platforms and regularly 
built with --prefix being set.  To investigate further, you would need to 
indicate exactly which version of Python, which version of which operating 
system platform, and the exact configure and make commands you are using.  
Nevertheless, because you seem to be doing a shared (--enable-shared) build 
with a prefix of /usr, I speculate you *might* be running into the issue 
documented, and recently fixed, in Issue21166.  You could try removing 
--enable-shared, or you could try applying the change from that issue, or you 
could try working around simulating the patch's effect by creating a dummy 
pybuilddir.txt before running make.

--
nosy: +ned.deily

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



[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which may fix this issue.

--
keywords: +patch
nosy: +pitrou, serhiy.storchaka
stage:  - patch review
versions: +Python 3.5
Added file: http://bugs.python.org/file36644/tempfile_exit_on_shutdown.patch

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



[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is alternative patch. It simplifies TemporaryDirectory instead of 
complicate it.

--
Added file: http://bugs.python.org/file36645/tempfile_exit_on_shutdown2.patch

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



[issue21077] Turtle Circle Speed 0

2014-09-17 Thread ingrid

ingrid added the comment:

This seems to be caused by a bug in TurtleScreen.update/turtle._drawturtle. 
When the speed is set to zero, the tracer method is used to regulate drawing 
circles, and when called with a positive integer, tracer calls update. Update 
iterates over the list of existing turtle objects and then updates them and 
calls _drawturtle on them, then redraws them, but doesn't draw lines or stamps 
so they'll get drawn over by shapes and images. I attached a snippet that shows 
the bug happening when you call update directly, if you switch the last line 
and use tracer instead the same thing happens. I think the way to fix it is to 
add stamps and lines to _drawturtle so I'm going to work on a patch that uses 
that approach.

--
nosy: +ingrid
Added file: http://bugs.python.org/file36646/update_example.py

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



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2014-09-17 Thread STINNER Victor

STINNER Victor added the comment:

fix_tests.patch: Fix the 7 tests which create files without removing them. 4 
tests (test_imp, test_pdb, test_source_encoding and test_support) create a 
__pycache__ directory. Maybe this directory should be ignored by regrtest?

--
Added file: http://bugs.python.org/file36647/fix_tests.patch

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



[issue22043] Use a monotonic clock to compute timeouts

2014-09-17 Thread STINNER Victor

STINNER Victor added the comment:

Buildbots are happy, I close the issue.

--
resolution:  - fixed
status: open - closed

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



[issue22431] Change format of test runner output

2014-09-17 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

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



[issue22435] socketserver.TCPSocket leaks socket to garbage collector if server_bind() fails

2014-09-17 Thread Martin Panter

New submission from Martin Panter:

Bind method may easily fail on Unix if there is no permission to bind to a 
privileged port:

 try: TCPServer((, 80), ...)
... except Exception as err: err
... 
PermissionError(13, 'Permission denied')
 gc.collect()
__main__:1: ResourceWarning: unclosed socket.socket fd=3, 
family=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=0, 
laddr=('0.0.0.0', 0)
0

This problem is inherited by HTTPServer and WSGIServer. My current workaround 
includes this code in a BaseServer fixup mixin, invoking server_close() if 
__init__() fails:

class Server(BaseServer, Context):
def __init__(self, ...):
try:
super().__init__((host, port), RequestHandlerClass)
except:  # Workaround for socketserver.TCPServer leaking socket
self.close()
raise

def close(self):
return self.server_close()

--
components: Library (Lib)
messages: 227017
nosy: vadmium
priority: normal
severity: normal
status: open
title: socketserver.TCPSocket leaks socket to garbage collector if 
server_bind() fails
type: resource usage
versions: Python 3.4

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



[issue4180] warnings.simplefilter(always) does not make warnings always show up

2014-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8adb2c6e0803 by Antoine Pitrou in branch '3.4':
Issue #4180: The warnings registries are now reset when the filters are 
modified.
https://hg.python.org/cpython/rev/8adb2c6e0803

New changeset 4bc60eb68d3e by Antoine Pitrou in branch 'default':
Issue #4180: The warnings registries are now reset when the filters are 
modified.
https://hg.python.org/cpython/rev/4bc60eb68d3e

--
nosy: +python-dev

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



[issue4180] warnings.simplefilter(always) does not make warnings always show up

2014-09-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, this is pushed to 3.x.

--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue11471] If without else generates redundant jump

2014-09-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Pushed after applying Serhiy's suggestion. Thank you!

--

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



[issue11471] If without else generates redundant jump

2014-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c0ca9d32aed4 by Antoine Pitrou in branch 'default':
Closes #11471: avoid generating a JUMP_FORWARD instruction at the end of an 
if-block if there is no else-clause.
https://hg.python.org/cpython/rev/c0ca9d32aed4

--
nosy: +python-dev
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue21391] shutil uses both os.path.abspath and an 'import from' of abspath

2014-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ab369d809200 by Berker Peksag in branch 'default':
Issue #21391: Use os.path.abspath in the shutil module.
https://hg.python.org/cpython/rev/ab369d809200

--
nosy: +python-dev

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



[issue21391] shutil uses both os.path.abspath and an 'import from' of abspath

2014-09-17 Thread Berker Peksag

Berker Peksag added the comment:

Done. Thanks for the reviews!

--
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

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



[issue21706] Add base for enumerations (Functional API)

2014-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 713ee49ec3ba by Berker Peksag in branch 'default':
Issue #21706: Add a versionchanged directive to the functional API docs.
https://hg.python.org/cpython/rev/713ee49ec3ba

--

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



[issue14824] reprlib documentation references string module

2014-09-17 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage:  - patch review
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

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



[issue14824] reprlib documentation references string module

2014-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e9968782c9ba by Berker Peksag in branch '3.4':
Issue #14824: Update Repr.repr_TYPE documentation to use correct name mangling 
implementation.
https://hg.python.org/cpython/rev/e9968782c9ba

New changeset a0372781eafb by Berker Peksag in branch 'default':
Issue #14824: Update Repr.repr_TYPE documentation to use correct name mangling 
implementation.
https://hg.python.org/cpython/rev/a0372781eafb

--
nosy: +python-dev

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



[issue14824] reprlib documentation references string module

2014-09-17 Thread Berker Peksag

Berker Peksag added the comment:

 I don't know why we would ever have a space in a typename, ever (and if 
 someone does awful hacks to get to that state, he should probably also do 
 awful hacks to make reprlib work properly).

That part of the code has been added 22 years ago: 
https://hg.python.org/cpython/rev/a0d4c5ef1d5d#l9.22 So probably the reason is 
that the code is just old. 

Thanks for the patch, Chris!

--
assignee: docs@python - berker.peksag
nosy: +berker.peksag
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue16827] Remove the relatively advanced content from section 2 in tutorial

2014-09-17 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: needs patch - patch review

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



[issue16827] Remove the relatively advanced content from section 2 in tutorial

2014-09-17 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +berker.peksag

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



[issue16827] Remove the relatively advanced content from section 2 in tutorial

2014-09-17 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, James. Did you see my review comments on Rietveld? Please 
see at http://bugs.python.org/review/16827/#ps11699

--

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




[issue19690] test_logging test_race failed with PermissionError

2014-09-17 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage:  - needs patch
type:  - behavior
versions: +Python 3.5

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



[issue22399] Doc: missing anchor for dict in library/functions.html

2014-09-17 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +georg.brandl

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



[issue21397] tempfile.py: Fix grammar in docstring, comment typos

2014-09-17 Thread Berker Peksag

Berker Peksag added the comment:

The latest patch LGTM.

--
nosy: +berker.peksag
stage: patch review - commit review

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



[issue21049] Warning at interpreter exit triggers flood of “ImportWarning: sys.meta_path is empty”

2014-09-17 Thread Martin Panter

Martin Panter added the comment:

My original demonstration was distilled from a real world case. I get this 
issue with other real world cases too, so I am expanding the title to reflect 
what I think is going on. This problem seems to be caused by a ResourceWarning 
triggered from a garbage cycle being freed just before Python exits. The flood 
of ImportWarning lines makes it annoying to scroll up to see what other 
ResourceWarning messages, exceptions, etc you are missing out on.

Much simpler one-liner demonstration adapted from Message 222403 (because class 
definitions create garbage cycles in my experience):

python3 -Wall -c 'class C: a = open(/dev/null)'

The best workaround is probably to use “python -Wdefault” rather than “python 
-Wall”. Then you only get one ImportWarning line.

I suspect the problem might be caused by a recursive loop between emitting a 
warning and importing something, as Antoine hinted. Calling 
sys.setrecursionlimit(30) reduces the flood to 5 lines. Unfortunately my 
modifications to “importlib/_bootstrap.py” and “warnings.py” on my OS are not 
having any effect, otherwise I might try to make a patch.

Perhaps if it is not appropriate for the ImportWarning to be removed, could the 
code printing out the warning be changed to avoid triggering it in the first 
place?

--
title: Flood of “ImportWarning: sys.meta_path is empty” after exception with 
socket subclass - Warning at interpreter exit triggers flood of 
“ImportWarning: sys.meta_path is empty”

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



[issue22399] Doc: missing anchor for dict in library/functions.html

2014-09-17 Thread Georg Brandl

Georg Brandl added the comment:

The anchor for dict is on the standard types page: 
https://docs.python.org/2/library/stdtypes.html#dict

You'll have to use :class: not :func: to get it linked.

--
resolution:  - works for me
status: open - closed

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