[issue4080] unittest: display time of each test case

2012-02-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I think this would be a useful feature.

--
nosy: +rhettinger

___
Python tracker 

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



[issue14160] TarFile.extractfile fails to extract targets of top-level relative symlinks

2012-02-29 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo, lars.gustaebel
title: Tarfile.extractfile fails to extract targets of top-level relative 
symlinks -> TarFile.extractfile fails to extract targets of top-level relative 
symlinks
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue4080] unittest: display time of each test case

2012-02-29 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo
title: pyunit - display time of each test case - patch -> unittest: display 
time of each test case

___
Python tracker 

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



[issue11379] Remove "lightweight" from minidom description

2012-02-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

This is a reasonable case for a note.

--
nosy: +rhettinger

___
Python tracker 

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



[issue11379] Remove "lightweight" from minidom description

2012-02-29 Thread Eli Bendersky

Eli Bendersky  added the comment:

>
> I’m not sure I would use note markup, though (cf. Raymond’s aversion to
> littering the doc with note and warning boxes).
>

I also dislike box littering, but this one seems like a really good fit for
a note, since it's completely outside the flow of that documentation page.

--

___
Python tracker 

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



[issue14161] python2 file __repr__ does not escape filename

2012-02-29 Thread Éric Araujo

Éric Araujo  added the comment:

Duh, obviously that code branch is used only for unicode paths:

  >>> open('/tmp/t\nest', 'w')
  
  >>> open(u'/tmp/t\nest', 'w')
  

There does not seem to be something similar in 
http://docs.python.org/c-api/string, so I guess one would have to create 
intermediary objects to decode str to unicode, transform with unicode-escape 
and convert back to str.

--

___
Python tracker 

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



[issue14161] python2 file __repr__ does not escape filename

2012-02-29 Thread Éric Araujo

Éric Araujo  added the comment:

Funny one :D  Reproduced on linux:

  >>> open('/tmp/t\nest', 'w')
  

file_repr in Objects/fileobject.c calls 
http://docs.python.org/c-api/unicode#PyUnicode_AsUnicodeEscapeString, 
equivalent to encode('unicode-escape'), so backslashes should be escaped.

--

___
Python tracker 

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



[issue11379] Remove "lightweight" from minidom description

2012-02-29 Thread Éric Araujo

Éric Araujo  added the comment:

I’m not sure I would use note markup, though (cf. Raymond’s aversion to 
littering the doc with note and warning boxes).

--

___
Python tracker 

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



[issue14163] tkinter: problems with hello doc example

2012-02-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Rick Johnson anwered question 1b on python-list: simply move root.destroy to 
the button. I make other changes also: use import...as; show that options can 
be set in constructor call. File uploaded.

--
stage:  -> patch review
Added file: http://bugs.python.org/file24693/tk_hello.py

___
Python tracker 

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



[issue13394] Patch to increase aifc lib test coverage

2012-02-29 Thread Oleg Plakhotnyuk

Changes by Oleg Plakhotnyuk :


Added file: http://bugs.python.org/file24692/test_aifc_3_2.patch

___
Python tracker 

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



[issue13394] Patch to increase aifc lib test coverage

2012-02-29 Thread Oleg Plakhotnyuk

Changes by Oleg Plakhotnyuk :


Removed file: http://bugs.python.org/file24691/test_aifc_3_2.patch

___
Python tracker 

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



[issue13394] Patch to increase aifc lib test coverage

2012-02-29 Thread Oleg Plakhotnyuk

Oleg Plakhotnyuk  added the comment:

For convenience I have uploaded the separate patch without warnings. Which 
means that it will generate some output during tests run.

--
Added file: http://bugs.python.org/file24691/test_aifc_3_2.patch

___
Python tracker 

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



[issue14159] __len__ method of weakset

2012-02-29 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: normal -> high

___
Python tracker 

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



[issue14162] PEP 416: Add a builtin frozendict type

2012-02-29 Thread STINNER Victor

STINNER Victor  added the comment:

frozendict_builtins.patch: make CPython supports frozendict for the 
__builtins__ mapping. It is an example of frozendict usage which helps my 
pysandbox project.

--
title: Implementation of the PEP 416 (Add a builtin frozendict type) -> PEP 
416: Add a builtin frozendict type
Added file: http://bugs.python.org/file24690/frozendict_builtins.patch

___
Python tracker 

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



[issue14163] tkinter: problems with hello doc example

2012-02-29 Thread Terry J. Reedy

New submission from Terry J. Reedy :

After an intro, the tkinter docs start with a traditional 'Hello World'.
http://docs.python.org/py3k/library/tkinter.html#a-simple-hello-world-program

Problem 1. The example ends with 
root.destroy
John Salerno, today, on python-list thread "Is it necessary to call Tk() when 
writing a GUI app with Tkinter?", reported the following, which I verified. On 
Windows, at least, closing the unlabelled Tk window by clicking the normal [X} 
close button on the frame causes

_tkinter.TclError: can't invoke "destroy" command:  application has been 
destroyed

This does not happen if one instead clicks the QUIT button inside the frame (as 
that does not destroy the app).

Question 1a. Does the example work the same with current tcl/tk on *nix and mac?

I assume it should, but I do not know if the example was buggy from the 
beginning or if something changes. In any case, I do not want to commit a 
solution that is not tested on more than my Win7.

Question 1b. How do we most simply fix this part of the example?

In '''self.QUIT["command"] = self.quit''', I changed 'quit' to 'destroy' and 
the result is to destroy the widgets but leave the outer frame and continue the 
mainloop.

