[issue13315] tarfile extract fails on OS X system python due to chown of gid=-1

2011-11-02 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

There's little chance that Apple will fix this issue in their build (at least 
not until Lion+1 gets released) because this is not a security bug. Their 
breaking of 2.7 in Lion is probably due to lack of review for their collection 
of patches, and is not something we can fix.

I'd close this as invalid as the issue is already fixed in our codebase.

I won't file a bug at Apple for this, although that shouldn't stop anyone else 
from doing so (and remember: bugreport.apple.com is a popularity contest, the 
more people file an report about a bug the more likely it is that it will get 
fixed)

--
status: pending -> open

___
Python tracker 

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



[issue13330] Attempt full test coverage of LocaleTextCalendar.formatweekday

2011-11-02 Thread Sean Fleming

New submission from Sean Fleming :

Patch includes new statements in test_localecalendars of CalendarTestCase such 
that coverage of LocaleTextCalendar.formatweekday should improve significantly. 

Feedback is appreciated.

--
components: Tests
files: test_calendar.patch
keywords: patch
messages: 146895
nosy: Sean.Fleming
priority: normal
severity: normal
status: open
title: Attempt full test coverage of LocaleTextCalendar.formatweekday
versions: Python 3.4
Added file: http://bugs.python.org/file23603/test_calendar.patch

___
Python tracker 

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



[issue13327] Update utime API to not require explicit None argument

2011-11-02 Thread Brian Curtin

Brian Curtin  added the comment:

The `delta` keyword would actually be better than `places`, especially on the 
slower buildbots. delta=10 would allow up to 10 seconds between those utime 
calls. Is that being too permissive?

--

___
Python tracker 

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



[issue13329] Runs normal as console script but falls as CGI

2011-11-02 Thread Nick Rowan

New submission from Nick Rowan :

There is a Python script that tries to print a message in Russian language. 
It's okay when script runs in console, but it causes DecodeUnicodeError if it 
invokes as CGI.

--
components: Interpreter Core, Library (Lib), Unicode
files: Test.py
messages: 146893
nosy: Nick.Rowan, ezio.melotti
priority: normal
severity: normal
status: open
title: Runs normal as console script but falls as CGI
type: behavior
versions: 3rd party, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file23602/Test.py

___
Python tracker 

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



[issue13327] Update utime API to not require explicit None argument

2011-11-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I would specify an even smaller "places". We have very slow buildbots.
You could first call utime() with a date far away in the past if you want.

--

___
Python tracker 

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



[issue13327] Update utime API to not require explicit None argument

2011-11-02 Thread Brian Curtin

Brian Curtin  added the comment:

Ah, yes. Would the following work better for the last line?

self.assertAlmostEqual(st1.st_mtime, st2.st_mtime, places=2)

--

___
Python tracker 

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



[issue13298] Result type depends on order of operands for bytes and bytearray

2011-11-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I think the current behaviour is fine, in that the alternatives are not better 
at all. In the absence of a type inherently "superior" to the others (as float 
can be to int, except for very large integers :-)), it makes sense to keep the 
type of the left-hand argument.

Note that .join() has a slightly different behaviour:

>>> b"".join([bytearray(), b""])
b''
>>> bytearray().join([bytearray(), b""])
bytearray(b'')
>>> b"".join([bytearray(), memoryview(b"")])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: sequence item 1: expected bytes, memoryview found

--
nosy: +pitrou

___
Python tracker 

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



[issue13327] Update utime API to not require explicit None argument

2011-11-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

You have a possible failure here: 

+# Set to the current time in the old explicit way.
+os.utime(support.TESTFN, None)
+st1 = os.stat(support.TESTFN)
+# Set to the current time in the new way
+os.utime(support.TESTFN)
+st2 = os.stat(support.TESTFN)
+self.assertEqual(st1.st_mtime, st2.st_mtime)

I managed to trigger it after a run of tests:

==
FAIL: test_utime_noargs (test.test_os.StatAttributeTests)
--
Traceback (most recent call last):
  File "/home/antoine/cpython/default/Lib/test/test_os.py", line 286, in 
test_utime_noargs
self.assertEqual(st1.st_mtime, st2.st_mtime)
AssertionError: 1320285959.712339 != 1320285959.7133389


Otherwise, +1.

--
nosy: +pitrou

___
Python tracker 

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



[issue13311] asyncore handle_read should call recv

2011-11-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +giampaolo.rodola, josiahcarlson, neologix, stutzbach
stage:  -> patch review
versions: +Python 3.2

___
Python tracker 

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



[issue13314] ImportError ImportError: Import by filename, should be deferred until sys.meta_path hooks are processed

2011-11-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +brett.cannon, ncoghlan

___
Python tracker 

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



[issue13325] no address in the representation of asyncore dispatcher after connection established

2011-11-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +giampaolo.rodola, josiahcarlson, stutzbach
stage:  -> patch review
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



[issue13307] bdist_rpm: INSTALLED_FILES does not use __pycache__

2011-11-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 2c0253d4d9ba by Antoine Pitrou in branch '3.2':
Issue #13307: fix bdist_rpm test failures
http://hg.python.org/cpython/rev/2c0253d4d9ba

