[issue14061] Clean up archiving code in shutil

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

I intend to commit this simple fix for all branches:

-_UNPACK_FORMATS['bztar'] = (['.bz2'], _unpack_tarfile, [],
+_UNPACK_FORMATS['bztar'] = (['.tar.bz2'], _unpack_tarfile, [],

I could write a unit test, but it would be coupled to the exact text of the 
exception* (i.e. with assertRaisesRegex) and IMO not very useful.  I tested 
manually: I compressed a text file with bzip2, passed the filename to 
unpack_archive, and it tried to unpack it with tarfile.  With my fix, it does 
not try to unpack it.


* unpack_archive raises ValueError when you give an unsupported value to its 
format
  parameter, but when it’s in autodetect mode and can’t find an unpacker for 
the file
  extension, then it raises a ReadError.  Is it okay to change that to 
ValueError?

--

___
Python tracker 

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



[issue6884] Impossible to include file in sdist that starts with 'build' on Win32

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

Escalated to release blocker, as bugfix releases are about to go out of the 
door and I’d prefer they weren’t published with the buggy fixes committed for 
#13193.

--
nosy: +benjamin.peterson, georg.brandl
priority: normal -> release blocker

___
Python tracker 

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



[issue6884] Impossible to include file in sdist that starts with 'build' on Win32

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for testing and confirming that this code never worked.  I am now 
confident that we’re about to fix once and for all this basket of bugs in the 
correct way.

I updated the tests to make them hopefully pass on Windows, and while doing 
that I realized that I don’t like the unnecessary escaping of / on posix 
systems.  Regexes already look like grit on my monitor, so I prefer not making 
them harder to read.  My latest patch only escapes if os.sep is the backslash.

Should apply cleanly to 2.7, please test.


> While we're talking about translate_pattern(), I have a question about this 
> line:
> [snip]
> For example, it seems wrong that "recursive-include foo bar.*" matches 
> foo/test_bar.py.
Certainly.  Feel free to open another report for that, or I’ll do it.

--
resolution: accepted -> 
Added file: http://bugs.python.org/file24623/filelist-regex-bugs.diff

___
Python tracker 

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



[issue14097] Improve the "introduction" page of the tutorial

2012-02-23 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks.

--

___
Python tracker 

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



[issue14097] Improve the "introduction" page of the tutorial

2012-02-23 Thread Ezio Melotti

Ezio Melotti  added the comment:

The attached patch addresses 8) -- you might want to use it as a starting point 
(that's what I was going to fix before deciding to do a full review of the 
page).

--
assignee: rhettinger -> docs@python
keywords: +patch
Added file: http://bugs.python.org/file24622/issue14097.diff

___
Python tracker 

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



[issue672115] Assignment to __bases__ of direct object subclasses

2012-02-23 Thread Adam Venturella

Adam Venturella  added the comment:

I too just found the same issue, dunno if it was settled on as being a bug per 
se. 

"class object(object): pass" 

Also worked for me. I don't feel great about doing that though. So I opted for 
more verbose name as not to collide with "object"

I have to wonder, since it's been 9 years, if all of us finding this issue are 
guilty of doing it wrong =)

--
nosy: +aventurella

___
Python tracker 

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



[issue1353344] python.desktop

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

Here’s a patch by Georg for the unix install machinery: 
http://mail.python.org/pipermail/python-dev/2006-July/067261.html

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



[issue14103] argparse: add ability to create a bash_completion script

2012-02-23 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue14103] argparse: add ability to create a bash_completion script

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

There is a module that implements this for optparse: 
; I contacted the author when 
argparse was moved to the standard library and he told me that he would like to 
support argparse but had to time to code it.

optcomplete is 451 physical lines long, and 211 single logical lines long 
(courtesy of the sloccount program).  Maybe it would be smaller after being 
adapted to argparse, but that’s still a large chunk of code to add, and my 
feeling is that it would not serve a large enough part of our users.  For 
example, many people use zsh, which has a wholly different completion system.  
I’m also given to understand that some people use Windows.

The decision is Steven’s call, as argparse maintainer, but in my opinion the 
best course would be to update optcomplete to work with argparse, publish it on 
PyPI, collect feedback and download statistics, and if it proves solid and 
widely used, reconsider it for stdlib inclusion.

--
nosy: +bethard, eric.araujo
title: argparser should create a bash_completion script for me. -> argparse: 
add ability to create a bash_completion script
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



[issue14102] argparse: add ability to create a man page

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

Forgot the link to the blog post: 
https://andialbrecht.wordpress.com/2009/03/17/creating-a-man-page-with-distutils-and-optparse/

--

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

Are you aware of help2man?  It can transmogrify the output of 
“your-program-that-uses-argparse --help” to a man page.  Another solution is to 
use docutils’ rst2man to convert some documentation file to the man format.

On the other hand, this blog post contains code implementing a custom optparse 
formatter for man pages, which could probably be adapted for argparse easily, 
so it does not look hard to implement.  (Note that the code has no licensing 
information.)

Steven, what do you think?  Too specialized for the stdlib or small, useful new 
feature?

--
components: +Library (Lib) -None
nosy: +bethard, eric.araujo
title: argparser should create a man page for me. -> argparse: add ability to 
create a man page
versions: +Python 3.3 -Python 2.7

___
Python tracker 

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



[issue14101] example function in tertools.count docstring is misindented

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