I tried another solution based on adding
self.protocol("WM_DELETE_WINDOW", self.onDestroyWindow)
to __init__(), but while this worked for Rick Johnson's class App(tk.Tk) 
example in his response to Salerno, it does not work for this class 
Application(Frame) example as the latter has no .protocol attribute.
---

Problem 2. A 'Hello World' example should say 'Hello World' instead of just 
'hello'. So I make the trivial edit and tk add braces and displays '{Hello 
World}'. What??? Adding '\n' does not trigger brace addition, so  
"Hello_World\n(click_me)" works as expected.

Queston 2. How does one put a space in a button label with triggering addition 
of braces, or is this impossible?
---

Problem and Solution 3. The example currently puts a loud capital red QUIT 
button first, and the quiet lowercase blass hello button second. This is 
backwards in both placement and emphasis. Putting the expanded hello buttom on 
top and QUIT under looks better to me.
---

Problem 4 (in the intro, before the example): There is a lot that could be 
changed or added to the doc, but I think revising 

to use Tkinter all you need is a simple import statement:
import tkinter
Or, more often:
from tkinter import *

(3.x version) to add what I think is the best option, 'import tkinter as tk', 
as at least equal to the '*' option, should be done soon. I am thinking of 
something like

to use Tkinter, use one of these import statements:
import tkinter
import tkinter as tk
from tkinter import *

--
assignee: docs@python
components: Documentation, Tkinter
messages: 154669
nosy: docs@python, ned.deily, serwy, terry.reedy
priority: normal
severity: normal
status: open
title: tkinter: problems with hello doc example
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue14153] Expose os.device_encoding() at the C level

2012-02-29 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue14153] Expose os.device_encoding() at the C level

2012-02-29 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c80d9a0bd5a0 by Brett Cannon in branch 'default':
Issue #14153 Create _Py_device_encoding() to prevent _io from having to import
http://hg.python.org/cpython/rev/c80d9a0bd5a0

--
nosy: +python-dev

___
Python tracker 

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



[issue8170] Wrong Paths for distutils build --plat-name=win-amd64

2012-02-29 Thread Mark Hammond

Mark Hammond  added the comment:

Those instructions in section 5.4 do seem wrong.  On first reading they imply 
that you need to start with a clean source tree on your 32bit Windows, then 
build the 64bit version of Python.  So far so good.  However, then you need to 
run python.exe - which must be a 32bit version of Python or it wouldn't start.

So I *guess* the instructions really should say to build *both* the 32 and 
64bit versions in the same source tree - in which case I can see why your patch 
would be necessary.

Can you confirm the process you used?  I assume you did build both versions in 
the same tree, but you also mentioned copying the .lib files around - was that 
an attempt to work around this bug?

But yeah, sorry for the distraction - given 5.4 I think this bug is probably 
valid, but the patch should probably include updated instructions in 5.4 to 
make it more clear.

--

___
Python tracker 

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



[issue14155] Deja vu in re's documentation

2012-02-29 Thread py.user

py.user  added the comment:

the multiline mode affects on regex.match()

>>> p = re.compile(r'^a')
>>> p.match('abc\nabc')
<_sre.SRE_Match object at 0xb749bf38>
>>> p.match('abc\nabc').span()
(0, 1)
>>> p.match('abc\nabc', 4)
>>> 
>>> p = re.compile(r'^a', re.M)
>>> p.match('abc\nabc', 4)
<_sre.SRE_Match object at 0xb749bf38>
>>> p.match('abc\nabc', 4).span()
(4, 5)
>>>

--

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2012-02-29 Thread Nick Coghlan

Nick Coghlan  added the comment:

For 3.2, there's no removal to document - we asked MvL to drop the buffer APIs 
from PEP 384, so they've never been part of the stable ABI.

>From the PEP: "The buffer interface (type Py_buffer, type slots bf_getbuffer 
>and bf_releasebuffer, etc) has been omitted from the ABI, since the stability 
>of the Py_buffer structure is not clear at this time. Inclusion in the ABI can 
>be considered in future releases."

I agree we shouldn't be hasty in making even the updated buffer interface 
implementation officially part of the stable ABI. Better to leave it out for 
3.3, get some real world feedback on the latest version, then commit to 
stability for 3.4+.

--

___
Python tracker 

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



[issue12659] Add tests for packaging.tests.support

2012-02-29 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

> Patch looks good, thanks!  BTW are you running a coverage tool to see > how 
> far along we are?

Yes, always. The classes tested in that patch are at 100%.

The overall coverage is:

Name  Stmts   Miss  Cover   Missing
---
Lib/packaging/tests/support 173 3480%   296-301, 306-310, 334-337, 
341-347, 371-390, 395-396

--

___
Python tracker 

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



[issue12659] Add tests for packaging.tests.support

2012-02-29 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

Patch updated.

BTW, I didn't get any email due the review that Éric did (does one has to be 
registered? I've done that now).

--
Added file: http://bugs.python.org/file24689/issue12659_434cd2fedf81.patch

___
Python tracker 

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



[issue6784] byte/unicode pickle incompatibilities between python2 and python3

2012-02-29 Thread Merlijn van Deen

Merlijn van Deen  added the comment:

Added tests in Lib/test format.