New changeset eb2991f7cdc8 by Antoine Pitrou in branch 'default':
Issue #13307: fix bdist_rpm test failures
http://hg.python.org/cpython/rev/eb2991f7cdc8

--
nosy: +python-dev

___
Python tracker 

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



[issue13307] bdist_rpm: INSTALLED_FILES does not use __pycache__

2011-11-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Should be fixed now (verified here on Mageia).

--
dependencies:  -distutils doesn't byte-compile .py files to __pycache__ during 
installation
nosy: +pitrou
resolution:  -> fixed
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



[issue13328] pdb shows code from wrong module

2011-11-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +brett.cannon, georg.brandl, ncoghlan

___
Python tracker 

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



[issue13328] pdb shows code from wrong module

2011-11-02 Thread Arkadiusz Wahlig

Arkadiusz Wahlig  added the comment:

How to reproduce:

Given a module foo.py imported using zipimport with a function bar, if we try 
to set a breakpoint in bar using:

> break foo.bar

pdb would take filename and lineno from the function object but would use 
current frame to get module globals.

linecache would return a line from current module but also store it in cache 
under foo's filename.

--

___
Python tracker 

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



[issue13328] pdb shows code from wrong module

2011-11-02 Thread Arkadiusz Wahlig

New submission from Arkadiusz Wahlig :

If pdb is used to debug code using zipimport, it may end up displaying source 
code from wrong module. Python will execute the correct code but the source 
code lines displayed by pdb (including the "list" command) will come from an 
unrelated module.

Reason:

The pdb obtains lines of code using the linecache module. When used with 
zipimported modules, linecache requires the module's globals dict to be passed 
in along with the filename. The filename is then used as a cache key for future 
lookups.

A bug in pdb causes it to pass filename and globals from different modules when 
calling linecache thus polluting the cache with bogus data.

A patch for 2.7.2 is attached that fixes the problem.

The patch also fixes another problem:

When Bdb (Pdb parent class from bdb.py) calls linecache, it calls 
Bdb.canonic(filename) before passing the filename to it. It doesn't pass the 
module's globals though. This isn't a problem because the call is always made 
after Pdb has queried source lines for the same module (and it does pass the 
globals). However, because Pdb doesn't call Bdb.canonic() on the filename, the 
cache key is different and Bdb's call fails.

To fix this, the patch adds calls to Bdb.canonic(filename) whenever Pdb passes 
a filename to linecache.

--
files: pdb.diff
keywords: patch
messages: 146885
nosy: yak
priority: normal
severity: normal
status: open
title: pdb shows code from wrong module
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file23601/pdb.diff

___
Python tracker 

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



[issue13327] Update utime API to not require explicit None argument

2011-11-02 Thread Brian Curtin

New submission from Brian Curtin :

os.utime currently requires an explicit `None` as the second argument in order 
to update to the current time. Other APIs would just have the second argument 
as optional in this case, operating with one argument.

Attached is a patch which changes the second argument to accept the time tuple, 
`None`, or literally nothing. Tested on Windows and Mac.

If this is acceptable, I'll make the same change for futimes, lutimes, and 
futimens.

--
assignee: brian.curtin
components: Library (Lib)
files: utime.diff
keywords: needs review, patch
messages: 146884
nosy: brian.curtin
priority: normal
severity: normal
stage: patch review
status: open
title: Update utime API to not require explicit None argument
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file23600/utime.diff

___
Python tracker 

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



[issue13326] make clean failed on OpenBSD

2011-11-02 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



[issue13326] make clean failed on OpenBSD

2011-11-02 Thread Remi Pointel

Remi Pointel  added the comment:

FYI I tested with Python 3.3, but I didn't look for 2.7 and 3.2, I think 
modifications are also needed.

--

___
Python tracker 

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



[issue13326] make clean failed on OpenBSD

2011-11-02 Thread Remi Pointel

New submission from Remi Pointel :

Hi,

"make clean" failed on OpenBSD with this error:

find: -exec: no terminating ";"
*** Error code 1 (ignored)

It seems that "-exec" with "+" is a GNU extension.

Are you OK with this diff which does the same and is multi-platform?
Modifications can only be done for __pycache__, what do you prefer?

Cheers,

Remi.

--
files: python3_3_Makefile_pre_in
messages: 146882
nosy: pitrou, rpointel
priority: normal
severity: normal
status: open
title: make clean failed on OpenBSD
Added file: http://bugs.python.org/file23599/python3_3_Makefile_pre_in

___
Python tracker 

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



[issue13303] Sporadic importlib failures: FileNotFoundError on os.rename()

2011-11-02 Thread Charles-François Natali

Charles-François Natali  added the comment:

> So Python starts by removing the .tmp file, but it fails if another 
> process is already writing into the .tmp file. In this case, we do 
> nothing, which is not a problem: the other process will create the 
> file.

unlink() does not fail, even if the file is open by another process with O_EXCL!
Therefore there's a race:
- process 1 opens file.tmp
- process 2 unlinks file.tmp
- process 2 opens file.tmp: this succeeds, since he just removed the file 
opened by proc 1
- process 1, which was working on its deleted file handle, is done, and renames 
file.tmp to file: except that it rename the file process 2 is in the middle of 
writing
- game over, file corrupted

> Attached patch implements the same algorithm than import.c in 
> importlib. 

