[issue14649] doctest.DocTestSuite error misleading when module has no docstrings

2012-09-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I tried applying the latest patch (patch #6) to 3.2, merging to default, and 
then running all tests in default, and the tests seem to all pass for me (in 
both default and 3.2).  Also, the diff for the change in default after that 
process seems to be identical to the uploaded patch.

Is it possible that you applied the wrong patch at some point in the process?  
What test failure were you getting?

Can you try applying the patch as is to the default branch (i.e. without going 
through 3.2) and see if you still get test failures?

--

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



[issue15822] installed python may fail incorrectly trying to rebuild lib2to3 grammar pickles

2012-09-09 Thread Georg Brandl

Georg Brandl added the comment:

Picked to release clone as 411d500e56a1.

--
priority: release blocker - high

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



[issue15822] installed python may fail incorrectly trying to rebuild lib2to3 grammar pickles

2012-09-09 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
status: open - closed

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



[issue15886] Doc: same word iteration

2012-09-09 Thread Masato HASHIMOTO

New submission from Masato HASHIMOTO:

Same word (path_fd) is iterated in Doc/library/os.rst.

1858 This function can support :ref:`specifying a file descriptor
1859 path_fd`, :ref:`specifying a file descriptor path_fd` and :ref:`not
1860 following symlinks follow_symlinks`.

version: releasing/3.3.0 @ 78787:c5bc19ce4d2b

--
assignee: docs@python
components: Documentation
messages: 170081
nosy: docs@python, hashimo
priority: normal
severity: normal
status: open
title: Doc: same word iteration
versions: Python 3.3

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



[issue13992] Segfault in PyTrash_destroy_chain

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5aa1bc2f00ad by Antoine Pitrou in branch 'default':
Issue #13992: The trashcan mechanism is now thread-safe.  This eliminates
http://hg.python.org/cpython/rev/5aa1bc2f00ad

--

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



[issue14223] curses addch broken on Python3.3a1

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d6d632f254ee by Victor Stinner in branch 'default':
Close #14223: Fix window.addch(curses.ACS_HLINE)
http://hg.python.org/cpython/rev/d6d632f254ee

--

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



[issue10650] decimal.py: quantize(): excess digits with watchexp=0

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e4ca4edee8bd by Stefan Krah in branch 'default':
Closes #10650: Deprecate the watchexp parameter of Decimal.quantize().
http://hg.python.org/cpython/rev/e4ca4edee8bd

--

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



[issue15724] Add versionchanged to memoryview docs

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 144d649764cf by Stefan Krah in branch 'default':
Issue #15724: Add versionchanged tags to the memoryview documentation.
http://hg.python.org/cpython/rev/144d649764cf

--

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



[issue15781] test_threaded_import fails with -j4

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 85070f284fd2 by Antoine Pitrou in branch 'default':
Issue #15781: Fix two small race conditions in import's module locking.
http://hg.python.org/cpython/rev/85070f284fd2

--

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



[issue15340] OSError with import random when /dev/urandom doesn't exist (regression from 2.6)

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6a782496f90a by Antoine Pitrou in branch 'default':
Issue #15340: Fix importing the random module when /dev/urandom cannot be 
opened.
http://hg.python.org/cpython/rev/6a782496f90a

--

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



[issue15784] OSError.__str__() should distinguish between errno and winerror

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4e941113e4fa by Richard Oudkerk in branch 'default':
Issue #15784: Modify OSError.__str__() to better distinguish between
http://hg.python.org/cpython/rev/4e941113e4fa

--

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



[issue15822] installed python may fail incorrectly trying to rebuild lib2to3 grammar pickles

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 411d500e56a1 by Ned Deily in branch 'default':
Issue #15822: Fix installation of lib2to3 grammar pickles to ensure
http://hg.python.org/cpython/rev/411d500e56a1

--

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



[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 23377e88487b by Victor Stinner in branch 'default':
Issue #15785: Modify window.get_wch() API of the curses module: return a
http://hg.python.org/cpython/rev/23377e88487b

--

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



[issue15828] imp.load_module doesn't support C_EXTENSION type

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f6f59303146 by Nick Coghlan in branch 'default':
Issue #15828: Restore support for C extension modules in imp.load_module()
http://hg.python.org/cpython/rev/4f6f59303146

New changeset a4a9c5717204 by Brett Cannon in branch 'default':
Issue #15828: Don't try to close a file if imp.find_module() doesn't
http://hg.python.org/cpython/rev/a4a9c5717204

--

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



[issue15814] memoryview: equality-hash invariant

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7734eb2707a1 by Stefan Krah in branch 'default':
Issue #15814: Document planned restrictions for memoryview hashes in 3.3.1.
http://hg.python.org/cpython/rev/7734eb2707a1

New changeset 71f4d80400f2 by Stefan Krah in branch 'default':
Issue #15814: Documentation: disallow hashing of multi-dimensional memoryviews.
http://hg.python.org/cpython/rev/71f4d80400f2

New changeset 3ffd6ad93fe4 by Nick Coghlan in branch 'default':
Issue #15814: Add NEWS entry regarding intended memoryview hashing restrictions
http://hg.python.org/cpython/rev/3ffd6ad93fe4

New changeset 88a0792e8ba3 by Stefan Krah in branch 'default':
Issue #15814: Update whatsnew to the current state of hashing memoryviews.
http://hg.python.org/cpython/rev/88a0792e8ba3

--

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



[issue15885] @staticmethod __getattr__ doesn't work

2012-09-09 Thread Albert Zeyer

Albert Zeyer added the comment:

I don't quite understand. Shouldn't __getattr__ also work in old-style classes?

And the error itself ('staticmethod' object is not callable), shouldn't that be 
impossible?

--

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



[issue15887] urlencode should accept generators or two elements tuples

2012-09-09 Thread Simonas Kazlauskas

New submission from Simonas Kazlauskas:

``urllib.parse.urlencode([('i', i) for i in range(1000)])`` works, but 
``urlencode(('i', i) for i in range(1000))`` raises a ``TypeError: not a valid 
non-string sequence or mapping object``.

Allowing urlencode to accept generators would make life a bit easier.

--
components: Library (Lib)
messages: 170094
nosy: nagisa
priority: normal
severity: normal
status: open
title: urlencode should accept generators or two elements tuples
type: enhancement
versions: Python 3.2

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



[issue15886] os.stat() docs repeat specifying a file descriptor support

2012-09-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Here is where the typo was introduced:

http://hg.python.org/cpython/rev/c890cbad4748#l1.69

--
nosy: +cjerdonek
title: Doc: same word iteration - os.stat() docs repeat specifying a file 
descriptor support

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



[issue15122] Always rewrite single-file mailboxes in-place

2012-09-09 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Attaching a patch that changes all single-file mailboxes to be rewritten 
in-place instead of rewriting and renaming. The patch doesn't add an option, 
because IMO this should be the default behavior.

In addition to solving the locking problems, this makes it significantly faster 
and less disk space consuming to remove or replace messages in very large 
mailbox files, because the whole mailbox is not rewritten.

With this patch, the code now writes messages to a temporary file, starting 
from the first changed message to the end of the mailbox file. After this, the 
contents of the temporary file are copied back to the mailbox file and the 
mailbox file is truncated to the correct length.

Care is taken that the process can be restarted if a crash (e.g. 
KeyboardInterrupt) occurs before starting to copy the changes back to the 
mailbox file, by altering self._toc and self._pending at the right moment.

I'm not sure whether this would be a bug fix or a new feature. Suggestions?

--
keywords: +needs review, patch
stage:  - patch review
title: Add an option to always rewrite single-file mailboxes in-place. - 
Always rewrite single-file mailboxes in-place

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



[issue15122] Always rewrite single-file mailboxes in-place

2012-09-09 Thread Petri Lehtinen

Changes by Petri Lehtinen pe...@digip.org:


Added file: http://bugs.python.org/file27150/issue15122.patch

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



[issue15888] ipaddress HOWTO examples have some errors

2012-09-09 Thread Chris Jerdonek

New submission from Chris Jerdonek:

The ipaddress HOWTO seems to have some errors in its interactive doctest 
examples.  Below are the errors after running the doctests for it using the 
regrtest patch posted to issue 15629.  (This is the first doc file for which I 
have used the modified script to open an issue.)

The errors seem valid to me on casual inspection.

Note that you need to add an initial  import ipaddress at the beginning of 
the first doctest example to have these actually run.


--
File Doc/howto/ipaddress.rst, line 146, in ipaddress.rst
Failed example:
ipaddress.ip_network('2001:db8::1/96')
Exception raised:
Traceback (most recent call last):
  File Lib/doctest.py, line 1287, in __run
compileflags, 1), test.globs)
  File doctest ipaddress.rst[15], line 1, in module