After applying pickle.py.patch and BytestrPickler_c.diff, 
./python -m test -v -m PyPicklerBytestrTests test_pickle
returns 12 tests, no errors, while 
./python -m test -v -m CPicklerBytestrTests test_pickle
only passes
test_dump_bytes_protocol_0 (test.test_pickle.CPicklerBytestrTests) ... ok
test_dump_bytes_protocol_1 (test.test_pickle.CPicklerBytestrTests) ... ok
test_dump_bytes_protocol_2 (test.test_pickle.CPicklerBytestrTests) ... ok
test_dump_bytes_protocol_3 (test.test_pickle.CPicklerBytestrTests) ... ok

and has 8 errors (as expected).

--
Added file: http://bugs.python.org/file24688/test_pickle.diff

___
Python tracker 

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



[issue14158] test_mailbox fails if file or dir named by support.TESTFN exists

2012-02-29 Thread Vinay Sajip

Changes by Vinay Sajip :


Added file: http://bugs.python.org/file24687/b0da15d31aec.diff

___
Python tracker 

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



[issue14158] test_mailbox fails if file or dir named by support.TESTFN exists

2012-02-29 Thread Vinay Sajip

Changes by Vinay Sajip :


--
hgrepos: +115

___
Python tracker 

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



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

2012-02-29 Thread Shawn

Shawn  added the comment:

I'm an idiot; nevermind my comment.  The original date was bogus.

--

___
Python tracker 

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



[issue11379] Remove "lightweight" from minidom description

2012-02-29 Thread Eli Bendersky

Eli Bendersky  added the comment:

I'm attaching a patch for Doc/library/xml.dom.minidom.rst 

It adds the note as phrased by Stefan, with a tiny wording change to make the 
first sentence less ambiguous.

--
keywords: +patch
Added file: http://bugs.python.org/file24686/issue_11379.1.patch

___
Python tracker 

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



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

2012-02-29 Thread Shawn

Shawn  added the comment:

I'm seeing this when a year *is* specified with Python 2.6 and 2.7:


import time
time.strptime("20090229T184823Z", "%Y%m%dT%H%M%SZ")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
return _strptime(data_string, format)[0]
  File "/usr/lib/python2.6/_strptime.py", line 440, in _strptime
datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month


import datetime
datetime.datetime.strptime("20090229T184823Z", "%Y%m%dT%H%M%SZ")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/_strptime.py", line 440, in _strptime
datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month

--
nosy: +swalker

___
Python tracker 

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



[issue14153] Expose os.device_encoding() at the C level

2012-02-29 Thread Brett Cannon

Brett Cannon  added the comment:

OK, so if on windows or isatty + nl_langinfo + CODESET, check fd 0 for a 
returned string that codecs.lookup and find something for. fd 42 (if not a tty) 
should return None.

--

___
Python tracker 

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



[issue14153] Expose os.device_encoding() at the C level

2012-02-29 Thread STINNER Victor

STINNER Victor  added the comment:

> For fd 0, it should be a string if the fd is a tty.

os.device_encoding() returns None on a non-Windows OS without langinfo support.

locale.nl_langinfo(locale.CODESET) may be used in such test. (to check
for nl_langinfo() support?)

--

___
Python tracker 

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



[issue14162] Implementation of the PEP 416 (Add a builtin frozendict type)

2012-02-29 Thread STINNER Victor

STINNER Victor  added the comment:

There is no documentation update yet.

--

___
Python tracker 

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



[issue14162] Implementation of the PEP 416 (Add a builtin frozendict type)

2012-02-29 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file24685/frozendict.patch

___
Python tracker 

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



[issue14161] python2 file __repr__ does not escape filename

2012-02-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components: +Interpreter Core
nosy: +eric.araujo, ezio.melotti, pitrou
stage:  -> needs patch
versions:  -Python 2.6

___
Python tracker 

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



[issue14162] Implementation of the PEP 416 (Add a builtin frozendict type)

2012-02-29 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file24684/frozendict.patch

___
Python tracker 

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



[issue14162] Implementation of the PEP 416 (Add a builtin frozendict type)

2012-02-29 Thread STINNER Victor

New submission from STINNER Victor :

Patch to implement the PEP 416.

--
components: Interpreter Core
files: frozendict.patch
keywords: patch
messages: 154655
nosy: haypo
priority: normal
severity: normal
status: open
title: Implementation of the PEP 416 (Add a builtin frozendict type)
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file24684/frozendict.patch

___
Python tracker 

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



[issue14153] Expose os.device_encoding() at the C level

2012-02-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> As for a test, I will happily write one, but what can I test? A string
> for fd 0 and None for fd -1 (or is there some os call I can make to
> find the largest fd so I can test fd+1)?

For fd 0, it should be a string if the fd is a tty.
(it should also point to a valid codec)
You can also try fd 42 (same, call isatty() on it).

--

___
Python tracker 

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



