[issue14026] test_cmd_line_script should include more sys.argv checks

2012-04-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 22f0044ea366 by Nick Coghlan in branch '3.2':
Close issue #14026 by better testing sys.argv handling in test_cmd_line_script 
(patch by Jason Yeo)
http://hg.python.org/cpython/rev/22f0044ea366

New changeset ff6593aa8376 by Nick Coghlan in branch 'default':
Resolve #14026 (Merge from 3.2)
http://hg.python.org/cpython/rev/ff6593aa8376

--
nosy: +python-dev

___
Python tracker 

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



[issue14026] test_cmd_line_script should include more sys.argv checks

2012-04-22 Thread Nick Coghlan

Changes by Nick Coghlan :


--
resolution:  -> fixed
stage: test needed -> committed/rejected
status: open -> closed
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



[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Eric Snow

Eric Snow  added the comment:

Ported _imp.reload() (Python/import.c) to Lib/imp.py.  Included is the change 
to PyImport_ReloadModule() to make it simply a wrapper around the pure Python 
imp.reload().  There's a good chance I don't have this right or that I have 
some reference leak.  I haven't worked a ton on the C side of Python (sounds 
tropical).  This patch also removes 'modules_reloading' from the interpreter 
state, since it's no longer used anywhere (see issue14618).

--
Added file: http://bugs.python.org/file25302/issue13959_reload.diff

___
Python tracker 

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



[issue14618] remove modules_reloading from the interpreter state

2012-04-22 Thread Eric Snow

Eric Snow  added the comment:

patch added to issue13959.

--

___
Python tracker 

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



[issue14610] configure script hangs on pthread verification and PTHREAD_SCOPE_SYSTEM verification on Ubuntu

2012-04-22 Thread Charles-François Natali

Charles-François Natali  added the comment:

Could you please run:
$ sh -x ./configure

to see what's going on.

It might also be interesting to have the output of
$ strace -f ./configure

Thanks.

--
nosy: +neologix

___
Python tracker 

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



[issue14643] Security page out of date

2012-04-22 Thread Antoine Pitrou

New submission from Antoine Pitrou :

http://www.python.org/news/security/ is completely out of date.
Also, the release pages (e.g. http://www.python.org/download/releases/2.7.3/) 
don't make it clear which versions are affected by the security issues.

--
components: None
messages: 158954
nosy: barry, benjamin.peterson, georg.brandl, loewis, pitrou
priority: normal
severity: normal
status: open
title: Security page out of date

___
Python tracker 

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



[issue14643] Security page out of date

2012-04-22 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue14591] Value returned by random.random() out of valid range on 64-bit

2012-04-22 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Value returned by random.random() out of valid range -> Value returned 
by random.random() out of valid range on 64-bit

___
Python tracker 

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



[issue14642] Fix importlib.h build rule to not depend on hg

2012-04-22 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
title: Fix imoprtlib.h build rule to not depend on hg -> Fix importlib.h build 
rule to not depend on hg

___
Python tracker 

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