ipaddress.ip_network('2001:db8::1/96')
  File Lib/ipaddress.py, line 79, in ip_network
return IPv6Network(address, strict)
  File Lib/ipaddress.py, line 2056, in __init__
raise ValueError('%s has host bits set' % self)
ValueError: 2001:db8::1/96 has host bits set
--
File Doc/howto/ipaddress.rst, line 181, in ipaddress.rst
Failed example:
net4.numhosts
Exception raised:
Traceback (most recent call last):
  File Lib/doctest.py, line 1287, in __run
compileflags, 1), test.globs)
  File doctest ipaddress.rst[25], line 1, in module
net4.numhosts
AttributeError: 'IPv4Network' object has no attribute 'numhosts'
--
File Doc/howto/ipaddress.rst, line 184, in ipaddress.rst
Failed example:
net6.numhosts
Exception raised:
Traceback (most recent call last):
  File Lib/doctest.py, line 1287, in __run
compileflags, 1), test.globs)
  File doctest ipaddress.rst[27], line 1, in module
net6.numhosts
AttributeError: 'IPv6Network' object has no attribute 'numhosts'
--
File Doc/howto/ipaddress.rst, line 190, in ipaddress.rst
Failed example:
for x in net4.hosts():
Exception raised:
Traceback (most recent call last):
  File Lib/doctest.py, line 1287, in __run
compileflags, 1), test.globs)
  File doctest ipaddress.rst[29], line 1
for x in net4.hosts():
 ^
SyntaxError: unexpected EOF while parsing
--
File Doc/howto/ipaddress.rst, line 219, in ipaddress.rst
Failed example:
addr6.exploded
Expected:
'2001:0db8::::::'
Got:
'2001:0db8::::::0001'
--
File Doc/howto/ipaddress.rst, line 221, in ipaddress.rst
Failed example:
addr6.compressed
Expected:
'2001:db8::'
Got:
'2001:db8::1'
--
File Doc/howto/ipaddress.rst, line 244, in ipaddress.rst
Failed example:
net6[1]
Expected:
IPv6Address('2001::1')
Got:
IPv6Address('2001:db8::1')
--
File Doc/howto/ipaddress.rst, line 246, in ipaddress.rst
Failed example:
net6[-1]
Expected:
IPv6Address('2001:::')
Got:
IPv6Address('2001:db8:::')

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 170097
nosy: cjerdonek, docs@python, ncoghlan, pmoody
priority: normal
severity: normal
stage: needs patch
status: open
title: ipaddress HOWTO examples have some errors
type: behavior
versions: Python 3.3

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