[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2012-02-29 Thread Matthew Barnett

Matthew Barnett  added the comment:

Ideally, it should raise an exception (or a warning) because the behaviour is 
unexpected.

--

___
Python tracker 

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



[issue14153] Expose os.device_encoding() at the C level

2012-02-29 Thread Brett Cannon

Brett Cannon  added the comment:

Victor's point fixed my issue.

As for a test, I will happily write one, but what can I test? A string for fd 0 
and None for fd -1 (or is there some os call I can make to find the largest fd 
so I can test fd+1)?

--

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2012-02-29 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9d3c7dd55c7f by Stefan Krah in branch 'default':
Issue #10181: Add warning that structure layouts in memoryobject.h and
http://hg.python.org/cpython/rev/9d3c7dd55c7f

--

___
Python tracker 

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



[issue4080] pyunit - display time of each test case - patch

2012-02-29 Thread Piotr Dobrogost

Piotr Dobrogost  added the comment:

@Michael Foord

> I am in the process of creating an extension mechanism for unittest
> which will make adding this sort of use case to unittest much easier

How is it going?

--
nosy: +piotr.dobrogost

___
Python tracker 

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



[issue14161] python2 file __repr__ does not escape filename

2012-02-29 Thread Ronny Pfannschmidt

New submission from Ronny Pfannschmidt :

behaviour:
>>> name = 'woo\raa'
>>> open(name, 'w')
aa', mode 'w' at 0x295a8a0>

expected:
>>> name = 'woo\raa'
>>> open(name, 'w')


note:
don't ask why i tried this chunk of code in the first place

--
messages: 154649
nosy: Ronny.Pfannschmidt
priority: normal
severity: normal
status: open
title: python2 file __repr__ does not escape filename
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue14159] __len__ method of weakset

2012-02-29 Thread Yury Selivanov

Yury Selivanov  added the comment:

Yes, I couldn't reproduce it either.  However it frequently occurs on our 
buildbot, so tomorrow I'll give you an update if this patch resolves the issue 
or not.

In any way, your patch fixes the current implementation at least from the 
performance perspective.  I think it should be applied to 
'WeakValueDictionary.__len__' as well.

Thanks!

--

___
Python tracker 

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



[issue14159] __len__ method of weakset

2012-02-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

New patch addressing similar issue with weak dicts, and adding more tests.

--
Added file: http://bugs.python.org/file24683/weaksetlen2.patch

___
Python tracker 

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



[issue11379] Remove "lightweight" from minidom description

2012-02-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

The wording in msg152836 is fine with me, in particular as it doesn't make any 
performance claims.

--

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-29 Thread Mark Shannon

Mark Shannon  added the comment:

Jim Jewett wrote:
> Jim Jewett  added the comment:
> 
> As of Feb 28, 2012, the PEP mentions an additional optimization of storing 
> the values in an array indexed by (effectively) key insertion order, rather 
> than key position. ("Alternative Implementation")
> 
> It states that this would reduce memory usage for the values array by 1/3.  
> 1/3 is a worst-case measurement; average is 1/2.  (At savings of less than 
> 1/3, the keys would resize, to initial savings of 2/3.  And yes, that means 
> in practice, the average savings would be greater than half, because the 
> frequency of dicts of size N decreases with N.)
> 

I presume you mean to allocate a values array of size == actual keys
rather than size == usable keys.

Making the  values array smaller than the the number of usable keys
causes a number of issues:

1. The values_size will need to be kept in the dict, not in the keys, 
which would make the dict larger for size 3 or 5, the same size for
size 2 or 4, but it would save memory for sizes 6-8 (see below).
So it might not save memory at all, it depends on the distribution of 
the sizes of shared-key dicts.
2. dk_usable would need to be reverted to dk_fill (c.f ma_fill) in order
to quickly allocate values arrays. This would slow down the resizing 
check, which is now done before insertion, so might be slower.
(not really a problem, but it might slow down inserts)
3. An extra check needs to be performed for each read to ensure the 
index is in-bounds
(again not really a problem, but it might slow down reads)

Comparative sizes of values array (including size field):

Items ProposedAlternativeOther AlternativeDelta
(size == usuable) (size == keys (+1))
   1  4   3 2  -1   
   2  4   3 3   0
   3  4   3 4  +1
   4  8   5 5   0
   5  8   5 6  +1
   6 16  10 7  -3
   7 16  10 8  -2
   8 16  10 9  -1
   9 16  1010   0
  10 16  1011  +1
  12 32  2113  -8
  14 32  2115  -6

The memory savings of the two alternative implementations are broadly
similar.

Clearly, either of the alternatives are attractive in terms of memory 
use. I think it is definitely worth investigating further, but I would 
like to get the proposed implementation into CPython first.

> It states that the keys table would need an additional "values_size" field, 
> but in the absence of dummies, this is just ma_used.

values_size != ma_used
values_size is the size of the values array, not the number of values.

Don't forget deletions or the case where items are inserted in a 
different order from that of another dict sharing the same keys.
Although there are no dummies, (key != NULL, value == NULL) is a legal
pair representing a missing or deleted value.

Cheers,
Mark.

--

___
Python tracker 

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



[issue14159] __len__ method of weakset

2012-02-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I can't find a way to reproduce as a unit test.
Here is a patch making __len__ O(1) as well (instead of O(n)). Could you try it?

(note : AFAICT, a similar issue exists for weak dicts)

--
stage:  -> needs patch
versions: +Python 2.7
Added file: http://bugs.python.org/file24682/weaksetlen.patch

___
Python tracker 

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



[issue14160] Tarfile.extractfile fails to extract targets of top-level relative symlinks

2012-02-29 Thread Matthew Miller

New submission from Matthew Miller :

I have a tarfile with relative paths. The tail of tar tvf looks like this:

-rw-r--r-T nobody/nobody  1356 2012-02-28 19:25 s/772
-rw-r--r-- nobody/nobody  1304 2012-02-28 19:25 s/773
-rw-r--r-- nobody/nobody  1304 2012-02-28 19:25 s/774
-rw-r--r-- nobody/nobody  1304 2012-02-28 19:25 s/775
lrw-r--r-- nobody/nobody 0 2012-02-28 19:25 final -> s/772

The docs say:

  TarFile.extractfile(member)