Same race.


The current implementations are safe, both Python/import.c and 
Lib/importlib/_bootstrap.py
The only problem is that since import.c uses mkstemp, the file is created with 
mode 0600.

--

___
Python tracker 

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



[issue10570] curses.tigetstr() returns bytes, but curses.tparm() expects a string

2011-11-02 Thread STINNER Victor

STINNER Victor  added the comment:

"I don't believe that the first parameter to tparm() (the format string) is 
ever constructed by hand, because it's terminal specific. The value is obtained 
from the terminfo database by calling tigetstr() instead. Furthermore, 
tigetstr() returns binary data, for which bytes is the only sane 
representation, and therefore tparm() should expect bytes instead of str."

Ok, it sounds to be fair. I wrote a patch based on yours (except that Python 
crashes with your patch :-)).

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue10570] curses.tigetstr() returns bytes, but curses.tparm() expects a string

2011-11-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e41663970ca5 by Victor Stinner in branch '3.2':
Issue #10570: curses.tigetstr() is now expecting a byte string, instead of a
http://hg.python.org/cpython/rev/e41663970ca5

New changeset ab11a6a73683 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #10570: curses.tigetstr() is now expecting a byte string,
http://hg.python.org/cpython/rev/ab11a6a73683

--
nosy: +python-dev

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2011-11-02 Thread sbt

sbt  added the comment:

BufferedReader.readinto() should also raise BlockingIOError according to the 
docs.  Updated unittest checks for that also.

BTW, The documentation for BufferedIOBase.read() says that BlockingIOError 
should be raised if nothing can be read in non-blocking mode.  BufferedReader 
inherits from BufferedIOBase and overrides the read() method.  This is the 
documentation for BufferedReader.read():

read([n])
Read and return n bytes, or if n is not given or negative, 
until EOF or if the read call would block in non-blocking mode.

This sentence is complete gobbledygook, and it makes no mention of what should 
happen if nothing can be read in non-blocking mode.   So I presume behaviour 
for BufferedReader.read() should match the documented behaviour for 
BufferedIOBase.read().

--
Added file: http://bugs.python.org/file23598/blockingioerror.py

___
Python tracker 

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



[issue13303] Sporadic importlib failures: FileNotFoundError on os.rename()

2011-11-02 Thread STINNER Victor

STINNER Victor  added the comment:

> 3) Fall back to the original ".tmp" suffix (with the risk
> of stale tmp file).

I missed something, what is the "stale tmp file" issue? Python/import.c uses:

(void) unlink(filename);
fd = open(filename, O_EXCL|O_CREAT|O_WRONLY|O_TRUNC ...);

So Python starts by removing the .tmp file, but it fails if another process is 
already writing into the .tmp file. In this case, we do nothing, which is not a 
problem: the other process will create the file.

Attached patch implements the same algorithm than import.c in importlib.

--
Added file: http://bugs.python.org/file23597/importlib_write_atomic.patch

___
Python tracker 

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



[issue13281] Make robotparser.RobotFileParser ignore blank lines

2011-11-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy:  -osvenskan

___
Python tracker 

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



[issue13320] _remove_visual_c_ref in distutils.msvc9compiler causes DLL load fail with embedded Python and multiple CRT versions

2011-11-02 Thread Mark Hammond

Mark Hammond  added the comment:

I can't explain why this might be happening given the Python dll is still build 
against vc9 - I'm guessing this can't be reproduced without vs10 in the mix?

Re making the feature optional - distutils doesn't really lend itself to 
customizing the compiler best I can tell - the only answer I know of here is to 
provide your own compiler sub-class and override manifest_get_embed_info to 
return the manifest filename.

--

___
Python tracker 

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