[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-09 Thread Roy Smith

Roy Smith added the comment:

We need to define the scope of what input strings will be accepted.  ISO-8601 
defines a lot of stuff which we may not wish to accept.

Do we want to accept both basic format (MMDD) and extended format 
(-MM-DD)?

Do we want to accept things like 1985-W15-5, which is (if I understand this 
correctly(), the 5th day of the 15th week of 1985 [section 4.1.4.2].

Do we want to accept [section 4.2.2.4], 23:20,8, which is 23 hours, 20 
minutes, 8 tenths of a minute.

I suspect most people who have been following the recent thread 
(https://groups.google.com/d/topic/comp.lang.python/Q2w4R89Nq1w/discussion) 
would say none of the above are needed.  All that's needed is if you have an 
existing datetime object, d1, you can do:

s = str(d1)
d2 = datetime.datetime(s)
assert d1 == d2

for all values of d1.

But, let's at least agree on that.  Or, in the alternative, agree on something 
else.  Then we know what we're shooting for.

--
nosy: +roysmith

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



[issue15889] regrtest --start option raises AttributeError in many scenarios

2012-09-09 Thread Chris Jerdonek

New submission from Chris Jerdonek:

The --start option to regrtest raises an AttributeError in many scenarios.  For 
example, these both raise an error:

$ ./python.exe -m test --start test_random
$ ./python.exe -m test --start test_random test_binascii test_random

Traceback (most recent call last):
  File .../Lib/runpy.py, line 160, in _run_module_as_main
__main__, fname, loader, pkg_name)
  File .../Lib/runpy.py, line 73, in _run_code
exec(code, run_globals)
  File .../Lib/test/__main__.py, line 13, in module
regrtest.main()
  File .../Lib/test/regrtest.py, line 562, in main
del tests[:tests.index(start)]
AttributeError: 'NoneType' object has no attribute 'index'

Patch attached.

--
components: Tests
files: issue-regrtest-start-1.patch
keywords: easy, patch
messages: 170099
nosy: cjerdonek, ezio.melotti, michael.foord, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: regrtest --start option raises AttributeError in many scenarios
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file27151/issue-regrtest-start-1.patch

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



[issue15889] regrtest --start option raises AttributeError in many scenarios

2012-09-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

This issue also affects 3.2 (but not 2.7; there is no --start option in 2.7).

--
versions: +Python 3.2

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



[issue15888] ipaddress HOWTO examples have some errors

2012-09-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

While we are here, the corresponding Python file also has a couple errors in 
one of its doctest examples.

File Lib/ipaddress.py, line 209, in ipaddress.summarize_address_range
Failed example:
summarize_address_range(IPv4Address('192.0.2.0'),
Exception raised:
Traceback (most recent call last):
  File Lib/doctest.py, line 1287, in __run
compileflags, 1), test.globs)
  File doctest ipaddress.summarize_address_range[0], line 1
summarize_address_range(IPv4Address('192.0.2.0'),
^
SyntaxError: unexpected EOF while parsing

--

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



[issue14649] doctest.DocTestSuite error misleading when module has no docstrings

2012-09-09 Thread R. David Murray

R. David Murray added the comment:

Ah, my mistake.  I forgot to do the hg add for the new files.

--

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



[issue15888] ipaddress doctest examples have some errors

2012-09-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

And also the main doc file Lib/ipaddress.rst (along with some formatting 
issues, and after adding needed imports):

File Doc/library/ipaddress.rst, line 115, in ipaddress.rst
Failed example:
ipaddress.IPv4Address(3221225985)
Expected:
IPv4Address('192.168.0.1')
Got:
IPv4Address('192.0.2.1')

--
title: ipaddress HOWTO examples have some errors - ipaddress doctest examples 
have some errors

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



[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

On Sep 9, 2012, at 8:15 AM, Roy Smith rep...@bugs.python.org wrote:

 We need to define the scope of what input strings will be accepted.

Since it is easier to widen the domain of acceptable arguments than to narrow 
it in the future, I would say let's start by accepting str(x) only where x is 
date, time, timezone or datetime. I would leave out timedelta for now because 
it's str(x) does not resemble ISO at all. 

Either that or full ISO 8601. Anything in between is just too hard to explain.

--

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



[issue15875] tarfile may not make @LongLink for non-ascii character

2012-09-09 Thread Lars Gustäbel

Lars Gustäbel added the comment:

I prepared a patch that fixes this issue and adds a few tests. Please try if it 
works for you.

--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file27152/issue15875.diff

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



[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Steven Willis

Steven Willis added the comment:

Here's a patch for 3.1

--
Added file: http://bugs.python.org/file27153/issue15676-3.1.patch

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



[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Steven Willis

Steven Willis added the comment:

Here's a patch for 3.2

--
Added file: http://bugs.python.org/file27154/issue15676-3.2.patch

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



[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Steven Willis

Steven Willis added the comment:

Here's a branch against the default branch in mercurial. I couldn't find a 
branch for 3.3 or 3.4.

--
Added file: http://bugs.python.org/file27155/issue15676-default.patch

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



[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-09 Thread Roy Smith

Roy Smith added the comment:

I see I mis-stated my example.  When I wrote:

s = str(d1)
d2 = datetime.datetime(s)
assert d1 == d2

what I really meant was:

s = d1.isoformat()
d2 = datetime.datetime(s)
assert d1 == d2

But, now I realize that while that is certainly an absolute lower bound, it's 
almost certainly not sufficient.  The most common use case I see on a daily 
basis is parsing strings that look like 2012-09-07T23:59:59+00:00.  This is 
also John Nagle's original use case from the cited mailing list thread:

 I want to parse standard ISO date/time strings such as
 2012-09-09T18:00:00-07:00

Datetime.isoformat() returns something that matches the beginning of that, but 
doesn't have the time zone offset.  And it's the offset that makes strptime() 
not usable as a soluation, because %z isn't portable.

If we don't satisfy the 2012-09-07T23:59:59+00:00 case, then we won't have 
really done anything useful.

--

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



[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Steven Willis

Changes by Steven Willis onlyn...@gmail.com:


--
versions: +Python 3.1

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



[issue14649] doctest.DocTestSuite error misleading when module has no docstrings

2012-09-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

What workflow/command are you using to apply and then merge the patch?  I 
didn't need to run hg add at any point to go from 3.2 to default, and run the 
tests, etc.

--

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



[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Charles-François Natali

Charles-François Natali added the comment:

Thanks for the patches.
Note that you don't have to provide a patch for each branch, it's usually the 
committer's job.

The patch looks good, but the test could be rewritten with assertRaisesRegex():
http://docs.python.org/dev/library/unittest.html#unittest.TestCase.assertRaisesRegex

--
nosy: +neologix

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



[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-09 Thread John Nagle

John Nagle added the comment:

For what parts of ISO 8601 to accept, there's a standard: RFC3339, Date and 
Time on the Internet: Timestamps.  See section 5.6:

   date-fullyear   = 4DIGIT
   date-month  = 2DIGIT  ; 01-12
   date-mday   = 2DIGIT  ; 01-28, 01-29, 01-30, 01-31 based on
 ; month/year
   time-hour   = 2DIGIT  ; 00-23
   time-minute = 2DIGIT  ; 00-59
   time-second = 2DIGIT  ; 00-58, 00-59, 00-60 based on leap second
 ; rules
   time-secfrac= . 1*DIGIT
   time-numoffset  = (+ / -) time-hour : time-minute
   time-offset = Z / time-numoffset

   partial-time= time-hour : time-minute : time-second
 [time-secfrac]
   full-date   = date-fullyear - date-month - date-mday
   full-time   = partial-time time-offset

   date-time   = full-date T full-time

   NOTE: Per [ABNF] and ISO8601, the T and Z characters in this
  syntax may alternatively be lower case t or z respectively.

  ISO 8601 defines date and time separated by T.
  Applications using this syntax may choose, for the sake of
  readability, to specify a full-date and full-time separated by
  (say) a space character.

That's straightforward, and can be expressed as a regular expression.

--

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



[issue15419] distutils: build_py_2to3 should use a separate build directory

2012-09-09 Thread Dániel Darabos

Dániel Darabos added the comment:

I've had the same issue. I was installing Pyglet. I first installed it under 
Python 2, then:

$ sudo python3 setup.py install
running install
running build
running build_py
running install_lib
[...]
creating 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pyglet/window/xlib
copying build/lib/pyglet/window/xlib/__init__.py - 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pyglet/window/xlib
byte-compiling 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pyglet/__init__.py
 to __init__.cpython-32.pyc
  File 
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pyglet/__init__.py,
 line 276
print '[%d] %s%s %s' % (thread, indent, name, location)
   ^
SyntaxError: invalid syntax


Deleting the 'build' directory from the Python 2 run fixed the problem and I 
could install the package under Python 3.

--
nosy: +darabos

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



[issue2716] Reimplement audioop because of copyright issues

2012-09-09 Thread Aaron

Aaron added the comment:

The license from 
http://sox.sourcearchive.com/documentation/12.17.7/g711_8c-source.html

/*
 * This source code is a product of Sun Microsystems, Inc. and is provided
 * for unrestricted use.  Users may copy or modify this source code without
 * charge.
 *
 * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING
 * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun source code is provided with no support and without any obligation on
 * the part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

That seems compatible with Python's licensing, no?  It seems like adding this 
license text to the file and also to the documentation in 
http://docs.python.org/license.html#licenses-and-acknowledgements-for-incorporated-software
 would make this a non-issue.  Assessment of the module's contents and whether 
it should be rewritten or removed seems like a separate issue.

I could write up a patch if people think that this would solve the problem.

--
nosy: +hac.man

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



[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

 I realize that while that is certainly an absolute lower bound,
 it's almost certainly not sufficient.  The most common use case
 I see on a daily basis is parsing strings that look like
 2012-09-07T23:59:59+00:00.

This is exactly what isoformat() of an aware datetime looks like:

 datetime.now(timezone.utc).isoformat()
'2012-09-09T16:09:46.165886+00:00'

str() is the same up to T replaced by space:

 print(datetime.now(timezone.utc))
2012-09-09 15:19:12.567692+00:00

--

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



[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

 For what parts of ISO 8601 to accept, there's a standard: RFC3339

This is almost indistinguishable from the idea of accepting .isoformat() and 
str() results.  From what I see the only difference is that 't' is accepted for 
date/time separator and 'z' is accepted as a timezone.

Let's start with this.

As an ultimate solution, I would like to see something like codec registry so 
that we can do things like datetime(.., format='rfc3339') or date(.., 
format='gnu') for GNU parse_datetime.  I think this will look more pythonic 
than strptime().  Of course, strptime format can also be accepted as the value 
for the format keyword.

--

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



[issue15888] ipaddress doctest examples have some errors

2012-09-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I will prepare a patch for these three files.

--

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



[issue14223] curses addch broken on Python3.3a1

2012-09-09 Thread Nicholas Cole

Nicholas Cole added the comment:

I've just tried the OS X build of 3.3rc2, and this has been fixed.  Thank you!

--

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



[issue15881] multiprocessing 'NoneType' object is not callable

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 27d410dd5431 by Alexander Belopolsky in branch '3.2':
Issue #15881: Fixed atexit hook in multiprocessing.
http://hg.python.org/cpython/rev/27d410dd5431

New changeset 08c680918ff8 by Alexander Belopolsky in branch 'default':
Issue #15881: Fixed atexit hook in multiprocessing.
http://hg.python.org/cpython/rev/08c680918ff8

--
nosy: +python-dev

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



[issue15881] multiprocessing 'NoneType' object is not callable

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset db67b848ddc3 by Alexander Belopolsky in branch '3.2':
Issue #15881: Fixed 3.2 backport.
http://hg.python.org/cpython/rev/db67b848ddc3

--

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



[issue15881] multiprocessing 'NoneType' object is not callable

2012-09-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Applied to 3.2 and 3.3.  Thanks for the patch!

Leaving it open pending 2.7 commit.

--
resolution:  - fixed
stage: commit review - committed/rejected

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



[issue15881] multiprocessing 'NoneType' object is not callable

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b05547e8ff92 by Alexander Belopolsky in branch '3.2':
Issue #15881: Added NEWS entry and proper credit.
http://hg.python.org/cpython/rev/b05547e8ff92

--

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



[issue14649] doctest.DocTestSuite error misleading when module has no docstrings

2012-09-09 Thread R. David Murray

R. David Murray added the comment:

I have separate working directories for 3.2 vs 3.3.  If you have a single 
working directory, the files would continue to be present even without the add. 
 The add is definitely needed for a correctly committed changeset.

--

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



[issue15890] lib2to3 pickles created with wrong permissions

2012-09-09 Thread Tomi Pieviläinen

New submission from Tomi Pieviläinen:

The fix of #15822 caused another break. After installing 3.3rc2 from source, ls 
-ltc --full-time /usr/local/lib/python3.3/lib2to3/ shows:

-rw---. 1 root root  1455 2012-09-09 20:55:36.475519602 +0300 
PatternGrammar3.3.0.candidate.2.pickle
-rw---. 1 root root 20862 2012-09-09 20:55:36.425520211 +0300 
Grammar3.3.0.candidate.2.pickle
drwx--. 2 root root  4096 2012-09-09 20:55:33.681520171 +0300 __pycache__/
drwxr-xr-x. 4 root root  4096 2012-09-09 20:55:30.087520195 +0300 tests/
drwxr-xr-x. 3 root root  4096 2012-09-09 20:55:30.063457702 +0300 pgen2/
drwxr-xr-x. 3 root root  4096 2012-09-09 20:55:30.028520614 +0300 fixes/
-rw-r--r--. 1 root root 28046 2012-09-09 20:55:09.319519773 +0300 refactor.py
-rw-r--r--. 1 root root 28386 2012-09-09 20:55:09.279456945 +0300 pytree.py
-rw-r--r--. 1 root root  1114 2012-09-09 20:55:09.242458183 +0300 pygram.py
-rw-r--r--. 1 root root   793 2012-09-09 20:55:09.205457004 +0300 
PatternGrammar.txt
-rw-r--r--. 1 root root  7075 2012-09-09 20:55:09.168457078 +0300 patcomp.py
-rw-r--r--. 1 root root 11624 2012-09-09 20:55:09.131457019 +0300 main.py
-rw-r--r--. 1 root root67 2012-09-09 20:55:09.091644598 +0300 __main__.py
-rw-r--r--. 1 root root 7 2012-09-09 20:55:09.052457036 +0300 __init__.py
-rw-r--r--. 1 root root  6589 2012-09-09 20:55:09.014519602 +0300 Grammar.txt
-rw-r--r--. 1 root root 14533 2012-09-09 20:55:08.977519642 +0300 fixer_util.py
-rw-r--r--. 1 root root  6706 2012-09-09 20:55:08.940519615 +0300 fixer_base.py
-rw-r--r--. 1 root root 10011 2012-09-09 20:55:08.903519608 +0300 btm_utils.py
-rw-r--r--. 1 root root  6833 2012-09-09 20:55:08.865457147 +0300 btm_matcher.py


The pickles are now correctly newer than the Grammar texts, but are readable 
only by root. Quick chmod fixes this, but has to be done manually on systems 
with strict UMASK for root.

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 170124
nosy: tpievila
priority: normal
severity: normal
status: open
title: lib2to3 pickles created with wrong permissions
versions: Python 3.3

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



[issue15890] lib2to3 pickles created with wrong permissions

2012-09-09 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I propose to postpone the fix for that to 3.3.1. Meanwhile, users should either 
set umask to 022 before installing, or chmod the files afterwards.

--
nosy: +loewis

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



[issue15891] A public facing API for __unittest = True

2012-09-09 Thread Julian Berman

New submission from Julian Berman:

Can `__unittest = True`, which is used to hide stack frames from tracebacks 
inside the testing framework, be documented as being public, or, if that's not 
acceptable, be replaced by something that is? `_exc_info_to_string` is a hairy 
function to need to rewrite when authoring a testing framework, but it's a 
rather common thing to want, and would be nice if it was easily done by 
integrating with what `TestCase` is already doing.

It's also (with or without formal blessing) being used in the wild in at least 
one place I know of here 
http://bazaar.launchpad.net/~testtools-committers/testtools/trunk/view/head:/testtools/testcase.py#L798
  and since it's not terribly critical and will fail rather nicely even if the 
API changes suddenly I'd bet other places are using it too, though I haven't 
bothered to check.

See also http://twistedmatrix.com/trac/ticket/4127  which would be easier to 
implement if this were acceptable to use for external code.

--
components: Library (Lib)
messages: 170126
nosy: Julian, michael.foord
priority: normal
severity: normal
status: open
title: A public facing API for __unittest = True
type: enhancement
versions: Python 3.3, Python 3.4

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



[issue15890] lib2to3 pickles created with wrong permissions

2012-09-09 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever, ned.deily
versions: +Python 2.7, Python 3.2

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



[issue15890] lib2to3 pickles created with wrong permissions

2012-09-09 Thread Ned Deily

Ned Deily added the comment:

AFAIK, the pickles are created with exactly the same permissions as the cached 
pyc and pyo files have been all along.  So, if you propose to change the 
permissions for the pickles, the compileall steps should be changed as well.

--

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



[issue15891] A public facing API for __unittest = True

2012-09-09 Thread R. David Murray

R. David Murray added the comment:

This is a duplicate of issue 1705520. Since Michael obviously hasn't gotten to 
it yet, a proposed patch might move things along.

--
nosy: +r.david.murray
stage:  - committed/rejected
status: open - closed
superseder:  - API for excluding methods from unittest stack traces

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



[issue15891] A public facing API for __unittest = True

2012-09-09 Thread Michael Foord

Michael Foord added the comment:

Whatever we do must be backwards compatible. The question is, is a better api 
that doesn't use stack frames (which is a hack in my opinion) even possible?

--

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



[issue1705520] API for excluding methods from unittest stack traces

2012-09-09 Thread R. David Murray

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


--
nosy: +Julian
stage: test needed - needs patch
versions: +Python 3.4 -Python 3.2

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



[issue15890] lib2to3 pickles created with wrong permissions

2012-09-09 Thread Ned Deily

Ned Deily added the comment:

BTW, AFAICT, you'll get exactly the same behavior (with distribute failing due 
to pickle write permission) with earlier releases, like 3.2.3, if you happen to 
do a make install with an inappropriate umask value.  So it appears that 
setting umask properly has been an existing, if perhaps undocumented, 
requirement.  Ensuring permissions for all installed files are set to sane 
values seems like a good idea, though.

--

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



[issue15890] lib2to3 pickles created with wrong permissions

2012-09-09 Thread R. David Murray

R. David Murray added the comment:

It occurs to me that ignoring the user's selected umask could be considered a 
bug by some people.  A package manager for a distribution should presumably 
ensure the correct umask during install, but if a user is doing a direct 
install, it seems reasonable to think they are responsible for setting the 
umask they want used.  There is a fuzzy line here, though, because distutils is 
also a bit of a package manager...

Regardless, though, Ned's observation seems to indicate this is not a 
regression.  Tomi, do you find a different behavior in 3.2?

--
nosy: +r.david.murray

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



[issue14223] curses addch broken on Python3.3a1

2012-09-09 Thread STINNER Victor

STINNER Victor added the comment:

 I've just tried the OS X build of 3.3rc2, and this has been fixed.  Thank you!

Great!

--

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



[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Steven Willis

Steven Willis added the comment:

Sorry, I thought that's what jcea was asking for. Here's an updated patch for 
the default branch in mercurial that uses assertRaisesRegex in the test.

--
Added file: http://bugs.python.org/file27156/issue15676-default.patch

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-09-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I was reminded of this issue by the following e-mail today:

http://mail.python.org/pipermail/python-dev/2012-September/121639.html

I updated the script I attached earlier to ensure that it can also be run 
against the names in 2.7 (attaching now as script #3).  I also checked that 
this latest script can still be run against 3.2 and default with the names that 
have been added since the last time I checked.

Let me know if you would like any assistance in how to run the script and what 
to check for, etc.

--
Added file: http://bugs.python.org/file27157/merge-acks-3.py

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



[issue15419] distutils: build_py_2to3 should use a separate build directory

2012-09-09 Thread Ned Deily

Ned Deily added the comment:

It seems to me this is just a special case of the more general issue of 
building multiple versions of the same distribution, say with multiple versions 
of Python 2.  In general, anytime you change your build environment, you should 
start with no existing build directory. That's just good practice.  Distutils 
doesn't keep track of every change you might make in a build environment 
between invocations of setup.py.  I suggest that this be closed as won't fix.

--
nosy: +ned.deily
versions:  -Python 3.1

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



[issue15851] Lib/robotparser.py doesn't accept setting a user agent string, instead it uses the default.

2012-09-09 Thread Eduardo A . Bustamante López

Eduardo A. Bustamante López added the comment:

I'm not sure what's the best approach here.

1. Avoid changes in the Lib, and document a work-around, which involves
   installing an opener with the specific User-agent. The draw-back is that it
   modifies the behaviour of urlopen() globally, so that change affects any
   other call to urllib.request.urlopen.

2. Revert to the old way, using an instance of a FancyURLopener (or URLopener),
   in the RobotFileParser class. This requires a modification of the Lib, but
   allows us to modify only the behaviour of that specific instance of
   RobotFileParser. The user could sub-class FancyURLopener, set the appropiate
   version string.

I attach a script, tested against the ``default`` branch of the mercurial
repository. It shows the work around for python3.3.

--
Added file: http://bugs.python.org/file27158/test.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15851
___import urllib.robotparser
import urllib.request
opener = urllib.request.build_opener()
opener.addheaders = [('User-agent', 'MyUa/0.1')]
urllib.request.install_opener(opener)
rp = urllib.robotparser.RobotFileParser('http://localhost:')
rp.read()
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15851] Lib/robotparser.py doesn't accept setting a user agent string, instead it uses the default.

2012-09-09 Thread Eduardo A . Bustamante López

Eduardo A. Bustamante López added the comment:

I forgot to mention that I ran a nc process in parallel, to see what data is
being sent: ``nc -l -p ``.

--

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



[issue15892] _PyImport_GetDynLoadFunc() doesn't check return value of fstat()

2012-09-09 Thread Christian Heimes

New submission from Christian Heimes:

The function _PyImport_GetDynLoadFunc() in Python/dynload_shlib.c doesn't check 
the return value of fstat()

CID 486250: Other violation (CHECKED_RETURN)At (3): Calling function 
fstat(fileno(fp), statb) without checking return value. This library 
function may fail and return an error code.
At (4): No check of the return value of fstat(fileno(fp), statb).
 93fstat(fileno(fp), statb);

Suggested fix:
if (fstat(fileno(fp), statb) == -1) {
PyErr_SetFromErrnoWithFilename(PyExc_IOError, pathname);
return NULL;
}
}

--
components: Interpreter Core
messages: 170138
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: _PyImport_GetDynLoadFunc() doesn't check return value of fstat()
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue15893] Py_FrozenMain() resource leak and missing malloc checks

2012-09-09 Thread Christian Heimes

New submission from Christian Heimes:

In Python/frozenmain.c the function Py_FrozenMain() doesn't handle argv_copy 
and argv_copy2 correctly. Both variables contain memory that is allocated with 
PyMem_Malloc(). argv_copy2 is never checked for NULL and both variables are not 
correctly cleaned up in error cases.

CID 486834: Resource leak (RESOURCE_LEAK)At (11): Variable argv_copy going 
out of scope leaks the storage it points to. 
CID 486835: Resource leak (RESOURCE_LEAK)At (9): Variable argv_copy2 going 
out of scope leaks the storage it points to.

Suggested fix:
Separate var declaration from PyMem_Malloc() calls and use a goto label to 
clean up the variables and its content at the end of the function.

--
components: Interpreter Core
messages: 170139
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Py_FrozenMain() resource leak and missing malloc checks
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

Having separate patches is useful if the patch can not be applied cleanly to 
different python branches. This is specially true with 2.7/3.x.

Checking the fix and committing it to 2.7, 3.2 and 3.3 (probably available in 
3.3.1, not 3.3.0, already in release candidate).

--

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



[issue15894] _PyImport_ReInitLock() doesn't check return value of PyThread_acquire_lock

2012-09-09 Thread Christian Heimes

New submission from Christian Heimes:

Coverity claims that the call to PyThread_acquire_lock with NOWAIT_LOCK can 
fail. It sounds plausible as you don't wait for the lock to succeed.

CID 486861: Unchecked return value (CHECKED_RETURN)At (3): Calling function 
PyThread_acquire_lock(PyThread_type_lock, int) without checking return value 
(as is done elsewhere 22 out of 23 times).
At (9): No check of the return value of PyThread_acquire_lock(import_lock, 0).
 205PyThread_acquire_lock(import_lock, 0);
 206/* XXX: can the previous line fail? */

By the way the code would be more readable with NOWAIT_LOCK instead of 0.

--
assignee: brett.cannon
components: Interpreter Core
messages: 170141
nosy: brett.cannon, christian.heimes
priority: normal
severity: normal
status: open
title: _PyImport_ReInitLock() doesn't check return value of 
PyThread_acquire_lock
type: behavior
versions: Python 3.2, Python 3.3

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



[issue15895] PyRun_SimpleFileExFlags() can leak a FILE pointer

2012-09-09 Thread Christian Heimes

New submission from Christian Heimes:

In Python/pythonrun.c PyRun_SimpleFileExFlags() may leak a FILE pointer if 
closeit is False and maybe_pyc_file returns true. This happens when the 
filename ends with .pyc or .pyc. In this case the file is opened a second 
time with fopen() a few lines lower and assigned to the same variable fp. 
However fp is never closed.

The bug was found by Coverity as CID 719689.

Georg: I've set the priority to release blocker as a resource leak of a file 
pointer and therefore rare file descriptor is IMHO a severe issue.

--
assignee: georg.brandl
files: closeown.patch
keywords: patch
messages: 170142
nosy: brett.cannon, christian.heimes, georg.brandl
priority: release blocker
severity: normal
stage: patch review
status: open
title: PyRun_SimpleFileExFlags() can leak a FILE pointer
type: resource usage
Added file: http://bugs.python.org/file27159/closeown.patch

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



[issue15890] lib2to3 pickles created with wrong permissions

2012-09-09 Thread Martin v . Löwis

Martin v. Löwis added the comment:

It appears that it is tradition of (BSD) install(1) to ignore umask. For 
consistency, all installed files should get the same ACL (+-x where necessary). 
So I think this behavior is a bug (although apparently not a regression).

--

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



[issue15896] Sporadic EINVAL in nonblocking pipe os.read when forked child fails on Mac OS

2012-09-09 Thread Vitaly

New submission from Vitaly:

Python 2.6.7 on Mac OS 10.7.4 running on MacBookPro laptop.


run attachment as: python test_pipe_error.py

The test() function makes multiple calls to _execute_child() in a loop. Every 
other call to _execute_child() fails with:
=
os.read(3, 1048576) self pid:  43953
EINVAL FROM TEST:  Traceback (most recent call last):
  File test_pipe_error.py, line 127, in test
_execute_child()
  File test_pipe_error.py, line 95, in _execute_child
newData = os.read(errpipe_read, rSize)
OSError: [Errno 22] Invalid argument
=

_execute_child() is based on subprocess.Popen._execute_child, but with most 
Popen code removed and errpipe_read configured as os.O_NONBLOCK in the parent 
process.  Raising of an Exception() instance is used to simulate failure in 
os.execvp() instead of calling os.execvp().

We initially experienced the EINVAL issue in the parent process' os.read call 
when os.execvp failed in the child (e.g., errno=2, file not found), so I 
stripped the code to bare minimum in order to reproduce the problem with a 
smaller code snippet.

--
components: Library (Lib)
files: test_pipe_error.py
messages: 170144
nosy: vitaly
priority: normal
severity: normal
status: open
title: Sporadic EINVAL in nonblocking pipe os.read when forked child fails on 
Mac OS
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file27160/test_pipe_error.py

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



[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d85f80b31b54 by Jesus Cea in branch '3.2':
Closes #15676: mmap: add empty file check prior to offset check
http://hg.python.org/cpython/rev/d85f80b31b54

New changeset f962ec8e47a1 by Jesus Cea in branch 'default':
Closes #15676: mmap: add empty file check prior to offset check
http://hg.python.org/cpython/rev/f962ec8e47a1

New changeset 27837a33790d by Jesus Cea in branch '2.7':
Closes #15676: mmap: add empty file check prior to offset check
http://hg.python.org/cpython/rev/27837a33790d

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue15897] zipimport.c doesn't check return value of fseek()

2012-09-09 Thread Christian Heimes

New submission from Christian Heimes:

The code im zipimport.c doesn't check the return value of fseek() in at least 
four places. The missing checks may hide issues with the file or file system.

Solution:
Check for -1 and return with an appropriate call to PyErr_SetFromErrno()

--
components: Extension Modules
keywords: easy
messages: 170146
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: zipimport.c doesn't check return value of fseek()
type: behavior
versions: Python 3.3, Python 3.4

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



[issue15870] PyType_FromSpec should take metaclass as an argument

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15898] OSX TTY bug

2012-09-09 Thread Andrew Moffat

New submission from Andrew Moffat:

I'm getting some kind of race condition on OSX when trying to read the output 
from a pseudoterminal of a forked process.  This race conditional only occurs 
if I run tty.tcsetattr on the master side of the pty, regardless of if I 
actually change the mode or not.

Try running the following code on OSX multiple times.  Sometimes you'll see 
testing, sometimes you won't, sometimes it hangs.  If you comment out 
tty.tcsetattr, you will consistently see testing.


import os
import pty
import resource
import signal
import tty


master, slave = pty.openpty()
pid = os.fork()


# BUG IS HERE
# we're not making any changes to the tty mode, but
# the mere act of setting a mode causes the output to only
# show up sometimes.
#
# comment out tty.tcsetattr and the bug goes away
mode = tty.tcgetattr(master)
tty.tcsetattr(master, tty.TCSANOW, mode)


# child process
if pid == 0:
os.setsid()
os.close(master)

os.dup2(slave, 0)
os.dup2(slave, 1)
os.dup2(slave, 2)

max_fd = resource.getrlimit(resource.RLIMIT_NOFILE)[0]
os.closerange(3, max_fd)

# make controlling terminal.  taken from pty.fork
tmp_fd = os.open(os.ttyname(1), os.O_RDWR)
os.close(tmp_fd)

os.write(1, testing.encode())

os._exit(255)

# parent process
else:
os.close(slave)

try:
print(os.read(master, 1024))

finally:
os.kill(pid, signal.SIGKILL)

--
messages: 170147
nosy: amoffat
priority: normal
severity: normal
status: open
title: OSX TTY bug
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

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



[issue15875] tarfile may not make @LongLink for non-ascii character

2012-09-09 Thread Manuke

Manuke added the comment:

I have tried your patch and it have worked completely for my test code.
The patch is efficient. Thank you for your speedy work.

--

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



[issue15719] Sort dict items in urlencode()

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15723] Python breaks OS' append guarantee on file writes

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15751] Support subinterpreters in the GIL state API

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15756] subprocess.poll() does not handle errno.ECHILD No child processes

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15883] Add Py_errno to work around multiple CRT issue

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15897] zipimport.c doesn't check return value of fseek()

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15895] PyRun_SimpleFileExFlags() can leak a FILE pointer

2012-09-09 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

LGTM.

Instead of using a flag variable, could you use something like if (fp!=NULL) 
fclose(fp);?

--
nosy: +jcea

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



[issue15894] _PyImport_ReInitLock() doesn't check return value of PyThread_acquire_lock

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15898] OSX TTY bug

2012-09-09 Thread Ned Deily

Ned Deily added the comment:

I have not been able to reproduce the behavior you report using various Pythons 
on OS X 10.8 or on OS X 10.5.  Can you give more specifics on the environment 
that fails for you?

I certainly don't claim to have any experience with these tty/pty modules or 
with the underlying system calls and I'm not sure what you are trying to do 
here but isn't it a bit risky to be calling tty.tcsetattr() from both the 
parent and child processes simultaneously, since the call is after the fork?  
tcsetattr is dealing with a job-wide data structure and, under the covers, the 
tcsetattr() function currently reads and writes various field non-atomically.  
What happens if you move the tcgetattr and tcsetattr to before the os.fork call 
or into the parent-only code after the else?

http://hg.python.org/cpython/file/default/Modules/termios.c

--
nosy: +ned.deily

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



[issue15893] Py_FrozenMain() resource leak and missing malloc checks

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15892] _PyImport_GetDynLoadFunc() doesn't check return value of fstat()

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15725] PyType_FromSpecWithBases bugfix

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15726] PyState_FindModule false length-comparison fix