Extract a member from the archive as a file object. member 
may be a filename or a TarInfo object. If member is a regular
file, a file-like object is returned. If member is a link, a 
file-like object is constructed from the link’s target.

However, what I'm getting is this:

  KeyError: "linkname '/s/772' not found"


It's appending a "/". Why?

Well, in tarfile.py:

if tarinfo.issym():
# Always search the entire archive.
linkname = os.path.dirname(tarinfo.name) + "/" + tarinfo.linkname
limit = None


Here,  os.path.dirname(tarinfo.name) returns '', and then the "/" is appended, 
giving an incorrect result.

One solution would be:

   linkname = os.path.join(os.path.dirname(tarinfo.name),tarinfo.linkname)

but I don't think that works on platforms where os.sep is not "/", since tar 
will want "/" in any case. But that's the correct logic.

I'm filing this against 2.7, but the same issue exists in 3.2.

A work-around in end-user code is to call Tarfile.getmember(filename), check if 
the result issym(), and replace the result with 
Tarfile.getmember(tarinfo.linkname). But since the extractfile function is 
documented as following symlinks, that should not be necessary.

This bug isn't commonly encountered because by convention tarfiles usually 
contain a subdirectory and everything goes in that. But we should do the right 
thing.

--
components: Library (Lib)
messages: 154643
nosy: Matthew.Miller
priority: normal
severity: normal
status: open
title: Tarfile.extractfile fails to extract targets of top-level relative 
symlinks
versions: Python 2.7

___
Python tracker 

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



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

2012-02-29 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

This strikes me as an implementation artifact.  There is no reason for 
time.strptime() to validate date triplets.  Applications that require valid 
dates can use datetime.strptime().  I suggest changing time.strptime() 
specification to match POSIX strptime().  My understanding is that POSIX only 
requires field by field range checking (%d range 01 to 31, %m range 01 to 12) 
and not full structure validation.  This would be consistent with the way leap 
seconds are currently treated:

>>> time.strptime('60', '%S')[5]
60

--
assignee:  -> belopolsky
stage:  -> needs patch
type: behavior -> enhancement

___
Python tracker 

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



[issue14153] Expose os.device_encoding() at the C level

2012-02-29 Thread STINNER Victor

STINNER Victor  added the comment:

> your patch is buggy

It should be a missing #include. Maybe this one:

#ifdef HAVE_LANGINFO_H
#include 
#endif

--

___
Python tracker 

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2012-02-29 Thread Steven Bethard

Steven Bethard  added the comment:

Yes, the problem is in FileType.__call__ - the handling of '-' is pretty 
simplistic. Patches welcome.

--

___
Python tracker 

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



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2012-02-29 Thread Steven Bethard

Steven Bethard  added the comment:

> making Namespace subscriptable

This has been discussed before - see issue 11076. I prefer to keep Namespace as 
simple as possible. For subscripting, just use the standard Python idiom of 
vars as suggested in the docs:

http://docs.python.org/library/argparse.html#the-namespace-object

--

___
Python tracker 

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



[issue14153] Expose os.device_encoding() at the C level

2012-02-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I don't seen any refcounting problem here, but your patch is buggy.
Before patch:

>>> os.device_encoding(0)
'UTF-8'

After patch:

>>> os.device_encoding(0) is None
True

Interestingly, it seems there is no test for os.device_encoding. Perhaps add 
one to test_os?

--

___
Python tracker 

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



[issue13903] New shared-keys dictionary implementation

2012-02-29 Thread Jim Jewett

Jim Jewett  added the comment:

As of Feb 28, 2012, the PEP mentions an additional optimization of storing the 
values in an array indexed by (effectively) key insertion order, rather than 
key position. ("Alternative Implementation")

It states that this would reduce memory usage for the values array by 1/3.  1/3 
is a worst-case measurement; average is 1/2.  (At savings of less than 1/3, the 
keys would resize, to initial savings of 2/3.  And yes, that means in practice, 
the average savings would be greater than half, because the frequency of dicts 
of size N decreases with N.)

It states that the keys table would need an additional "values_size" field, but 
in the absence of dummies, this is just ma_used.

Note that this would also simplify resizing, as the values arrays would not 
have to be re-ordered, and would not have to be modified at all unless/until 
that particular instance received a value for a position beyond its current 
size.

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue14159] __len__ method of weakset

2012-02-29 Thread Yury Selivanov

New submission from Yury Selivanov :

WeakSet has a bug in its '__len__' method, where it performs iteration though 
'self.data' without ensuring _IterationGuard.

This leads to some hard to catch errors with the following traceback:


  builtins.RuntimeError: Set changed size during iteration

File /usr/lib64/python3.2/_weakrefset.py, line 66, in __len__
return sum(x() is not None for x in self.data)
File /usr/lib64/python3.2/_weakrefset.py, line 66, in 
return sum(x() is not None for x in self.data)

--
components: Library (Lib)
files: weakset_len.patch
keywords: patch
messages: 154636
nosy: Yury.Selivanov, pitrou, rhettinger
priority: normal
severity: normal
status: open
title: __len__ method of weakset
type: crash
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24681/weakset_len.patch

___
Python tracker 

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



[issue14158] test_mailbox fails if file or dir named by support.TESTFN exists

2012-02-29 Thread Vinay Sajip

Vinay Sajip  added the comment:

> You should find which test left the file and fix that test instead.