[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread David Fischer

David Fischer  added the comment:

I think the key words in the RFC are "strongest auth-scheme it understands". I 
think in an ideal world, the urllib2 opener (given its handlers) would see that 
it doesn't understand the second auth-scheme and then see if it understands the 
first one. However, the term "strongest" implies an ordering among the auth 
schemes.

--

___
Python tracker 

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



[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-02 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Review done after Charles-François review.

--

___
Python tracker 

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



[issue10570] curses.tigetstr() returns bytes, but curses.tparm() expects a string

2011-11-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

I'm not a curses expert, but after digging a while, I believe that I now 
understand what these functions are doing. tigetstr() returns a "format string" 
(bytes) and tparm() does substitutions and returns a command string (bytes) for 
the terminal.

I don't believe that the first parameter to tparm() (the format string) is ever 
constructed by hand, because it's terminal specific. The value is obtained from 
the terminfo database by calling tigetstr() instead. Furthermore, tigetstr() 
returns binary data, for which bytes is the only sane representation, and 
therefore tparm() should expect bytes instead of str.

Attached a patch that fixes this.

--
keywords: +needs review, patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file23595/issue10570.patch

___
Python tracker 

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



[issue13303] Sporadic importlib failures: FileNotFoundError on os.rename()

2011-11-02 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



[issue13285] signal module ignores external signal changes

2011-11-02 Thread Charles-François Natali

Charles-François Natali  added the comment:

>> Could it return an opaque wrapper object, rather than just the raw
>> address? Something like:
>
> Are you suggesting that it would return either a Python function object or a
> wrapper object?

I think it would be an ugly kludge. I don't like the idea of passing
around an opaque "blob" just for that purpose (I mean, it's really a
corner case).
So I'm -1.

--

___
Python tracker 

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



[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2011-11-02 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13281] Make robotparser.RobotFileParser ignore blank lines

2011-11-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

> My current suggested doc change is to replace the sentence quoted at the top 
> with

Sounds good to me.

--

___
Python tracker 

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



[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

So what do you propose to do? RFC 2617 specifies

   The user agent MUST choose to use one of the challenges with the 
   strongest auth-scheme it understands and request credentials from the 
   user based upon that challenge.

--

___
Python tracker 

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



[issue13321] fstat doesn't accept an object with "fileno" method

2011-11-02 Thread Eric V. Smith

Eric V. Smith  added the comment:

If I understand it correctly, this change request is to change os.fstat(obj) 
(and probably other functions) to call obj.fileno(), instead of the caller 
doing that?

If so, -1. Keep os.fstat() as a thin wrapper around fstat.

--
nosy: +eric.smith

___
Python tracker 

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



[issue13285] signal module ignores external signal changes

2011-11-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

> Could it return an opaque wrapper object, rather than just the raw address? 
> Something like:

Are you suggesting that it would return either a Python function object or a 
wrapper object?

--

___
Python tracker 

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



[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread David Fischer

David Fischer  added the comment:

Perhaps I should have chosen my words more carefully. There are two 
www-authenticate headers the single HTTP response.

--

___
Python tracker 

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



[issue13324] fcntl module doesn't support F_NOCACHE (OS X specific) results in high 'inactive' memory performance issues

2011-11-02 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> I ran into an application that responded with two www-authenticate
> challenges  to an HTTP request. First, it sends a standard Basic
> authentication challenge and then it also returns a www-authenticate
> header referencing another scheme. 

What exactly do you mean by "then"? In HTTP, there is only a single
response to a single request, so in what way does the server send
two responses to a single request?

--
nosy: +loewis
title: urllib2 does not correctly handle multiple www-authenticate headers in 
an HTTP response -> urllib2 does not correctly handle multiple
www-authenticate headers in an HTTP response

___
Python tracker 

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



[issue13308] fix test_httpservers failures when run as root

2011-11-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d1cde7081bf5 by Charles-François Natali in branch '2.7':
Issue #13308: Fix test_httpservers failures when run as root.
http://hg.python.org/cpython/rev/d1cde7081bf5

New changeset 4dc5590dbd0b by Charles-François Natali in branch '3.2':
Issue #13308: Fix test_httpservers failures when run as root.
http://hg.python.org/cpython/rev/4dc5590dbd0b

New changeset f2d3927a1165 by Charles-François Natali in branch 'default':
Issue #13308: Fix test_httpservers failures when run as root.
http://hg.python.org/cpython/rev/f2d3927a1165

--
nosy: +python-dev

___
Python tracker 

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



[issue13324] fcntl module doesn't support F_NOCACHE (OS X specific) results in high 'inactive' memory performance issues

2011-11-02 Thread Charles-François Natali

Changes by Charles-François Natali :


--
type: behavior -> feature request

___
Python tracker 

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



[issue13324] fcntl module doesn't support F_NOCACHE (OS X specific) results in high 'inactive' memory performance issues

2011-11-02 Thread Charles-François Natali

Charles-François Natali  added the comment:

> With this patch in place the inactive memory on my system stays (low)
> and flat, without it it rises until it maxes out all available memory
> and then starts paging.

It's often a desired behaviour: paging out unused memory makes room for a 
bigger page cache, which yields better performance. Also, it's a simple 
heuristic to know which pages are actually in use.
Linux has a systcl that can be used to tune the swap tendency (vm.swappiness).
Anyway, since it seems to improve performance under some workloads and it's 
just a constant, I've applied your patch.
Thanks!

--
nosy: +neologix
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type: resource usage -> behavior
versions: +Python 3.3 -Python 2.6, Python 2.7

___
Python tracker 

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



[issue13147] Multiprocessing Pool.map_async() does not have an error_callback parameter

2011-11-02 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Thanks for the report, Jakub and for the patch, Jyrki

--
nosy: +orsenthil
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue13147] Multiprocessing Pool.map_async() does not have an error_callback parameter

2011-11-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 37e34a983d6d by Senthil Kumaran in branch '2.7':
Fix Issue13147 - Correct the Multiprocessing Pool.map_async method signature.
http://hg.python.org/cpython/rev/37e34a983d6d

--
nosy: +python-dev

___
Python tracker 

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



[issue13324] fcntl module doesn't support F_NOCACHE (OS X specific) results in high 'inactive' memory performance issues

2011-11-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset cee6fdd6436d by Charles-François Natali in branch 'default':
Issue #13324: fcntlmodule: Add the F_NOCACHE flag. Patch by Alex Stewart.
http://hg.python.org/cpython/rev/cee6fdd6436d

--
nosy: +python-dev

___
Python tracker 

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



[issue13303] Sporadic importlib failures: FileNotFoundError on os.rename()

2011-11-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Thoughts?

I would say go for the simpler (that's probably option 3).

--

___
Python tracker 

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



[issue13303] Sporadic importlib failures: FileNotFoundError on os.rename()

2011-11-02 Thread Vinay Sajip

Vinay Sajip  added the comment:

What's the downside of option 2) ?

--
nosy: +vinay.sajip

___
Python tracker 

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



[issue13224] Change str(class) to return only the class name

2011-11-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Please also see the proposed PEP 3155 - 
http://mail.python.org/pipermail/python-ideas/2011-October/012609.html

--
nosy: +pitrou

___
Python tracker 

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



[issue13303] Sporadic importlib failures: FileNotFoundError on os.rename()

2011-11-02 Thread Vinay Sajip

Changes by Vinay Sajip :


--
resolution: fixed -> 

___
Python tracker 

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



[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-02 Thread Charles-François Natali

Charles-François Natali  added the comment:

I've done a review of your patch (looks like Rietveld doesn't send emails).

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue13295] Fix HTML produced by http.server

2011-11-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed, thanks for the report and the reviews!

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

___
Python tracker 

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



[issue13295] Fix HTML produced by http.server

2011-11-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 10823e7be085 by Ezio Melotti in branch 'default':
#13295: http.server now produces valid HTML 4.01 strict.
http://hg.python.org/cpython/rev/10823e7be085

--
nosy: +python-dev

___
Python tracker 

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



[issue13224] Change str(class) to return only the class name

2011-11-02 Thread Guido van Rossum

Guido van Rossum  added the comment:

On Wed, Nov 2, 2011 at 9:31 AM, Éric Araujo  wrote:
>
> Éric Araujo  added the comment:
>
> I’ve updated my patch to handle modules and functions too, but there is a 
> decision to make.  The functions of built-in modules are implemented by 
> methodobject.c, not functionobject.c (that’s for Python functions), so if we 
> want str(sys.exc_info) to be equal to 'exc_info', then we’ll have 
> str(dict.update) == 'update'.  Is this okay?

Hm, that doesn't seem right. Currently, str(sys.exc_info) says
 but str(dict.update) is . So the latter definitely knows that it is an
unbound method! And {}.update is  so that knows it is a bound method.

I'd be okay if str(sys.exc_info) and str({}.update) were unchanged
from today and if str(dict.update) returned 'dict.update', but if
that's too complicated I'd also be okay with all three being
unchanged, thus limiting this to Python functions (and classes and
modules).

--

___
Python tracker 

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



[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread dmitry be

Changes by dmitry be :


--
nosy: +Dmitry.Beransky

___
Python tracker 

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



[issue3173] external strftime for Python?

2011-11-02 Thread Éric Araujo

Éric Araujo  added the comment:

> Maybe rather than spending the effort maintaining a legacy API such as 
> strftime, someone could
> look into implementing localized date formatting as defined by recent Unicode 
> standards:
> http://unicode.org/reports/tr35/#Date_Format_Patterns

This scheme is very elegant.  I’d love to have built-in/stdlib support for it.  
Would it need to be implemented in C?

> Apparently there is a free implementation for Python out there:
> http://babel.edgewall.org/wiki/Documentation/dates.html#pattern-syntax

Babel just rocks :)

--
nosy: +eric.araujo

___
Python tracker 

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



[issue12629] HTMLParser silently stops parsing with malformed attributes

2011-11-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

I haven't found anything in the HTML5 spec but I haven't looked closely.
I'll do some more research when I'll start working on an actual patch.

--

___
Python tracker 

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



[issue13226] Expose RTLD_* constants in the posix module

2011-11-02 Thread STINNER Victor

STINNER Victor  added the comment:

sys.getdlopenflags() doc and docstring still contain references to ctypes and 
DLFCN module.

--

___
Python tracker 

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



[issue13295] Fix HTML produced by http.server

2011-11-02 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks.  +0.

--

___
Python tracker 

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



[issue13325] no address in the representation of asyncore dispatcher after connection established

2011-11-02 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
keywords: +patch
Added file: http://bugs.python.org/file23594/dispatcher_addr.diff

___
Python tracker 

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



[issue13325] no address in the representation of asyncore dispatcher after connection established

2011-11-02 Thread Xavier de Gaye

Changes by Xavier de Gaye :


Added file: http://bugs.python.org/file23593/dispatcher_addr.py

___
Python tracker 

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



[issue13325] no address in the representation of asyncore dispatcher after connection established

2011-11-02 Thread Xavier de Gaye

New submission from Xavier de Gaye :

When an asyncore dispatcher initiates a tcp connection, its
representation lacks the peer address. The output of the attached
script 'dispatcher_addr.py' gives on linux with Python 3.2:

call stack in handle_connect_event:
->main->loop->poll->write->handle_write_event->handle_connect_event
self.addr after connection: None


The attached patch fixes the problem. The patch includes a test case.
The following comment in the patch:

# EWOULDBLOCK may also be returned by winsock when calling connect
# while the connection attempt is in progress

refers to the following statement in
http://msdn.microsoft.com/en-us/library/aa923167.aspx

"""
As a result, it is not recommended that applications use multiple
calls to connect to detect connection completion. If they do, they
must be prepared to handle WSAEINVAL and WSAEWOULDBLOCK error codes
the same way that they handle WSAEALREADY to ensure robust execution.
"""


Note that two consecutive calls to
socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR) are made when
handle_write_event() is called and self.connected is False: one in
handle_write_event and the following right away in
handle_connect_event. This seems useless.

--
components: Library (Lib)
messages: 146849
nosy: xdegaye
priority: normal
severity: normal
status: open
title: no address in the representation of asyncore dispatcher after connection 
established
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue13307] bdist_rpm: INSTALLED_FILES does not use __pycache__

2011-11-02 Thread Éric Araujo

Changes by Éric Araujo :


--
dependencies: +distutils doesn't byte-compile .py files to __pycache__ during 
installation

___
Python tracker 

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



[issue12629] HTMLParser silently stops parsing with malformed attributes

2011-11-02 Thread Éric Araujo

Éric Araujo  added the comment:

> This is what Firefox seems to do.
I think more confidence would be good.  Doesn’t the HTML5 spec define that?  
Have you found their test suite?  Do you have more than one browser known to be 
compliant (trick: not sure there is even one)?

--

___
Python tracker 

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



[issue13320] _remove_visual_c_ref in distutils.msvc9compiler causes DLL load fail with embedded Python and multiple CRT versions

2011-11-02 Thread Éric Araujo

Éric Araujo  added the comment:

Mark, can you give feedback?

--
nosy: +mhammond

___
Python tracker 

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



[issue13324] fcntl module doesn't support F_NOCACHE (OS X specific) results in high 'inactive' memory performance issues

2011-11-02 Thread Alex Stewart

New submission from Alex Stewart :


ISSUE DESCRIPTION: 

In 2.6.7, 2.7.2 and also HEAD (r 73301) the fcntl module does not support the 
F_NOCACHE OSX specific mode.  

The affect of this is that the default behaviour (data caching enabled) is used 
when parsing files etc.  When data caching is enabled, OSX caches the data 
parsed from a file by python, keeping it available as 'inactive memory' even 
when it has been freed by python.  In *theory*, this should be fine as OSX 
*should* recycle the inactive memory as it is required.  

Unfortunately, at least under OSX 10.6.8 (and it seems 10.7) the system will do 
almost anything to avoid recycling inactive memory, including swallowing up all 
'pure' free memory and then paging manically to the disk.  The net affect of 
this is significantly degraded system performance.

For most users, operating with relatively small files and a large quantity of 
RAM this issue is probably not that obvious.  However, for various reasons I'm 
working with files of 5-125+GB and thus it rapidly becomes a major issue.


FIX

Very simply, all the attached patch does it add support for F_NOCACHE to fcntl 
just like F_FULLFSYNC (another fcntl OSX specific flag) - it's a trivial change 
that allows you to control whether OSX uses data caching on a file handle, e.g, 
the following turns OFF data caching for the specified file:

fcntl.fcntl(theFile.fileno(), fcntl.F_NOCACHE, 1)

With this patch in place the inactive memory on my system stays (low) and flat, 
without it it rises until it maxes out all available memory and then starts 
paging.

--
components: Extension Modules
files: fcntlmodule.patch
keywords: patch
messages: 146846
nosy: Alex.Stewart, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: fcntl module doesn't support F_NOCACHE (OS X specific) results in high 
'inactive' memory performance issues
type: resource usage
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file23592/fcntlmodule.patch

___
Python tracker 

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



[issue13307] bdist_rpm: INSTALLED_FILES does not use __pycache__

2011-11-02 Thread Éric Araujo

Éric Araujo  added the comment:

bdist_rpm uses the record option of install to create INSTALLED_FILES.

install delegates to the get_output method of install_* commands to build its 
record.

install_lib has buggy code that appends 'c' or 'o' instead of using imp 
functions.  I have expanded one test and successfully reproduced the bug; next 
I will fix the code.

--
assignee:  -> eric.araujo
components: +Distutils, Distutils2
nosy: +alexis
title: test_bdist_rpm: INSTALLED_FILES does not use __pycache__ -> bdist_rpm: 
INSTALLED_FILES does not use __pycache__
versions: +3rd party, Python 3.2

___
Python tracker 

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



[issue13224] Change str(class) to return only the class name

2011-11-02 Thread Éric Araujo

Éric Araujo  added the comment:

I’ve updated my patch to handle modules and functions too, but there is a 
decision to make.  The functions of built-in modules are implemented by 
methodobject.c, not functionobject.c (that’s for Python functions), so if we 
want str(sys.exc_info) to be equal to 'exc_info', then we’ll have 
str(dict.update) == 'update'.  Is this okay?

The patch needs a review.

- I tried using PyUnicode_FromString(name) instead of 
PyUnicode_FromFormat("%U", name), just like in Python I would use str(x) 
instead of '%s' % x, but this caused segfaults.  Is there a simpler function to 
use?

- I’ve used copy-paste-tweak and checked the results; I’m still learning C and 
know very little about Python’s types and refcounting internals, so review 
mercilessly!  I forgot to run the tests in findleaks mode, so I’m doing it 
right now.

--
Added file: http://bugs.python.org/file23591/change-some-__str__.diff

___
Python tracker 

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



[issue13303] Sporadic importlib failures: FileNotFoundError on os.rename()

2011-11-02 Thread Charles-François Natali

Charles-François Natali  added the comment:

mkstemp() creates the file with mode 0600, which can be surprising.
I'm note sure about the best way to handle this:
1) change the file mode after creating it with fchmod(), using the source file 
mode. But we must also take into account the umask, so we'd have to do:
mask = umask(0); 
umask(mask);
[...]
fd = mkstemp(cpathname_tmp)
fchmod(fd, mode & ~mask);