2012-09-09 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

Antoine, you applied a patch, but market this issue as invalid. What that a 
mistake?. Should it be closed?.

--
nosy: +jcea

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



[issue15726] PyState_FindModule false length-comparison fix

2012-09-09 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

I meant fixed.

--

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



[issue15727] PyType_FromSpecWithBases tp_new bugfix

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15695] Correct __sizeof__ support for StgDict

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15696] Correct __sizeof__ support for mmap

2012-09-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15898] OSX TTY bug

2012-09-09 Thread Andrew Moffat

Andrew Moffat added the comment:

If I move tcsetattr into the parent, the race condition still exists.  If I 
move it into the child, before the write(), it works.

My environment is OSX 10.7.2 inside of Virtualbox (maybe this is the problem?)

I've shuffled some code around, and found case that fails consistently in 
python 3, but succeeds consistently on python 2.7.  It doesn't use tcsetattr at 
all, which is making me realize the problem may be deeper than I originally 
thought.  Are you able to confirm this, Ned?


import os
import pty
import resource
import signal
import tty
import time


master, slave = pty.openpty()
pid = os.fork()



# child process
if pid == 0:
os.setsid()
os.close(master)

os.dup2(slave, 0)
os.dup2(slave, 1)
os.dup2(slave, 2)

max_fd = resource.getrlimit(resource.RLIMIT_NOFILE)[0]
os.closerange(3, max_fd)