Ideally yes, but it's easier said than done. When the failure occurred, there 
were many failures, and I couldn't locate the place where the file was being 
left behind. It was a while ago - I was remiss in not logging the issue then, 
but real life intervened :-(

--

___
Python tracker 

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



[issue14153] Expose os.device_encoding() at the C level

2012-02-29 Thread Brett Cannon

Brett Cannon  added the comment:

Attached is a patch which is trying to do the refactor, but I'm somehow causing 
a something to be gc'ed when it shouldn't. If anyone spots something obvious 
let me know, else I will try to debug some more on my way home.

--
keywords: +patch
Added file: http://bugs.python.org/file24680/crashing_device_encoding.diff

___
Python tracker 

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



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

2012-02-29 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +belopolsky, haypo, hynek
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue14158] test_mailbox fails if file or dir named by support.TESTFN exists

2012-02-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> test_mailbox fails if another failed test leaves a file or directory
> with the name given by support.TESTFN. The attached patch rectifies this

You should find which test left the file and fix that test instead.

--
nosy: +pitrou

___
Python tracker 

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



[issue14158] test_mailbox fails if file or dir named by support.TESTFN exists

2012-02-29 Thread R. David Murray

R. David Murray  added the comment:

Why not just call the helper in setUp?  Otherwise, it looks good to me.

This is a bug fix and should be backported, I believe.

--
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue13785] Make concurrent.futures.Future state public

2012-02-29 Thread Juan Javier

Juan Javier  added the comment:

The use case is to know the state of a future without having to do something 
like this

@property
def state(self):
if self.future.running():
return Process.States.Running
elif self.future.cancelled():
return Process.States.Cancelled
elif self.future.done():
return Process.States.Done
return Process.States.Pending

--

___
Python tracker 

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



[issue14158] test_mailbox fails if file or dir named by support.TESTFN exists

2012-02-29 Thread Vinay Sajip

Changes by Vinay Sajip :


--
type:  -> behavior

___
Python tracker 

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



[issue14158] test_mailbox fails if file or dir named by support.TESTFN exists

2012-02-29 Thread Vinay Sajip

New submission from Vinay Sajip :

test_mailbox fails if another failed test leaves a file or directory with the 
name given by support.TESTFN. The attached patch rectifies this, and also uses 
existing stdlib functionality (shutil.rmtree) to remove a directory tree 
recursively on tearDown.

--
components: Library (Lib)
files: test_mailbox.diff
keywords: patch
messages: 154630
nosy: petri.lehtinen, r.david.murray, vinay.sajip
priority: normal
severity: normal
status: open
title: test_mailbox fails if file or dir named by support.TESTFN exists
versions: Python 3.3
Added file: http://bugs.python.org/file24679/test_mailbox.diff

___
Python tracker 

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



[issue14152] setup.py: Python header file dependencies

2012-02-29 Thread Éric Araujo

Changes by Éric Araujo :


--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue14152] setup.py: Python header file dependencies

2012-02-29 Thread Stefan Krah

Stefan Krah  added the comment:

??ric Araujo  wrote:
> > To answer your question: Neither of the last two revisions builds
> > in an out-of-source directory.
> My question was more whether the last known good revision did :)

That's what I meant. "last two revisions" was intended to refer to
the last two entries in the list. But I see the ambiguity.  :)

Thanks for reviewing!

--

___
Python tracker 

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



[issue14152] setup.py: Python header file dependencies

2012-02-29 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1c77eadba9dc by Stefan Krah in branch '3.2':
Issue #14152: Restore the Include/*.h dependencies for extension builds.
http://hg.python.org/cpython/rev/1c77eadba9dc

New changeset c85812b0e97d by Stefan Krah in branch 'default':
Issue #14152: Merge fix from 3.2.
http://hg.python.org/cpython/rev/c85812b0e97d

New changeset 3e2c230f4664 by Stefan Krah in branch '2.7':
Issue #14152: backport fix.
http://hg.python.org/cpython/rev/3e2c230f4664

--
nosy: +python-dev

___
Python tracker 

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



[issue12640] test_ctypes seg fault (test_callback_register_double); armv7; gcc 4.5.1

2012-02-29 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

___
Python tracker 

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



[issue9845] Allow changing the method in urllib.request.Request

2012-02-29 Thread Éric Araujo

Éric Araujo  added the comment:

Python 3.3 supports this.

--
resolution:  -> duplicate
stage: patch review -> committed/rejected
status: open -> closed
superseder:  -> urllib2 requests history + HEAD support
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue11379] Remove "lightweight" from minidom description

2012-02-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> needs patch

___
Python tracker 

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



[issue13998] Lookbehind assertions go behind the start position for the match

2012-02-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

IMHO the documentation is fine as is.  Using pos in combination with 
lookarounds that match on the beginning/end of the "slice" seems a rather 
uncommon corner case, and I don't think it's worth documenting it.  Even if it 
was documented, as a user, I would just try it from the interpreter anyway, 
rather than checking the docs for some prose to decipher.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
resolution:  -> wont fix
stage:  -> committed/rejected
status: open -> closed
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue9041] raised exception is misleading

2012-02-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +needs review

___
Python tracker 

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