Patch LGTM.  Raymond, any objection?

--
components: +Extension Modules -Documentation, Library (Lib)
nosy: +eric.araujo, rhettinger
stage:  -> patch review
title: example function in tertools.count is misindented -> example function in 
tertools.count docstring is misindented
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



[issue14099] ZipFile.open() should not reopen the underlying file

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the report and patch.  I’m afraid changing the constructor signature 
is not an option, due to our backward compatibility policy.  Do you think the 
bug can be fixed without changing the signature, or with new arguments added 
after the existing ones?

--
nosy: +alanmcintyre, eric.araujo
stage:  -> patch review
title: zipfile: ZipFile.open() should not reopen the underlying file -> 
ZipFile.open() should not reopen the underlying file
type: resource usage -> behavior
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



[issue14100] Add a missing info to PEP 393 + link from whatsnew 3.3

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

Agreed with Antoine.  If you want, you can make a patch for the PEPs repo with 
the info requested by the XXX note, then a patch to replace that note by a link 
to the PEP, unless Martin wanted to do that himself.

--
nosy: +eric.araujo
title: expose a hidden note -> Add a missing info to PEP 393 + link from 
whatsnew 3.3

___
Python tracker 

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



[issue14088] sys.executable generating canonical path

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

I wonder if the doc for sys.executable should mention that .. segments may be 
present.

--
nosy: +eric.araujo, petri.lehtinen

___
Python tracker 

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



[issue1659] Tests needing network flag?

2012-02-23 Thread Éric Araujo

Éric Araujo  added the comment:

All tests now use regrtest resources and/or unittest skips and/or 
test.support.transient_internet.  I ran the faulty tests mentioned in this 
report while disconnected and got no failure, only skips.  Closing as 
duplicate/out of date.

--
nosy: +eric.araujo
resolution:  -> out of date
stage:  -> 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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-23 Thread Brett Cannon

Brett Cannon  added the comment:

So I finished rewriting _return_module() so that if fromlist is not defined 
then it's all in C (and subsequently naming the function _handle_fromlist()).

That leaves rewriting in C _calc___package__() and _resolve_name(). After that 
I don't think there is anything left to do in C for __import__() itself (beyond 
maybe some reorganizing to avoid stupid things).

After that the only thing I can think of writing in C would be BuiltinImporter 
(and FrozenImporter if someone truly cared).

And once all that is said and done, that only leaves optimizing the Python code 
to try to appease the performance gods.

--

___
Python tracker 

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



[issue10722] IDLE's subprocess didnit make connection ..... Python 2.7

2012-02-23 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Some changes have been made to the subprocess connection code since my last 
message here. I believe they occurred after the last releases. There should be 
new 2.7.3 and 3.2.3 releases in about a month, after PyCon. Larry, if you can 
semi-deterministically make the problem happen, please try 3.2 also. I believe 
the IDLE code is the same for both 2.7 and 3.2, but I have no idea about the 
subprocess code.

--

___
Python tracker 

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



[issue14105] Breakpoints in debug lost if line is inserted; IDLE

2012-02-23 Thread Larry A. Taylor

New submission from Larry A. Taylor :

My environment is Windows XP, using IDLE and Python 2.7 distribution.

Open an IDLE Python shell. Open the file with three lines in it, 1,2 and 3.

In IDLE, Set Breakpoint on Line 2.

In Shell, set Debug.

In IDLE, select run. 

In the Debug window, click Go.

Run stops at line 2, displayed in Debug. Click Quit.

Edit the file, inserting a line 0, like: print "this is line 0". Save the file

Run again, Go in Debug. 

The breakpoint has disappeared and the debugger does not stop on line 2 (now 
the third line). It doesn't stop anywhere.

Delete line 0, and set breakpoint on line 2 again. At the end of the file, 
insert a line 4, such as: print "this is line 4".

Run again, Go in Debug.

The breakpoint is preserved, and the debugger stops at line 2.

This is inconsistent behavior. I expect that a breakpoint will not disappear, 
and that it will always point to the same line, moving down when the line moves 
down. The breakpoint should move up if the line it refers to moves up.

--
components: IDLE, Windows
files: debug-line-numbers.py
messages: 154104
nosy: ltaylor934
priority: normal
severity: normal
status: open
title: Breakpoints in debug lost if line is inserted; IDLE
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file24621/debug-line-numbers.py

___
Python tracker 

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-23 Thread Brett Cannon

Brett Cannon  added the comment:

OK, so I have now streamlined the case so that only C is called when a module 
is in sys.modules, level == 0 and not fromlist.

Using the normal_startup benchmark, bootstrapped importlib is 1.12x slower. A 
fast run of startup_nosite puts it at 1.2x slower.

Using importlib.test.benchmark, the results are:


Comparing new vs. old

sys.modules : 331,097 vs. 383,180 (86.407694%)
Built-in module : 14,906 vs. 33,071 (45.072722%)
Source writing bytecode: small : 1,244 vs. 2,128 (58.458647%)
Source w/o bytecode: small : 2,420 vs. 4,784 (50.585284%)
Source w/ bytecode: small : 2,757 vs. 5,221 (52.805976%)
Source writing bytecode: tabnanny : 129 vs. 133 (96.992481%)
Source w/o bytecode: tabnanny : 144 vs. 147 (97.959184%)
Source w/ bytecode: tabnanny : 1,004 vs. 1,120 (89.642857%)
Source writing bytecode: decimal : 9 vs. 9 (100.00%)
Source w/o bytecode: decimal : 9 vs. 9 (100.00%)
Source w/ bytecode: decimal : 96 vs. 98 (97.959184%)