# make controlling terminal.  taken from pty.fork
tmp_fd = os.open(os.ttyname(1), os.O_RDWR)
os.close(tmp_fd)

os.write(1, testing.encode())

os._exit(255)

# parent process
else:
time.sleep(0.5)
os.close(slave)

try:
print(os.read(master, 1024))

finally:
os.kill(pid, signal.SIGKILL)

--

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



[issue15390] PEP 3121, 384 refactoring applied to datetime module

2012-09-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

For some reason there are no review links, so I'll review in this message.

Include/datetime.h

+typedef struct {
..
+} _datetimemodulestate;

Names exposed in public headers (datetime.h is a public header) should start 
with Py or _Py. Other offenders include _datetimemodule_state, _datetimemodule, 
_datetimemodulestate_global.

I don't think these names need to be defined in the header file at all.  

+typedef struct {
+/* Forward declarations. */
+PyObject *PyDateTime_DateType;
+PyObject *PyDateTime_DateTimeType;
...

These are not forward declarations anymore.  There is no need for PyDateTime_ 
prefix.  Use names from  PyDateTime_CAPI struct.

--

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



[issue15695] Correct __sizeof__ support for StgDict

2012-09-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

What is the point of providing a __sizeof__ method to a purely internal type?  
I don't think it is possible to expose StgDict at the python level.  It is 
always hidden behind a mapping proxy.  Furthemore, StgDict is only used inside 
type objects and the size of type objects is not relevant for __sizeof__ 
calculations.

--

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



[issue15725] PyType_FromSpecWithBases bugfix

2012-09-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Why is this a problem? ISTM all that is happening is that null tp_base is set 
to null if Py_tp_base slot is specified as null.  If this is somehow a problem 
- the user should not specify Py_tp_base slot.

--
nosy: +belopolsky

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



[issue15727] PyType_FromSpecWithBases tp_new bugfix

2012-09-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Can you give an example of the situation that you described?  Perhaps you 
encountered it while refactoring some particular extension module.  Which?

In your patch new code is commented out.

PySpec_New() is not a good name.  It should be something like 
PyObject_FailingNew().

--
nosy: +belopolsky

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



[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


--
assignee:  - belopolsky

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



  1   2   >