The double call to umask() is necessary because we can't just retrieve the umask
2) don't use mkstemp(), and use something like:

sprintf(cpathname_tmp, "%s.%x", cpathname, 0x & getpid());

d = open(cpathname_tmp, O_WRONLY|O_CREAT|O_EXCL);

to mimic what's done in Lib/importlib/_bootstrap.py (pseudo-temp file).

3) Fall back to the original ".tmp" suffix (with the risk of stale tmp file).

Thoughts?

--
status: closed -> open

___
Python tracker 

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



[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil
nosy: +orsenthil

___
Python tracker 

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



[issue13323] urllib2 does not correctly handle multiple www-authenticate headers in an HTTP response

2011-11-02 Thread David Fischer

New submission from David Fischer :

I ran into an application that responded with two www-authenticate challenges  
to an HTTP request. First, it sends a standard Basic authentication challenge 
and then it also returns a www-authenticate header referencing another scheme. 
This looks legal to me according to rfc2617.

However, the regex in AbstractBasicAuthHandler that parses the www-authenticate 
header only grabs one of the challenges (the last one) and therefore urllib2 
will not respond to the challenge with credentials.

--
messages: 146842
nosy: dfischer
priority: normal
severity: normal
status: open
title: urllib2 does not correctly handle multiple www-authenticate headers in 
an HTTP response
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



[issue13322] buffered read() and write() does not raise BlockingIOError

2011-11-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
components: +IO, Library (Lib)
nosy: +pitrou
versions:  -Python 2.6, Python 3.1, Python 3.4

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2011-11-02 Thread sbt

Changes by sbt :


--
type:  -> behavior
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2011-11-02 Thread sbt

New submission from sbt :

According to the the documentation, BufferedReader.read() and 
BufferedWriter.write() should raise io.BlockingIOError if the file is in 
non-blocking mode and the operation cannot succeed without blocking.

However, BufferedReader.read() returns None (which is what RawIOBase.read() is 
documented as doing), and BufferedWriter.write() raises IOError with a message 
like

raw write() returned invalid length -1 (should have been 
between 0 and 5904)

I tested this on Linux with Python 2.6, 2.7 and 3.x.

Attached is a unit test.

--
files: blockingioerror.py
messages: 146841
nosy: sbt
priority: normal
severity: normal
status: open
title: buffered read() and write() does not raise BlockingIOError
Added file: http://bugs.python.org/file23590/blockingioerror.py

___
Python tracker 

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



[issue3990] The Linux2 platform definition is incorrect for alpha, hppa, mips, sparc

2011-11-02 Thread Éric Araujo

Éric Araujo  added the comment:

A proposal by Martin in a python-dev email:

> I'd generate four versions of CDROM.py (with differing names), and
> provide a CDROM.py that imports the right one.

--
keywords: +easy -patch
stage:  -> needs patch

___
Python tracker 

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



[issue13284] email.utils.formatdate function does not handle timezones correctly.

2011-11-02 Thread Mikhail I. Izmestev

Mikhail I. Izmestev  added the comment:

I have strange behavior too:

im@cgt-serv ~ $ python
Python 2.6.6 (r266:84292, Feb 28 2011, 09:01:15)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from email.Utils import formatdate
>>> import time
>>> time.strftime("%a, %d %b %Y %T %z")
'Wed, 02 Nov 2011 18:21:08 +0400'
>>> formatdate(localtime=True)
'Wed, 02 Nov 2011 18:21:28 +0300'
>>>

--
nosy: +izmmisha

___
Python tracker 

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



[issue13310] asyncore handling of out-of-band data fails

2011-11-02 Thread Charles-François Natali

Charles-François Natali  added the comment:

> It is not clear why recv() can return EAGAIN because we're trying to
> _send_ a packet ;-)