Where does that leave us? Well, obviously on medium-sized modules and up, the 
I/O involved along with parsing and execution outweighs importlib's costs to 
the point of being negligible. sys.modules is also now fast enough (I don't 
care what people say; being able to import from sys.modules at 0.0026 ms vs. 
0.003 ms is not important in the grand scheme of things).

Built-in modules and such could be faster, but (a) there are only so many and 
they end up in sys.modules quickly anyway, and (b) even at their current speed 
they are still fast. So the real hold-up is small modules and whether they 
matter. The tabnanny benchmark is the median size of the stdlib, so half of 
modules will see no slowdown while half will see something of some level.

The most critical thing is to not use _gcd_import() in situations where the 
import function is currently passed in but instead use builtins.__import__() so 
as to get any C speed-ups (which I measured to make sure there are in all 
cases). After that I think unrolling the mentioned functions would help speed 
things up, but otherwise it becomes time to profile the Python code to see 
where the inefficiencies lie.

Some more C unrolling could be done. The situation of not fromlist could be 
written in C. Both _calc___packages__() and _resolve_name() could probably be 
written in C if someone cared.

--

___
Python tracker 

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



[issue10722] IDLE's subprocess didnit make connection ..... Python 2.7

2012-02-23 Thread Larry A. Taylor

Larry A. Taylor  added the comment:

I have had this happen to me many times with Windows XP, the standard OS here. 
Using IDLE and Python 2.7.

Some of the time the following applies: I have more than one Python Shell open 
at the same time. The first Python shell/IDLE with debug is running a long job 
I don't want to interrupt. 

A second IDLE edit window is connected to the second Python shell. I set the 
shell to debug, then to the edit window with the program, and select 'run'. 

Result: I get the message reported in this issue. Sometimes.

It appears to have nothing to do with firewalls.

--
nosy: +ltaylor934

___
Python tracker 

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



[issue13706] non-ascii fill characters no longer work in formatting

2012-02-23 Thread STINNER Victor

STINNER Victor  added the comment:

> The ps_AF locale fails with an assert after the latest commit:
> ...
> format(13232434234.23423, "n")
> python: Python/formatter_unicode.c:606: fill_number: 
> Assertion `r == spec->n_grouped_digits' failed.
> Aborted

Oh, you found a locale with a non-ASCII decimal point, cool! I failed to find 
such locale. The last commit makes Python supports non-ASCII decimal point.

Your comment is incorrect, it was already failing before my commit ;-) Example 
at changeset 548a023c8230:

$ LANG=ps_AF ./python 
Python 3.3.0a0 (default:548a023c8230, Feb 24 2012, 01:48:01) 
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'ps_AF')
'ps_AF'
>>> format(0.1, 'n')
python: Objects/unicodeobject.c:391: _PyUnicode_CheckConsistency: Assertion 
`maxchar < 128' failed.
Abandon

--

By the way, Python 3.2 fails also to handle non-ASCII thousands separator or 
non-ASCII decimal point:

$ LANG=ps_AF python3
Python 3.2.1 (default, Jul 11 2011, 18:54:42) 
[GCC 4.6.1 20110627 (Red Hat 4.6.1-1)] on linux2
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'ps_AF')
'ps_AF'
>>> format(1234, 'n')
'1\Uffd9\Uffac234'
>>> format(0.1, 'n')
'0\Uffd9\Uffab1'

D9 AC/AB are byte strings b'\xD9\xAC' and b'\xD9\xAB' which are UTF-8 encode 
strings corresponding to U+066C (arabic thousands separator) and U+066B (arabic 
decimal separator).

\Uffab is a bug in a cast from signed char to 32-bit unsigned integer 
(Py_UNICODE on Linux).

--

___
Python tracker 

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



[issue13706] non-ascii fill characters no longer work in formatting

2012-02-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a29d20fa85b4 by Victor Stinner in branch 'default':
Issue #13706: Fix format(float, "n") for locale with non-ASCII decimal point 
(e.g. ps_aF)
http://hg.python.org/cpython/rev/a29d20fa85b4

--

___
Python tracker 

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



[issue13706] non-ascii fill characters no longer work in formatting

2012-02-23 Thread Stefan Krah

Stefan Krah  added the comment:

The ps_AF locale fails with an assert after the latest commit:


Python 3.3.0a0 (default:f89e2f4cda88+, Feb 24 2012, 01:14:50) 
[GCC 4.4.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
[67103 refs]
>>> locale.setlocale(locale.LC_ALL, "ps_AF")
'ps_AF'
[67108 refs]
>>> format(13232434234.23423, "n")
python: Python/formatter_unicode.c:606: fill_number: Assertion `r == 
spec->n_grouped_digits' failed.
Aborted

--

___
Python tracker 

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



[issue13706] non-ascii fill characters no longer work in formatting

2012-02-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f89e2f4cda88 by Victor Stinner in branch 'default':
Issue #13706: Fix format(int, "n") for locale with non-ASCII thousands separator
http://hg.python.org/cpython/rev/f89e2f4cda88

--

___
Python tracker 

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



[issue14104] Implement time.monotonic() on Mac OS X

2012-02-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue13846] Add time.monotonic() function

2012-02-23 Thread STINNER Victor

STINNER Victor  added the comment:

> Boost has a monotonic time implementation (steady_clock) for OS X

I opened a new issue for Mac OS X: #14104.

--

@Éric: I enhanced the doc. Feel free to complete or rewrite it if you have 
better information about such clocks.

--

___
Python tracker 

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



[issue13846] Add time.monotonic() function

2012-02-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 50b1f2d07011 by Victor Stinner in branch 'default':
Issue #13846: Enhance time.monotonic() documentation
http://hg.python.org/cpython/rev/50b1f2d07011

--

___
Python tracker 

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



[issue14104] Implement time.monotonic() on Mac OS X

2012-02-23 Thread STINNER Victor

New submission from STINNER Victor :

time.monotonic() can use mach_absolute_time() on Mac OS X. mach_timebase_info() 
may be used to convert the result to a number of seconds. Examples:

https://github.com/ThomasHabets/monotonic_clock/blob/master/src/monotonic_mach.c
http://svn.boost.org/svn/boost/trunk/boost/chrono/detail/inlined/mac/chrono.hpp
(search steady_clock)

Another way is to use clock_get_time() with 
host_get_clock_service(SYSTEM_CLOCK). Example:

https://github.com/gavinbeatty/python-monotonic-time/blob/master/darwin.c

--
components: Library (Lib)
messages: 154095
nosy: haypo, pitrou
priority: normal
severity: normal
status: open
title: Implement time.monotonic() on Mac OS X
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



[issue812369] module shutdown procedure based on GC

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

Martin v. Löwis  added the comment:

> (This is just a report about PyPy's situation; I understand that the
> situation in CPython is a bit more delicate if CPython is embedded in
> a larger process.)

I think that would indeed be unacceptable for Python - there is a
long-standing expectation that we free all memory that we allocated,
as well as release any other resources that we hold. There are also
expectations wrt. running atexit code. So there clearly must be a
shutdown procedure.

--

___
Python tracker 

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



[issue14087] multiprocessing.Condition.wait_for missing

2012-02-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

In test/test_multiprocessing.py:
"""
   def test_waitfor(self):
   [...]
   with cond:
   result = cond.wait_for(lambda : state.value==0)
   self.assertTrue(result)
   self.assertEqual(state.value, 0)
   for i in range(4):
   time.sleep(0.01)
   with cond:
   state.value += 1
   cond.notify()
"""

Shouldn't the `for` loop be outside the outer `with` block?

In Lib/multiprocessing/managers.py:
Is there a good reason why the wait_for() proxy method can't simply be 
implemented as:
return self._callmethod('wait_for', (predicate, timeout))?

(There may be, I just didn't check).

Finally, the documentation should be updated (Doc/library/multiprocessing.rst).

Otherwise, it would probably be better if you could submit a contributor 
agreement (and also maybe update your name on the tracker), unless that's a 
problem for you?

--
nosy: +neologix

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-23 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue14103] argparser should create a bash_completion script for me.

2012-02-23 Thread Dave Malcolm

Changes by Dave Malcolm :


--
components: +Library (Lib)
type:  -> enhancement

___
Python tracker 

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



[issue14097] Improve the "introduction" page of the tutorial

2012-02-23 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

some of theses are great suggestions.  I'll do an update shortly.

--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue13866] {urllib, urllib.parse}.urlencode should not use quote_plus

2012-02-23 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue14103] argparser should create a bash_completion script for me.

2012-02-23 Thread Daniel Walsh

New submission from Daniel Walsh :

I have developed a new tool virt-sandbox-service using argparse.  Currently the 
argparse has the ability to print help and usage.  Being naturally lazy, I 
think it should be able to generate a bash_completion script also.

--
messages: 154091
nosy: Daniel.Walsh, dmalcolm
priority: normal
severity: normal
status: open
title: argparser should create a bash_completion script for me.

___
Python tracker 

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



[issue14102] argparser should create a man page for me.

2012-02-23 Thread Daniel Walsh

New submission from Daniel Walsh :

I have developed a new tool virt-sandbox-service using argparse.  Currently the 
argparse has the ability to print help and usage.  Being naturally lazy, I 
think it should be able to print out a man page also.  This would help with 
development and make maintaining the different documents.

--
components: None
messages: 154090
nosy: Daniel.Walsh, dmalcolm
priority: normal
severity: normal
status: open
title: argparser should create a man page for me.
type: enhancement
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



[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-23 Thread STINNER Victor

STINNER Victor  added the comment:

I merged the two patches (qualname_dict.patch and type_new.patch) and added a 
fix for non-string __qualname__ => type_new-2.patch.

--
Added file: http://bugs.python.org/file24620/type_new-2.patch

___
Python tracker 

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



[issue14091] python subprocess hangs if script called from another directory

2012-02-23 Thread STINNER Victor

STINNER Victor  added the comment:

> Will follow it.

If you report the issue to abrt, could you give me the url to your report 
please? (as a comment to this issue)

--

___
Python tracker 

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



[issue13873] SIGBUS in test_big_buffer() of test_zlib on Debian bigmem buildbot

2012-02-23 Thread STINNER Victor

STINNER Victor  added the comment:

> I'm okay with leaving the tests as they are in 3.3. Any objections?

Nope, it's fine.

--

___
Python tracker 

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



[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-23 Thread Meador Inge

Meador Inge  added the comment:

haypo, I can reproduce the segfault using the 'None' test case on your patch as 
well.

--

___
Python tracker 

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



[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-23 Thread STINNER Victor

STINNER Victor  added the comment:

> Here is a patch.

Oh, I also wrote a patch :-) My patch fixes this issue but also many memory 
leaks in error cases.

> (I can't reproduce the crash, btw)

I can reproduce the crash, but only with Python compiled in release mode (not 
with Python compiled in debug mode).

--
Added file: http://bugs.python.org/file24619/type_new.patch

___
Python tracker 

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



[issue14101] example function in tertools.count is misindented

2012-02-23 Thread Zbyszek Szmek

New submission from Zbyszek Szmek :

Indentation is broken.

diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -3221,10 +3221,10 @@
 Return a count object whose .__next__() method returns consecutive values.\n\
 Equivalent to:\n\n\
 def count(firstval=0, step=1):\n\
-x = firstval\n\
-while 1:\n\
-yield x\n\
-x += step\n");
+x = firstval\n\
+while 1:\n\
+yield x\n\
+x += step\n");

--
assignee: docs@python
components: Documentation, Library (Lib)
files: itertools-count-indentation.diff
keywords: patch
messages: 154084
nosy: docs@python, zbysz
priority: normal
severity: normal
status: open
title: example function in tertools.count is misindented
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file24618/itertools-count-indentation.diff

___
Python tracker 

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



[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-23 Thread Meador Inge

Meador Inge  added the comment:

I can reproduce the segfault on F16:

Python 3.3.0a0 (default:3828d93fd330, Feb 23 2012, 13:49:57) 
[GCC 4.4.6] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> d = {'__qualname__':'XXX'}
[66934 refs]
>>> T = type('foo', (), d)
[66956 refs]
>>> T
python: Objects/unicodeobject.c:301: _PyUnicode_CheckConsistency: Assertion 
`((PyObject*)(op))->ob_type))->tp_flags & ((1L<<28))) != 0)' failed.
Aborted (core dumped)