[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Eric Snow

Eric Snow  added the comment:

A patch for magic and tag.  It's not quite finished, but I wanted to see if the 
approach was palatable.  FYI, I'm also trying to push forward the 
sys.implementation stuff, which would help on the pyc tag.

--
Added file: http://bugs.python.org/file25303/issue13959_magic.diff

___
Python tracker 

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



[issue14642] Fix importlib.h build rule to not depend on hg

2012-04-22 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
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-04-22 Thread Vinay Sajip

Vinay Sajip  added the comment:

I believe Dan meant that the behaviour of shlex.split() now is different from 
what it was when he first raised the issue (in July 2006). Looking at the 
default branch of CPython, this is what I see:

Python 3.3.0a2+ (default:ff6593aa8376, Apr 22 2012, 12:39:08) 
[GCC 4.3.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import shlex
>>> list(shlex.shlex('e;'))
['e', ';']
>>> list(shlex.shlex(">'abc';"))
['>', "'abc'", ';']

Likewise, on the 2.6 branch:

Python 2.6.8+ (unknown, Apr 22 2012, 12:44:43) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import shlex
>>> list(shlex.shlex('e;'))
['e', ';']
>>> list(shlex.shlex(">'abc';"))
['>', "'abc'", ';']

So from what Dan is saying, it would seem that he is saying that shlex 
behaviour (before my patch being applied) is different now to how he remembers 
it - not that the patch introduces any incompatibility.

Still, another set of eyeballs on the patch would be good.

--

___
Python tracker 

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



[issue14644] test_logging failure on OS X Tiger

2012-04-22 Thread Antoine Pitrou

New submission from Antoine Pitrou :

test_logging always fails on the OS X Tiger buildbot:

http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/smtplib.py", line 365, 
in getreply
line = self.file.readline()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/socket.py", line 297, 
in readinto
return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/logging/handlers.py", 
line 930, in emit
smtp = smtplib.SMTP(self.mailhost, port, timeout=self.timeout)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/smtplib.py", line 238, 
in __init__
(code, msg) = self.connect(host, port)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/smtplib.py", line 319, 
in connect
(code, msg) = self.getreply()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/smtplib.py", line 369, 
in getreply
+ str(e))
smtplib.SMTPServerDisconnected: Connection unexpectedly closed: timed out
Logged from file , line 0
test test_logging failed
ok

==
FAIL: test_basic (test.test_logging.SMTPHandlerTest)
--
Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_logging.py", 
line 941, in test_basic
self.assertTrue(self.handled.is_set())
AssertionError: False is not true

--
assignee: vinay.sajip
components: Library (Lib), Tests
messages: 158957
nosy: pitrou, vinay.sajip
priority: normal
severity: normal
status: open
title: test_logging failure on OS X Tiger
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue14644] test_logging failure on OS X Tiger

2012-04-22 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +db3l

___
Python tracker 

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



[issue14591] Value returned by random.random() out of valid range on 64-bit

2012-04-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The patch should probably come with an unit test.

--
nosy: +pitrou

___
Python tracker 

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



[issue14591] Value returned by random.random() out of valid range on 64-bit

2012-04-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

Patch with unit test. :-)

--

___
Python tracker 

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



[issue14474] mishandling of AttributeError in threads

2012-04-22 Thread Stefan Behnel

Stefan Behnel  added the comment:

Could the

while thread._count() > c:
pass

in test_thread.py be changed to this? (as used in other places)

while thread._count() > c:
time.sleep(0.01)

It currently hangs in Cython because it doesn't free the GIL during the plain C 
loop. (While that might be considered a bug in Cython, it's not what this test 
is supposed to test for.)

--
nosy: +scoder

___
Python tracker 

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



[issue14591] Value returned by random.random() out of valid range on 64-bit

2012-04-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

Dang.  Patch now attached.

--
Added file: http://bugs.python.org/file25304/random_jumpahead_4.patch

___
Python tracker 

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



[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2012-04-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

[Dirkjan]
> Could we reconsider ARM support at this time?

Note that it's just the Linux old ABI (OABI) that needs this patch;  ARM / 
Linux using the new family of ABIs (EABI) should be fine.  IIUC, this old ABI 
is being phased out, but I have no idea what the current real-world situation 
is here.

Maybe it's worth reopening a discussion on python-dev?  I'm not sure what the 
current policies are.

--

___
Python tracker 

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



[issue14532] multiprocessing module performs a time-dependent hmac comparison

2012-04-22 Thread Charles-François Natali

Charles-François Natali  added the comment:

> I have used the name "secure_compare" in the past for such a function. That
> said, I don't have strong feelings either way about the naming, so I'll
> yield to the others.

I prefer this name too.
Wait one day or two (to let others chime in if they want), and upload
a new patch with that change :-)

--

___
Python tracker 

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



[issue14643] Security page out of date