Well, I was refering to a problem with the current implementation, not
limited to this specific example.

>> Closing as invalid
>
> Ok, 2.6.30 is an old kernel and urgent data is mostly never used.

I'll update test_asyncore to actually call recv(MSG_OOB), it's
probably a good idea to check that (hopefuly it won't break on OS
X...).

--

___
Python tracker 

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



[issue13321] fstat doesn't accept an object with "fileno" method

2011-11-02 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
priority: normal -> low

___
Python tracker 

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



[issue12939] Add new io.FileIO using the native Windows API

2011-11-02 Thread STINNER Victor

STINNER Victor  added the comment:

> Instead of rewriting your own RawIO implementation, why not use
> _open_osfhandle?

I don't know yet what is the best approach. One important point is to keep the 
HANDLE, to be able to manipulate the open file using the Windows API (e.g. call 
WriteFile instead of write).

I propose a RawIO to call directly the Windows API: file.write() would call 
directly WriteFile() instead of the POSIX wrapper (write()).

We may use it to implement new features like async I/O on Windows (e.g. 
WriteFileEx).

Modules/_multiprocessing/win32_functions.c exposes already some low-level 
Windows functions like WriteFile(). We may reuse the RawIO to offer an object 
oriented API for the Windows multiprocessing pipes. Such RawIO would have 
extra methods, maybe a file.WriteFile() method to give access to extra options 
like "overlapped".