The patch looks mostly OK, but I can still segfault the interpreter by using a 
'__qualname__' of 'None':

Python 3.3.0a0 (default:3828d93fd330+, Feb 23 2012, 13:55:57) 
[GCC 4.4.6] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> d = {'__qualname__':'XXX'}
[67128 refs]
>>> T = type('foo', (), d)
[67156 refs]
>>> T

[67161 refs]
>>> d = {'__qualname__': None}
[67161 refs]
>>> T = type('foo', (), d)
[67185 refs]
>>> T
python: Objects/unicodeobject.c:301: _PyUnicode_CheckConsistency: Assertion 
`((PyObject*)(op))->ob_type))->tp_flags & ((1L<<28))) != 0)' failed.
Aborted (core dumped)

Try this additional unit test:

d = {'__qualname__': None}
tp = type('foo', (), d)
self.assertEqual(tp.__qualname__, None)
self.assertEqual(tp.__dict__['__qualname__'], None)
self.assertEqual(d, {'__qualname__': None})
self.assertTrue(repr(tp))

--

___
Python tracker 

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



[issue13866] {urllib, urllib.parse}.urlencode should not use quote_plus

2012-02-23 Thread Stephen Day

Stephen Day  added the comment:

While it's likely that adding a `quote`/`quote_plus` function paramater to 
urlencode is the right solution, I want to ensure that the key point is 
communicated clearly: encoding a space as a '+' is pathological, in that in the 
common case, an unescaped encoded character is indistinguishable from a literal 
'+'. Take the case of the literal string '+ '. If one uses the javascript 
encodeURI function to encode the string in a browser console, one gets the 
following:

> encodeURI('+ ')
"+%20"

Now, we have a string that will not decode symmetrically. In other words, we 
cannot tell if this string should decode to '  ' or '+ '. And while use of 
encodeURI is discouraged, application developers still use it places, 
introducing these kinds of errors.

Conversely, we can see that the behavior of encodeURIComponent, is unambiguous:

encodeURIComponent('+ ')
"%2B%20"

And while these are analogues to quote and quote_plus (there exists now 
analogue to javascripts urlencode), it's easy to see that disambiguating the 
encoding of the resulting output of urlencode would be desirable.

There is a similar situation with php library functions. 

Furthermore, it is agreed that urlencode does follow the rules, but the rules, 
as they are, introduce an asymmetrical, pathological encoding. Most services 
accept '%20' as space in lieu of '+' when data is encoded as 
'application/x-www-form-urlencoded' anyway.

Concluding, I know it seems a little silly to spend time filing this bug and 
provide relevant cases, but I'd like to cite professional experience in this 
matter; I have seen "pluses-for-spaces" introduce errors time and time again.

--

___
Python tracker 

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



[issue13873] SIGBUS in test_big_buffer() of test_zlib on Debian bigmem buildbot

2012-02-23 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

Well, it turns out that when I tested it on my own machine, I actually
wasn't using a tmpfs - I misread the output of df and used /tmp¹ instead
of /run. Doing the test in /run does in fact give a bus error. Mea culpa.

¹ Apparently on my system /tmp isn't a tmpfs. Go figure.


> Also, if the filesystem doesn't support sparse files, this writes a
> lot to the disk (and if it crashes, you end up with a huge file).

You may be right; I hadn't thought about that possibility. My concern was
that the test suite isn't run with -M very often, so these sorts of tests
could often be broken for a while before someone found out. In the past,
none of the buildbots ran bigmem tests, so there was a real danger that
we wouldn't notice breakages. However, with the addition of the debian
bigmem buildbot, that is no longer the case, so this isn't such an issue
any more.

I'm okay with leaving the tests as they are in 3.3. Any objections?
If not, I'll also backport the change to 3.2 and 2.7.

--

___
Python tracker 

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



[issue13873] SIGBUS in test_big_buffer() of test_zlib on Debian bigmem buildbot

2012-02-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

> but maybe it's due to something specific about  the configuration of the 
> buildbot
> machine?

Maybe you didn't try with a large enough file. Here's a trial on my box:
"""
$ df -h /tmp/
Filesystem  Size  Used Avail Use% Mounted on
tmpfs   253M   68K  253M   1% /tmp
$ cat /tmp/test.py
import mmap
import zlib

f = open('/tmp/foo', 'wb+')
f.seek(512 * 1024 * 1024)
f.write(b'x')
f.flush()
m = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
zlib.crc32(m)
m.close()
$ python /tmp/test.py
Bus error (core dumped)
"""

> I've temporarily changed the test to use a regular chunk of memory
>instead of the mmap hack). If possible, I'd like to change back to the
>old technique in the long run (since it allows the test to run on
>machines with less RAM)

Yes, but this kind of test is only supposed to be run on machines
which have enough memory.
Also, if the filesystem doesn't support sparse files, this writes a
lot to the disk (and if it crashes, you end up with a huge file).
I'd say it's fine this way...

--

___
Python tracker 

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



[issue13866] {urllib, urllib.parse}.urlencode should not use quote_plus

2012-02-23 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

A couple of points to help summarize and to help come to a conclusion.

In the initial message, Stephen pointed out, "it would be desirable to merely 
encode spaces using percent encoding".

It seems to me that only in cases where a custom handling of query string is 
done, would space be encoded to %20 (or if it's an IRI instead of URI - details 
below) and for HTTP requests and in both GET and POST, encoding to space in a 
URI to + is a correct thing to do.

The query part in the URL always needs to follow the 
application/x-www-form-urlencoded format, so even when urlencode is used for 
constructing a query parameters, it should encode space to +

The argument that all characters should be hex encoded (and thereby space 
should be %20), seems to apply if it is an IRI. Look at an interesting 
discussion in this link:
http://stackoverflow.com/questions/5366007/why-does-the-encodings-of-a-url-and-the-query-string-part-differ/5433216#5433216

Only with this point as consideration. I think, sending a parameter for quote 
to use quote or quote_plus may be worthy option to consider (Stephen's point 
#3). 

But I have to add that the existing behavior of replacing space with "+" in 
"URL"s is not breaking anything and in fact is following the rules properly.

--

___
Python tracker 

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



[issue14059] Implement multiprocessing.Barrier

2012-02-23 Thread sbt

sbt  added the comment:

Forgot to mention, mp_barrier.patch needs to be applied on top of 
cond_wait_for.patch for Issue14087.

--

___
Python tracker 

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



[issue14099] zipfile: ZipFile.open() should not reopen the underlying file

2012-02-23 Thread Stepan Kasal

Stepan Kasal  added the comment:

Attached please find a patch that fixes this issue by reusing the original fp 
from ZipFile object.

Two of the test cases attempted to read a file from a zip as soon as write() 
was called.  I believe that this is not correct usage: zip file is not even 
fully written to disk at that stage!
So I took the liberty to change these two test cases so that they first write 
the file and then read it.

Let me thank to Martin Sikora for discovering the issue and to Matej Cepl for 
testing it on current source tree.

--
keywords: +patch
Added file: http://bugs.python.org/file24617/Proposed-fix-of-issue14099.patch

___
Python tracker 

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



[issue14071] allow more than one hash seed per process (move _Py_HashSecret into PyInterpreterState)

2012-02-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Agreed with Victor, this is not really doable currently.
Besides, you can't really have several interpreter instances simultaneously, 
you can have several sub-interpreters, which isn't exactly the same thing 
(sub-interpreters share some stuff, I don't remember which exactly).

--
nosy: +pitrou

___
Python tracker 

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



[issue7652] Merge C version of decimal into py3k.

2012-02-23 Thread Stefan Krah

Stefan Krah  added the comment:

Over the last two months I've done a full review of all files except
_decimal.c and mpdecimal.c.

I now have additional ACL2 proofs for a couple of functions in basearith.c
(some are partial proofs), a full proof for the special case (d = 10**19)
of Granlund/Montgomery's "Divide double word by constant" algorithm and a
full proof for the Chinese Remainder Theorem in crt.c.


I didn't find anything important. I found a couple of useless variable
initializations, missing comments etc.

There was one (deliberate) incompatibility in the format function:
If rounding lead to an Overflow, _decimal printed 'Infinity'.

_decimal can't read back numbers that are out of bounds, so this
was done to ensure that a roundtrip is always possible.


But I changed the function so _decimal now uses exactly the same algorithm
for formatting as decimal.py.

--

___
Python tracker 

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



[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch.
(I can't reproduce the crash, btw)

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file24616/qualname_dict.patch

___
Python tracker 

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



[issue7652] Merge C version of decimal into py3k.

2012-02-23 Thread Stefan Krah

Changes by Stefan Krah :


Added file: http://bugs.python.org/file24615/40917e4b51aa.diff

___
Python tracker 

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



[issue11438] 2to3 does not fix izip_longest

2012-02-23 Thread Peter

Changes by Peter :


--
nosy: +maubp

___
Python tracker 

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



[issue14059] Implement multiprocessing.Barrier

2012-02-23 Thread sbt

sbt  added the comment:

Patch which subclasses threading.Barrier.

--
keywords: +patch
Added file: http://bugs.python.org/file24614/mp_barrier.patch

___
Python tracker 

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




[issue2377] Replace __import__ w/ importlib.__import__

2012-02-23 Thread Brett Cannon

Brett Cannon  added the comment:

That last comment from me looks odd because somewhere along the way my replies 
to Éric's comment got stripped out.

First two paragraphs are in response to 1)
Third paragraph is for 2)
Fourth paragraph is for 3)

Rest makes sense since the inline reply survived.

--

___
Python tracker 

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



[issue13447] Add tests for some scripts in Tools/scripts

2012-02-23 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

> Shall I commit the new file or first add more tests?

Might as well commit now; there's no sense in leaving the code sitting
around just because the file feels a bit short.

A couple of minor nits about your patch, though:

- The docstring for test_tools says "Tests for reindent.py". It would be
  better to have something referring to the Tools directory, so people
  know that this is the right place to put new tests for scripts that
  currently don't have any.

- The wording of the message 'requires an uninstalled Python build' is a
  bit awkward - I'd use "non-installed" instead of "uninstalled", so
  inexperienced users don't go and try to uninstall their system Python ;-)

--

___
Python tracker 

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-23 Thread Brett Cannon

Brett Cannon  added the comment:

On Wed, Feb 22, 2012 at 19:35, Éric Araujo  wrote:

I have already done that and pushed the initial change. The ultimate goal
will be fetching from sys.modules when level == 0 and not bool(fromlist)
only touch C code. All other work will touch varying levels of Python code.
Someone else can worry about speeding up fromlist so that only C code is
touched when level == 0.

I also have some failing tests, but that all has to do with Antoine's
caching work and thus fails in the default branch as well when the tests
are run under importlib itself (i.e. tests that generate a file and then
immediately try to import it). But what's nice is that test_reprlib now
fails only in my bootstrap branch and not default because it is just fast
enough to beat the directory mtime granularity. =)

Ha! I wish. I have to get within reasonable striking distance of current
performance or else I will get blocked for including the work.

It's possible as long as it is exposed through imp.

> 4) When is PyPy going to be the reference implementation again?  Then
> we’ll have no speed issues—ha ha only serious.
>
> 5) importlib rocks hard.

=) Thanks

--

___
Python tracker 

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



[issue10848] Move test.regrtest from getopt to argparse

2012-02-23 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-23 Thread Meador Inge

Changes by Meador Inge :


--
nosy: +meador.inge

___
Python tracker 

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



[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-02-23 Thread Stefan Behnel

Changes by Stefan Behnel :


--
keywords: +patch
Added file: http://bugs.python.org/file24613/exc_info_capi.patch

___
Python tracker 

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



[issue14100] expose a hidden note

2012-02-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, presumably the XXX tells you why it's hidden.

--
nosy: +loewis

___
Python tracker 

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



[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-02-23 Thread Stefan Behnel

Stefan Behnel  added the comment:

Writing up a test case, I noticed that it makes sense to let PyErr_SetExcInfo() 
steal the references. This matches the main use case of saving and restoring 
the fields. For the getter, it's still best to return new references in order 
to support the use case of just reading the fields, as well as the use case of 
reading and clearing the fields (which a subsequent call to 
PyErr_SetExcInfo(NULL,NULL,NULL) does).

--

___
Python tracker 

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



[issue14100] expose a hidden note

2012-02-23 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
title: expose a note a hidden note -> expose a hidden note

___
Python tracker 

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



[issue2209] mailbox module doesn't support compressed mbox

2012-02-23 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Jürgen, would you consider writing a patch?

--
nosy: +jcea
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



[issue14100] expose a note a hidden note

2012-02-23 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +haypo, pitrou
stage:  -> patch review
type:  -> enhancement

___
Python tracker 

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



[issue14100] expose a note a hidden note

2012-02-23 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

I wonder if this note was hidden deliberately.

--
assignee: docs@python
components: Documentation
files: make-note-visible.patch
keywords: patch
messages: 154065
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: expose a note a hidden note
versions: Python 3.3
Added file: http://bugs.python.org/file24612/make-note-visible.patch

___
Python tracker 

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



[issue1521950] shlex.split() does not tokenize like the shell

2012-02-23 Thread Dan Christian

Dan Christian  added the comment:

I haven't been following this much.  Sorry.  My day job isn't in this area any 
more (and I'm stuck using 2.4 :-().

Looking at the docs, I notice the "old" is different from what it used to be.  
Notably: 'e;' gets split into two tokens; and ">'abc';" gets split into 3.  I'm 
pretty sure that baseline code doesn't split those at all.  So there is a 
question of if "old" is fully backward compatible.

The "new" functionality looks great.  That's what I was looking for when I 
filed the bug.

Thank you!
-Dan

--

___
Python tracker 

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



[issue14087] multiprocessing.Condition.wait_for missing

2012-02-23 Thread sbt

sbt  added the comment:

Patch which just copies the implementation from threading.

--
keywords: +patch
Added file: http://bugs.python.org/file24611/cond_wait_for.patch

___
Python tracker 

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



[issue13873] SIGBUS in test_big_buffer() of test_zlib on Debian bigmem buildbot

2012-02-23 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

> The SIGBUS could be due to the buildbot running out of tmpfs.

I haven't been able to reproduce the crash by running the test on a tmpfs
on my own machine (Ubuntu AMD64; 8GB RAM; Linux 3.0.0-15-generic; zlib
1:1.2.3.4.dfsg-3ubuntu3), but maybe it's due to something specific about
the configuration of the buildbot machine?

I've temporarily changed the test to use a regular chunk of memory
instead of the mmap hack). If possible, I'd like to change back to the
old technique in the long run (since it allows the test to run on
machines with less RAM), but until we can figure out the problem, I'd
rather not have the test failing needlessly.

--

___
Python tracker 

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



[issue14091] python subprocess hangs if script called from another directory

2012-02-23 Thread Massimo Paladin

Massimo Paladin  added the comment:

Will follow it.

Thanks,
-Massimo

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

___
Python tracker 

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



[issue13873] SIGBUS in test_big_buffer() of test_zlib on Debian bigmem buildbot

2012-02-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f3f3bb45205b by Nadeem Vawda in branch 'default':
Issue #13873: Fix crash in test_zlib on bigmem buildbot.
http://hg.python.org/cpython/rev/f3f3bb45205b

--
nosy: +python-dev

___
Python tracker 

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



[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-23 Thread sbt

sbt  added the comment:

I get a segfault with

  Python 3.3.0a0 (default:31784350f849, Feb 23 2012, 11:07:41)
  [GCC 4.5.2] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> d = {'__qualname__':'XXX'}
  >>> T = type('foo', (), d)
  >>> d
  Segmentation fault

On Windows I also get a crash.  Wierdly, if I replace 'XXX' by 'foo', 
there is no segfault, but d is empty

  Python 3.3.0a0 (default:31784350f849, Feb 23 2012, 11:07:41)
  [GCC 4.5.2] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> d = {'__qualname__':'foo'}
  >>> T = type('foo', (), d)
  >>> d
  {}

--
nosy: +sbt

___
Python tracker 

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



[issue14099] zipfile: ZipFile.open() should not reopen the underlying file

2012-02-23 Thread Matej Cepl

Changes by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue14099] zipfile: ZipFile.open() should not reopen the underlying file

2012-02-23 Thread Stepan Kasal

New submission from Stepan Kasal :

When a file inside a zip is open, the underlying zip file is open again.
(Unless the file name is unknown, because the ZipFile object was created with 
fp only.)

This design is incorrect, insecure, and ineffective:
- the reopen uses the same string as file name, but on unix-like systems that 
file name may no longer exist, or may point to a different file
- opening n files from the same zip archive consumes n OS file descriptors, 
wasting resources

I believe that the parent ZipFile object and all the child ZipExtFile objects 
should keep the same fp.  The last one would close it.

I'm working on a patch currently.

--
components: Library (Lib)
messages: 154058
nosy: kasal
priority: normal
severity: normal
status: open
title: zipfile: ZipFile.open() should not reopen the underlying file
type: resource usage
versions: Python 2.7, Python 3.1, 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



[issue1521950] shlex.split() does not tokenize like the shell

2012-02-23 Thread Vinay Sajip

Vinay Sajip  added the comment:

>Éric Araujo  added the comment:

>I did not fully get what you meant here, but the example you added to the doc 
>made it clear.  Is this covered by tests?

Yes, I believe that testSyntaxSplitCustom covers this.

>Overall great patch!  Dan, do you have time to test it (or read the new 
>examples in the patch) to tell us if it meets what you wanted?

Thanks! It was a bit fiddly, shlex is somewhat difficult to extend cleanly. I 
developed this functionality for a subprocess ease-of-use-wrapper module called 
sarge, and I had to basically copy and modify the whole read_token method :-(

--

___
Python tracker 

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



[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-02-23 Thread Stefan Behnel

Stefan Behnel  added the comment:

I wonder if these functions should have an error return value, i.e. return -1 
on failure. They'd "never" fail in CPython, but other implementations may want 
to report failures, in case their internal implementation is more involved. 
OTOH, documenting that they may fail (even though they won't) means that users 
will have to deal with errors in potentially tricky situations.

Amaury, any comments?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue10805] traceback.print_exception throws AttributeError when exception is None

2012-02-23 Thread Giovanni Funchal

Giovanni Funchal  added the comment:

This bug affects me, found it when migrating from 2.7 to 3.2, in a function 
calling traceback.print_exc() called while there were no "active" exception 
being handled. Previous behavior was to print "None".

--
nosy: +Giovanni.Funchal

___
Python tracker 

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



[issue13873] SIGBUS in test_big_buffer() of test_zlib on Debian bigmem buildbot

2012-02-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

"""
File 
"/var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/test_zlib.py", 
line 96 in test_big_buffer
"""

The SIGBUS could be due to the buildbot running out of tmpfs.

--
nosy: +neologix

___
Python tracker 

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



[issue13779] os.walk: bottom-up

2012-02-23 Thread patrick vrijlandt

patrick vrijlandt  added the comment:

Good solution. +1 for closing.

Patrick

--

___
Python tracker 

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