[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2012-02-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

Matthew, do you think this should be documented somewhere or that the behavior 
should be changed (e.g. raising a warning when 65535 is used)?
If not I'll just close the issue.

--

___
Python tracker 

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



[issue13394] Patch to increase aifc lib test coverage

2012-02-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

Converting prints to warnings on 3.2 might not be a good idea.  I can probably 
still apply the rest of the patch there, and change the warnings on 3.3 only.

--

___
Python tracker 

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



[issue14089] Patch to increase fractions lib test coverage

2012-02-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed, thanks for the patch!

--
assignee:  -> ezio.melotti
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
type: behavior -> enhancement

___
Python tracker 

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



[issue14089] Patch to increase fractions lib test coverage

2012-02-29 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8e00de3acb44 by Ezio Melotti in branch '2.7':
#14089: increase coverage of the fractions module.  Patch by Oleg Plakhotnyuk.
http://hg.python.org/cpython/rev/8e00de3acb44

New changeset 0bbc2549e1ee by Ezio Melotti in branch '3.2':
#14089: increase coverage of the fractions module.  Patch by Oleg Plakhotnyuk.
http://hg.python.org/cpython/rev/0bbc2549e1ee

New changeset 90f459e986c8 by Ezio Melotti in branch 'default':
#14089: merge with 3.2.
http://hg.python.org/cpython/rev/90f459e986c8

--
nosy: +python-dev

___
Python tracker 

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



[issue14150] AIX, crash loading shared module into another process than python like operator.so results in 0509-130

2012-02-29 Thread Jan Stürtz

Jan Stürtz  added the comment:

Created a patch to fix the configure script, to get the "right" python.exp File.

--
keywords: +patch
Added file: http://bugs.python.org/file24678/Python-2.7.2-configure.aix.patch

___
Python tracker 

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



[issue8170] Wrong Paths for distutils build --plat-name=win-amd64

2012-02-29 Thread Robin Becker

Robin Becker  added the comment:

That would be a solution if we had a separate 64 bit machine & extra versions 
of Visual Studio, but the actual bug is with the cross-compiling behaviour. If 
it's not supposed to work then this isn't a bug and section 5.4 should go; 
otherwise  the correct way to do this should be better documented and made to 
work.

--

___
Python tracker 

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



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

2012-02-29 Thread Martin Morrison

New submission from Martin Morrison :

time.strptime without a year fails on Feb 29 with:

>>> time.strptime("Feb 29", "%b %d")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
return _strptime(data_string, format)[0]
  File "/usr/lib/python2.6/_strptime.py", line 440, in _strptime
datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month

This is due to the use of "1900" as the default year when parsing. It would be 
nice to have an optional "defaults" keyword argument to the strptime function 
that can be used to override the defaults, thus allowing leap year dates to be 
parsed without specifying the date.

(Note: the code in question attempted to set the year *after* the parse so that 
ultimately there is a valid struct_time, but since the parse never succeeds, 
this can't work).

--
components: Library (Lib)
messages: 154621
nosy: Martin.Morrison
priority: normal
severity: normal
status: open
title: time.strptime without a year fails on Feb 29
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue14155] Deja vu in re's documentation

2012-02-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed.
I changed something, as suggested by Éric.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue14155] Deja vu in re's documentation

2012-02-29 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3958121a027f by Ezio Melotti in branch '2.7':
#14155: remove duplication about search vs match in re doc.
http://hg.python.org/cpython/rev/3958121a027f

New changeset 4114e816a71b by Ezio Melotti in branch '3.2':
#14155: remove duplication about search vs match in re doc.
http://hg.python.org/cpython/rev/4114e816a71b

New changeset 457c3c0cb0a0 by Ezio Melotti in branch 'default':
#14155: merge with 3.2.
http://hg.python.org/cpython/rev/457c3c0cb0a0

--
nosy: +python-dev

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2012-02-29 Thread Stefan Krah

Stefan Krah  added the comment:

I'm busy adding the C-API changes to the docs. Regarding the stable ABI:

The general mood was to *keep* the removal of the buffer interface
for some time, did I get that right?

In that case this removal (especially of the Py_buffer struct) should
be documented also for 3.2.

--
nosy: +loewis

___
Python tracker 

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



[issue14152] setup.py: Python header file dependencies

2012-02-29 Thread Éric Araujo

Éric Araujo  added the comment:

> To answer your question: Neither of the last two revisions builds
> in an out-of-source directory.
My question was more whether the last known good revision did :)

> Here's a patch.
Tested with Python built in the top-level dir and in another dir, works in both 
cases.  Please apply, but not to security-only branches.

--
versions:  -Python 3.1

___
Python tracker 

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2012-02-29 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +bethard, pitrou

___
Python tracker 

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



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2012-02-29 Thread Joseph Birr-Pixton

Joseph Birr-Pixton  added the comment:

> I don’t understand, can you rephrase?

Sorry, I mean making Namespace subscriptable.  eg:

>>> v = argparse.Namespace(abc = 123)
>>> v
Namespace(abc=123)
>>> v.abc
123
>>> v['abc']
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'Namespace' object is not subscriptable

> add_argument('foo_bar', metavar='foo-bar', ...)

This works. Thanks!

Cheers,
Joe

--

___
Python tracker 

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



[issue14155] Deja vu in re's documentation

2012-02-29 Thread Éric Araujo

Éric Araujo  added the comment:

Didn’t review all lines in detail but looks globally good.  I would not remove 
Fred’s name though, but move it to another section or the top-level of the file.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue14149] argparse: Document how to use argument names that are not Python identifiers

2012-02-29 Thread Éric Araujo

Changes by Éric Araujo :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
keywords: +easy
nosy: +docs@python
stage:  -> needs patch
title: argparse usage model requires argument names to be python identifiers -> 
argparse: Document how to use argument names that are not Python identifiers
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2012-02-29 Thread Matt Joiner

New submission from Matt Joiner :