--

___
Python tracker 

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



[issue13310] asyncore handling of out-of-band data fails

2011-11-02 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Hi Charles-François,

> And indeed, that's a known kernel regression introduced in 2.6.28,
> and fixed by this commit:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b634f87522dff87712df8bda2a6c9061954d552a
> http://kerneltrap.org/mailarchive/linux-netdev/2010/3/15/6271951

The BlockingIOError exception occurs on linux 2.6.30 for me.


> Note that there might still be a problem with the current code:
> recv() can return EAGAIN on a FD reported readable/writable by
> select() (for example if the network stack received an input packet
> and then discards it because of an invalid checksum, or because the
> output socket buffer has room left but not enough to accomodate the
> packet we're trying to send): I'll have to think a bit to see if we
> can do something about this, but that's another issue.

It is not clear why recv() can return EAGAIN because we're trying to
_send_ a packet ;-)


> Closing as invalid

Ok, 2.6.30 is an old kernel and urgent data is mostly never used.

--

___
Python tracker 

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



[issue12709] In multiprocessing, error_callback isn't documented for map_async

2011-11-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Sandro: The error_callback parameter is not available on 2.7. See #13147.

--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13147] Multiprocessing Pool.map_async() does not have an error_callback parameter

2011-11-02 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +needs review
nosy: +petri.lehtinen
stage:  -> patch review