2012-04-22 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I fixed the 2.7.3 page.

--

___
Python tracker 

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



[issue14642] Fix importlib.h build rule to not depend on hg

2012-04-22 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue14642] Fix importlib.h build rule to not depend on hg

2012-04-22 Thread Brett Cannon

Brett Cannon  added the comment:

The thing should also do a sanity check on the syntax so as to minimize the 
chances of freezing code that has no chance of working.

--

___
Python tracker 

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



[issue10731] UnicodeDecodeError in OS X tkinter when binding to

2012-04-22 Thread Kevin Walzer

Kevin Walzer  added the comment:

I've added some comments to this on the Tkinter-dev mailing list, but to 
summarize, the bug is not reproducible on the Tcl side of the bridge, and so I 
am not clear what changes can be made in Tk's internals. It might e better to 
proceed with implementing a fix in Tkinter because the bug seems to occur at 
the level of Tkinter/Tk interaction.

--
nosy: +wordtech

___
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-04-22 Thread Brett Cannon

Brett Cannon  added the comment:

To note:

_frozen_importlib is a CPython implementation detail

--

___
Python tracker 

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



[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Eric Snow

Eric Snow  added the comment:

After thinking about it, is MAGIC an implementation detail?  It certainly 
reflects changes specific to the CPython interpreter.  I'm much more 
comfortable with leaving implementation details in Python/import.c.

On the other hand, there's already no small amount of rather CPython-specific 
stuff in Lib/importlib/_bootstrap.py, which belongs there.  The pyc magic bytes 
are tightly coupled with it.  Because of that, I realize, I'm still fine with 
the patch.

But it makes me wonder if it might be worth having a clear separation between 
the general and CPython-specific stuff in _bootstrap.py, for the sake of people 
who look at the code for the first (or tenth) time.  That's the same rationale 
I have for advocating moving as much over from import.c as relates to the 
importlib implementation.

--

___
Python tracker 

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



[issue14642] Fix importlib.h build rule to not depend on hg

2012-04-22 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

What do you mean by "sanity check on the syntax"? The current Makefile rule to 
build importlib.h already checks the syntax of _bootstrap.py, and fails if 
there is a syntax error.

--

___
Python tracker 

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



[issue14642] Fix importlib.h build rule to not depend on hg

2012-04-22 Thread Brett Cannon

Brett Cannon  added the comment:

On Sun, Apr 22, 2012 at 12:43, Martin v. Löwis wrote:

>
> Martin v. Löwis  added the comment:
>
> What do you mean by "sanity check on the syntax"? The current Makefile
> rule to build importlib.h already checks the syntax of _bootstrap.py, and
> fails if there is a syntax error

That's true, so ignore my comment. =)

--

___
Python tracker 

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



[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4e853913054c by Brett Cannon in branch 'default':
Issue #13959: Continue to try to accomodate altsep in importlib by not
http://hg.python.org/cpython/rev/4e853913054c

--

___
Python tracker 

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



[issue14642] Fix importlib.h build rule to not depend on hg

2012-04-22 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Also, what's the issue with a shell script? The current Makefile will rebuild 
importlib.h if its time stamp is older than the one of _bootstrap.py. That will 
fail if ./python was not build.

So what is the problem to solve?

--

___
Python tracker 

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



[issue1346572] Remove inconsistent behavior between import and zipimport

2012-04-22 Thread Éric Araujo

Changes by Éric Araujo :


--
resolution:  -> wont fix
stage: needs patch -> committed/rejected
status: open -> closed
versions:  -Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue14622] Python http.server is dead slow using gethostbyaddr/getfqdn for each request

2012-04-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset fe66fb61f199 by Vinay Sajip in branch 'default':
Issue #14622: Increased default timeout for SMTPHandler.
http://hg.python.org/cpython/rev/fe66fb61f199

--
nosy: +python-dev

___
Python tracker 

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



[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2012-04-22 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

This issue remains as "won't fix". ARM is supported; just OABI is not, and 
never will be. If anybody needs that, they will have to maintain their own fork 
of Python.

--

___
Python tracker 

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



[issue14644] test_logging failure on OS X Tiger

2012-04-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset bdbcb8f48ddd by Vinay Sajip in branch 'default':
Issue #14644: Increased default timeout for SMTPHandler. Note: last commit 
message referred to the wrong issue number.
http://hg.python.org/cpython/rev/bdbcb8f48ddd

--
nosy: +python-dev

___
Python tracker 

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



[issue14622] Python http.server is dead slow using gethostbyaddr/getfqdn for each request

2012-04-22 Thread Vinay Sajip

Changes by Vinay Sajip :


--
Removed message: http://bugs.python.org/msg158973

___
Python tracker 

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



[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-22 Thread Vinay Sajip

Vinay Sajip  added the comment:

There's certainly a problem to be addressed here, but integrating the test into 
the regular test suite represents a problem in that the test takes around 10 
minutes to run, and sometimes completes successfully. I'm not sure a 10-minute 
extension of the time taken to run regrtest will be acceptable, but if the test 
is skipped unless explicitly enabled, then I'm not sure it'll add much value.

I will look at the patch and Charles-François' review comments soon.

--

___
Python tracker 

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



[issue14642] Fix importlib.h build rule to not depend on hg

2012-04-22 Thread Brett Cannon

Brett Cannon  added the comment:

I don't quite follow. I have no issue with a shell script verifying things  by 
doing an `hg status` to verify certain truths (or something). I said a shell 
*or* Python script to begin with.

--

___
Python tracker 

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



[issue14645] Generator does not translate linesep characters in certain circumstances

2012-04-22 Thread R. David Murray

New submission from R. David Murray :

I ran into this while translating a test, but it turns out it is a long 
standing problem.  I presume it has not been an issue because in general in 
Python2 email messages are read as text with universal newline support, and 
thus the linesep characters get translated on *read*, and the problem in 
Generator never shows up.  In python3, however, we will often read messages as 
binary, which will preserve the existing linesep characters, and expose the 
Generator bug.  

This isn't a critical bug for Python3 only because if a message is read in 
binary it will likely be written in binary using \r\n linesep, in which case 
the right thing will be happening.  Likewise most messages read from disk will 
be written to disk.  But it should be fixed so that the cases where a message 
is read in binary and written to disk in text and vice versa are correctly 
formatted.  (In particular, uses of the new smtplib.send_message could 
theoretically run in to this, though I haven't tested to see if that is really 
a problem.)

To reproduce, read data/msg_26.txt from the email test suite in binary mode (or 
text mode using "linesep='\n'", which will preserve the crlf in that file), and 
run str on the resulting message.  You'll see that the MIME preamble and the 
base64 part both have \r\n linesep, instead of the default '\n' linesep used 
for the rest of the message.

--
assignee: r.david.murray
messages: 158978
nosy: r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: Generator does not translate linesep characters in certain circumstances
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-22 Thread JohnM

JohnM  added the comment:

Thank you both for looking at this. I've added an updated version of the patch 
that incorporates the last two suggestions that Charles-François made.

I agree that this test may not be appropriate for the python test suite, due to 
the length and non-determinism of the test. I don't know what the suite's 
policy on monkey patching stdlib in the tests is, but monkey patching either 
os.path.exists or os.stat to remove the file at the appropriate time could be 
one way to make the test fast and deterministic. Seems a bit dirty to me 
though. :-)
 
I am up for adding some kind of test to the suite for the WatchedFileHandler, 
though.

I'm pretty ambivalent about keeping the whole stat structure around, since the 
samestat method is just a wrapper around what the emit function is already 
doing, and we'd be keeping more memory (although a small amount) around. I 
doubt we'd want to look at the timestamps because they could legitimately 
change in ways this check doesn't care about.

--
Added file: http://bugs.python.org/file25305/watchedfilehandler.patch

___
Python tracker 

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



[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-22 Thread Charles-François Natali

Charles-François Natali  added the comment:

> There's certainly a problem to be addressed here, but integrating the test 
> into the regular test suite represents a problem in that the test takes 
> around 10 minutes to run, and sometimes completes successfully. I'm not sure 
> a 10-minute extension of the time taken to run regrtest will be acceptable, 
> but if the test is skipped unless explicitly enabled, then I'm not sure it'll 
> add much value.

There's no reason to wait for 10 minutes: one can reduce the number of
iterations greatly, so that it can run in a matter of seconds. Since
the test is run by all the builders multiple times per day, should the
race condition resurface, it will trigger a buildbot failure some day.
No need for it to trigger a failure every time.

--

___
Python tracker 

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



[issue14423] Getting the starting date of iso week from a week number and a year.

2012-04-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

> Ok so now i only get errors for "_Fast" tests
> am I correct in assuming that this is because i lack a C implementation?

If your errors look like the one below, then yes.


==
ERROR: test_from_iso_week_value_week (test.datetimetester.TestDate_Fast)
--
Traceback (most recent call last):
  File "/Users/mdickinson/Python/cpython/Lib/test/datetimetester.py", line 
1000, in test_from_iso_week_value_week
self.assertRaises(ValueError, self.theclass.from_iso_week, year,
AttributeError: type object 'datetime.date' has no attribute 'from_iso_week'

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue14632] Race condition in WatchedFileHandler leads to unhandled exception

2012-04-22 Thread Vinay Sajip

Vinay Sajip  added the comment:

John: Thanks for the updated patch.

Charles-François: Certainly I can reduce the iterations to make the test 
faster. As it is, I did reproduce the failure on my dev system, but only once, 
after running John's test script about a dozen times: every other time, it 
completed successfully :-(

Isn't it simpler if I just replace the os.path.exists() calls with os.stat(), 
and check for ENOENT if an exception of type OSError or WindowsError occurs?

--

___
Python tracker 

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



[issue14605] Make import machinery explicit

2012-04-22 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue14646] Require loaders set __loader__ and __package__

2012-04-22 Thread Brett Cannon

New submission from Brett Cannon :

As discussed and agreed to on python-dev, it makes sense to require loaders to 
set __loader__ and __package__ so that they can be relied upon by globally 
executed code in a module.

The following needs to happen to close this bug:

* Update PEP 302 to say __loader__ is required, not optional
* Update PEP 366 to say __package__ is required
* Update PEP 302 to point to PEP 366 and mention the requirement
* Update importlib.util.module_for_loader to set both __loader__ and __package__
* Update importlib.util.set_loader and importlib.util.set_package to point out 
that module_for_loader supercedes those decorators
* Update importlib._bootstrap to set __loader__ when it is absent

--
assignee: brett.cannon
components: Interpreter Core
messages: 158983
nosy: brett.cannon
priority: release blocker
severity: normal
stage: test needed
status: open
title: Require loaders set __loader__ and __package__
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-04-22 Thread Brett Cannon

Changes by Brett Cannon :


--
dependencies: +Make import machinery explicit

___
Python tracker 

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



[issue13857] Add textwrap.indent() as counterpart to textwrap.dedent()

2012-04-22 Thread Michael . Elsdörfer

Changes by Michael.Elsdörfer :


--
nosy: +elsdoerfer

___
Python tracker 

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



[issue14646] Require loaders set __loader__ and __package__

2012-04-22 Thread Eric Snow

Eric Snow  added the comment:

Yeah, that patch for reload() in issue13959 relies on this.

--
nosy: +eric.snow

___
Python tracker 

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



[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Brett Cannon

Brett Cannon  added the comment:

First off, you should separate the patches for get_magic() and get_tag(). 
Second, why is there _get_pyc_magic_int() when it is never called? Third, all 
of this would be greatly simplified if you just had a _RAW_MAGIC_NUMBER of 
3220, did the bytes object creation for _MAGIC_NUMBER in-place (i.e. no 
separate function), and then in the C code just got _RAW_MAGIC_NUMBER and did 
the MAGIC macro work there.

As for what is CPython-specific and what isn't, only the other VMs can state 
that officially, so I'm not going to worry about that yet (but I will ask 
before Python 3.3 goes out so as to minimize backporting patches in the 
future). But importlib needs to stabilize more before that can happen.

--

___
Python tracker 

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



[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Eric Snow

Eric Snow  added the comment:

Good feedback.  The some of that code was the result of directly translating 
the C.  I'll get a new, simpler patch up probably tomorrow night.  Thanks.

--

___
Python tracker 

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



[issue14423] Getting the starting date of iso week from a week number and a year.

2012-04-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

By the way, I don't think the algorithm used in the current patch is correct.  
For 'date.from_iso_week(2009, 1)' I get 2009/1/1, which was a Thursday.  The 
documentation seems to indicate that a Monday should be returned.

--

___
Python tracker 

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



[issue14646] Require loaders set __loader__ and __package__

2012-04-22 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue14643] Security page out of date

2012-04-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I fixed the 2.7.3 page.

Hmm, I think the changes don't really help: the page now states that 2.7.2 is 
affected, but the reader doesn't know whether previous versions (at least on 
the 2.7 branch) were also affected.

--

___
Python tracker 

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



[issue14423] Getting the starting date of iso week from a week number and a year.

2012-04-22 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Mark Dickinson wrote:
> 
> By the way, I don't think the algorithm used in the current patch is correct. 
>  For 'date.from_iso_week(2009, 1)' I get 2009/1/1, which was a Thursday.  The 
> documentation seems to indicate that a Monday should be returned.

True, the correct date is 2008-12-29.

--

___
Python tracker 

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



[issue14423] Getting the starting date of iso week from a week number and a year.

2012-04-22 Thread Esben Agerbæk Black

Esben Agerbæk Black  added the comment:

I somehow re-uploaded an old patch,
this one contains buggy c-code, but fixes the python implementation.

Any pointers to how to get started on the c bi would be greatly appreciated.

--
Added file: http://bugs.python.org/file25306/isodates.patch

___
Python tracker 

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



[issue14642] Fix importlib.h build rule to not depend on hg

2012-04-22 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

My point is: ISTM that everything is already as it should be, I can see no 
problem in the status quo. If there is a problem, can you please rephrase it? 
If you want a shell script just to have one, here is one

#!/bin/sh
make Python/importlib.h

--

___
Python tracker 

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



[issue14642] Fix importlib.h build rule to not depend on hg

2012-04-22 Thread Brett Cannon

Brett Cannon  added the comment:

No, I don't want a shell script just to have one. =)

The status quo seems to work, but people like Georg think it's partially luck 
that it does and if hg changes its semantics that will cause us trouble.

--

___
Python tracker 

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



[issue14647] imp.reload() on a package leads to a GC assertion failure

2012-04-22 Thread Brett Cannon

New submission from Brett Cannon :

> ./python.exe -c "import urllib.parse as x; import imp; imp.reload(x)"
Assertion failed: (gc->gc.gc_refs != 0), function visit_decref, file 
Modules/gcmodule.c, line 327.
zsh: abort  ./python.exe -c "import urllib.parse as x; import imp; 
imp.reload(x)"

I even triggered a segfault that I can't reproduce.

--
components: Library (Lib)
messages: 158993
nosy: brett.cannon
priority: release blocker
severity: normal
stage: test needed
status: open
title: imp.reload() on a package leads to a GC assertion failure
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



[issue14647] imp.reload() on a package leads to a segfault or a GC assertion failure

2012-04-22 Thread Brett Cannon

Brett Cannon  added the comment:

Segfault:

> ./python.exe -c "import importlib.abc as x; import imp; imp.reload(x)"
>  
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 611, in load_module
  File "", line 271, in module_for_loader_wrapper
  File "", line 499, in _load_module
  File "/Users/bcannon/Developer/repo/cpython/py3k/Lib/importlib/abc.py", line 
2, in 
from . import _bootstrap
ImportError: cannot import name _bootstrap
zsh: segmentation fault  ./python.exe -c "import importlib.abc as x; import 
imp; imp.reload(x)"

--
title: imp.reload() on a package leads to a GC assertion failure -> 
imp.reload() on a package leads to a segfault or a GC assertion failure
type:  -> crash

___
Python tracker 

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



[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Eric Snow

Eric Snow  added the comment:

How consistent do the semantics of reload() need to remain?  (The C version 
does more type checking than the Python version probably needs to worry about.  
reload() seems to be one of those bits that doesn't have much test coverage.)

Also, what's the best way to exercise the changes one makes to the C code?

--

___
Python tracker 

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



[issue14605] Make import machinery explicit

2012-04-22 Thread Brett Cannon

Brett Cannon  added the comment:

Attached is my (failing) attempt at making import explicit. Unfortunately I 
have four failing tests, 3 of which revolve around __main__ (which is why I 
added Nick to see if he had any ideas):

test_cmd_line_script test_runpy test_threaded_import test_zipimport_support

--

___
Python tracker 

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



[issue14605] Make import machinery explicit

2012-04-22 Thread Brett Cannon

Changes by Brett Cannon :


--
keywords: +patch
Added file: http://bugs.python.org/file25307/explicit.diff

___
Python tracker 

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



[issue14605] Make import machinery explicit

2012-04-22 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue14605] Make import machinery explicit

2012-04-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1da623513b26 by Brett Cannon in branch 'default':
Issue #14605: Expose importlib.abc.FileLoader and
http://hg.python.org/cpython/rev/1da623513b26

--
nosy: +python-dev

___
Python tracker 

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



[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Brett Cannon

Brett Cannon  added the comment:

Loosening the type restrictions is fine.

As for testing, that's what the test suite is supposed to do. So if need be 
just write tests in Python that exercise the C code.

--

___
Python tracker 

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



[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Brett Cannon

Brett Cannon  added the comment:

To try and narrow down the issue, I now have separate patches for an explicit 
sys.meta_path and a sys.path_hooks. Both fail on tests, but for different 
reasons.

The explicit sys.meta_path is still failing on the __main__ issue on three of 
the tests and for threaded imports on the other.

The explicit sys.path_hooks patch fails on two tests: one on threading and  
then test_cmd_line_script on apparently lacking an absolute file path thanks to 
issue #8202 (and why an explicit sys.path_hooks triggers that I don't know).

Both failures Nick might know about.

--
Added file: http://bugs.python.org/file25308/explicit_meta_path.diff

___
Python tracker 

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



[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Brett Cannon

Changes by Brett Cannon :


Added file: http://bugs.python.org/file25309/explicit_path_hooks.diff

___
Python tracker 

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



[issue3177] Add shutil.open

2012-04-22 Thread Hobs

Hobs  added the comment:

@eric.araujo, @giampaolo.rodola, 
(http://bugs.python.org/issue3177#msg140275)

I'm not sure I understand why this was moved to shutil.open. It seems 
appropriate to try to accomplish what os.startfile() does in a cross-platform 
way. Don't many of the other os.* calls do this--check os.name and then "do the 
right thing". This is the first os.* call I've found that doesn't work on linux 
(though I'm sure there are many others). Is the reason because the name 
'startfile' is a Windows creation and sounds Windowsy? If so, shouldn't 
os.startfile() be renamed to something generic like os.launch() or 
.launchfile()? But then you'd have reverse-compatibility issues. 

Why not just enhance os.startfile() so it doesn't barf if you try to use it on 
posix/mac? I'll try to contribute to the shutil.open() effort too.

--
nosy: +Hobson.Lane

___
Python tracker 

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