If an argument of '-' is handled by argparse.FileType, it defaults to 
sys.stdin. However a mode of 'rb' is ignored, the returned file object does not 
work with raw bytes.

--
components: Library (Lib)
messages: 154612
nosy: anacrolix
priority: normal
severity: normal
status: open
title: argparse.FileType for '-' doesn't work for a mode of 'rb'
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue14152] setup.py: Python header file dependencies

2012-02-29 Thread Stefan Krah

Changes by Stefan Krah :


--
stage:  -> patch review
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue14152] setup.py: Python header file dependencies

2012-02-29 Thread Stefan Krah

Changes by Stefan Krah :


Removed file: http://bugs.python.org/file24673/arraymodule_deps.diff

___
Python tracker 

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



[issue14155] Deja vu in re's documentation

2012-02-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

Patch attached.

--
assignee: docs@python -> ezio.melotti
components: +Regular Expressions
keywords: +patch
nosy: +mrabarnett
stage:  -> patch review
Added file: http://bugs.python.org/file24677/issue14155.diff

___
Python tracker 

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



[issue14152] setup.py: Python header file dependencies

2012-02-29 Thread Stefan Krah

Stefan Krah  added the comment:

Here's a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file24676/issue14152.diff

___
Python tracker 

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



[issue14152] setup.py: Python header file dependencies

2012-02-29 Thread Stefan Krah

Stefan Krah  added the comment:

Dependency support added: 1be93dd179df

Last good version (all Include/*.h): 9705ef3fdb22

Current behavior (only pyconfig.h): fa69e891edf4


To answer your question: Neither of the last two revisions builds
in an out-of-source directory.

Raising the priority to high: The missing dependencies caused a
bug report on core-mentorship that was extremely time consuming
until I finally had the revelation that the submitter did not
run `make distclean` after `hg fetch` (which would not be necessary
with the dependencies in place).

--
keywords:  -patch
priority: normal -> high

___
Python tracker 

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



[issue10713] re module doesn't describe string boundaries for \b

2012-02-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed, thanks for the patch!

--
assignee: docs@python -> ezio.melotti
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue10713] re module doesn't describe string boundaries for \b

2012-02-29 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset fc89e09ca2fc by Ezio Melotti in branch '2.7':
#10713: Improve documentation for \b and \B and add a few tests.  Initial patch 
and tests by Martin Pool.
http://hg.python.org/cpython/rev/fc89e09ca2fc

New changeset cde7fa40b289 by Ezio Melotti in branch '3.2':
#10713: Improve documentation for \b and \B and add a few tests.  Initial patch 
and tests by Martin Pool.
http://hg.python.org/cpython/rev/cde7fa40b289

New changeset b78ca038e468 by Ezio Melotti in branch 'default':
#10713: merge with 3.2.
http://hg.python.org/cpython/rev/b78ca038e468

--
nosy: +python-dev

___
Python tracker 

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



[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat

2012-02-29 Thread Thomas Atkinson

Thomas Atkinson  added the comment:

This bug is happening in python 3.2 when trying to build pycrypto on Microsoft 
Windows 7

--
nosy: +Thomas.Atkinson
versions: +Python 3.2 -Python 2.7

___
Python tracker 

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



[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-02-29 Thread STINNER Victor

STINNER Victor  added the comment:

>> + f = open(self.procfile, 'r')
>>
>> 'rb' mode is enough here, no need of Unicode ;-)
>
> Why?

The parent process doesn't read the file content, only the child. The
parent only needs a file descriptor.

>> + self.mem_watchdog = subprocess.Popen(..., stdin=f)
>>
>> Can't you open the /proc/pid/stat file in the child process? It might be an 
>> issue with SELinux or Grsecurity, but I don't expect that our buildbot use 
>> such security patch.
>
> (...) I don't want it to read another
> process' /proc//statm (I know this would require an immediate
> recycling of the PID which is thus really unlikely, but hey).

Oh ok, this is a good reason. You may document such tricky justifications.

>> You should catch OSError here.
>
> Why? If we get an OSError, we can't do much except exiting anyway.

To not print a traceback if the parent dies.

--

___
Python tracker 

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



[issue14061] Misc fixes and cleanups in archiving code in shutil and test_shutil

2012-02-29 Thread Éric Araujo

Éric Araujo  added the comment:

test_shutil contains partial tests for the archiving functionality.  I plan to 
rewrite some tests so that for example you can see a skip message when bz2 is 
not available, instead of silent non-testing.  Also, the internal functions 
_make_tarfile and _make_zipfile are directly tested, but IMO it’d be better to 
only exercise make_archive.

--
title: Clean up archiving code in shutil -> Misc fixes and cleanups in 
archiving code in shutil and test_shutil

___
Python tracker 

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



[issue13086] Update howto/cporting.rst so it talks about Python 3 instead of 3.0

2012-02-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage: patch review -> committed/rejected

___
Python tracker 

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



[issue13053] Add Capsule migration documentation to "cporting"

2012-02-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage: needs patch -> committed/rejected
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue13968] Support recursive globs

2012-02-29 Thread Nick Coghlan

Nick Coghlan  added the comment:

FWIW, I've also come around to the point of view that it's worthwhile to 
provide stdlib support for the "**" convention (specifically due to the UI 
aspect that Michael mentions).

--

___
Python tracker 

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



[issue13405] Add DTrace probes

2012-02-29 Thread Philip Jenvey

Changes by Philip Jenvey :


--
nosy:  -pjenvey

___
Python tracker 

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



  1   2   >