___
Python tracker 

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



[issue13147] Multiprocessing Pool.map_async() does not have an error_callback parameter

2011-11-02 Thread Jyrki Pulliainen

Jyrki Pulliainen  added the comment:

Also: note that 2.6 does not document this error_callback, so the issue is 
present only in 2.7

--

___
Python tracker 

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



[issue13147] Multiprocessing Pool.map_async() does not have an error_callback parameter

2011-11-02 Thread Jyrki Pulliainen

Jyrki Pulliainen  added the comment:

Patch attached. This patch removes the error_callback from 2.7's documentation.

--
keywords: +patch
Added file: http://bugs.python.org/file23589/issue13147.patch

___
Python tracker 

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



[issue13147] Multiprocessing Pool.map_async() does not have an error_callback parameter

2011-11-02 Thread Jyrki Pulliainen

Jyrki Pulliainen  added the comment:

Python 3.x seems to have the error_callback parameter on all *_async 
operations. However, 2.7 lacks it. I think adding the actual error_callback 
would be deemed as a new feature, so the right thing would just be removing the 
documentation.

I'll whip up a patch to remove this from the documentation

--
nosy: +nailor

___
Python tracker 

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



[issue13321] fstat doesn't accept an object with "fileno" method

2011-11-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

This is a request for new functionality, so marking as a feature request for 
3.3. If implemented, the change should be applied to many other functions, in 
the os module at least.

I'm not sure whether this is very useful, though. The fstat(f.fileno()) idiom 
doesn't require that much writing and makes it explicit that we're operating on 
an underlying file descriptor. Furthermore, funtions in the os module are 
low-level and map very closely to the underlying C API.

--
nosy: +benjamin.peterson, petri.lehtinen, pitrou, stutzbach
type: behavior -> feature request
versions:  -Python 3.2

___
Python tracker 

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



[issue13312] test_time fails: strftime('%Y', y) for negative year

2011-11-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1a0bfc26af57 by Florent Xicluna in branch 'default':
Issue #13312: skip the failing negative years for now.
http://hg.python.org/cpython/rev/1a0bfc26af57

--

___
Python tracker 

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



[issue13312] test_time fails: strftime('%Y', y) for negative year

2011-11-02 Thread Florent Xicluna

Florent Xicluna  added the comment:

I mean formatted with '%Y', of course.

--

___
Python tracker 

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



[issue13312] test_time fails: strftime('%Y', y) for negative year

2011-11-02 Thread Florent Xicluna

Changes by Florent Xicluna :


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

___
Python tracker 

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



[issue13312] test_time fails: strftime('%Y', y) for negative year

2011-11-02 Thread Florent Xicluna

Florent Xicluna  added the comment:

It fails for very low negative years:
  -2147483648 <= year < -2147481748 
  (-1<<31)<= year < (-1<<31) + 1900 

Every other value behaves correctly on this FreeBSD buildbot:
 - (-1<<31) + 1900 <= year < (+1<<31) : correctly formatted with '%Z'
 - year <  (-1<<31) : raises OverfowError
 - year >= (+1<<31) : raises OverfowError

--

___
Python tracker 

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



[issue13312] test_time fails: strftime('%Y', y) for negative year

2011-11-02 Thread Florent Xicluna

Florent Xicluna  added the comment:

It fails for very low negative years:
  -2147481749 <= year <= -2147483648
  (-1<<31) + 1900 <= year <= (-1<<31)

Every other value behaves correctly on this FreeBSD buildbot:
 - (-1<<31) + 1900 < year < (+1<<31) : correctly formatted with '%Z'
 - year <  (-1<<31) : raises OverfowError
 - year >= (+1<<31) : raises OverfowError

--

___
Python tracker 

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