[issue8957] strptime(.., '%c') fails to parse output of strftime('%c', ..) in some locales

2011-01-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

I'm attaching a patch for Lib/_strptime.py that handles the month differently 
in __calc_date_time. It cycles all months, trying to find one where the full 
and abbrev names are different and matches it against the timestamp created by 
strftime. 

This solution is a hack, but so is the whole __calc_date_time function :-) 
[IMHO]

All tests pass and I also tried it manually with all the problematic locales 
reported by Alexander - seems to work correctly.

If this looks OK to you guys I can commit and backport.

--
keywords: +patch
Added file: http://bugs.python.org/file20412/issue8957.py3k.1.patch

___
Python tracker 

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



[issue1227748] subprocess: inheritance of std descriptors inconsistent

2011-01-14 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

I think all that is needed is a documentation patch. Attached is a doc patch 
which changes the doc to explicitly describe what happens on unix & windows (as 
described by Peter).

--
components: +Documentation
keywords: +patch
nosy: +rosslagerwall
Added file: http://bugs.python.org/file20411/1227748.patch

___
Python tracker 

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



[issue10502] Add unittestguirunner to Tools/

2011-01-14 Thread Ned Deily

Ned Deily  added the comment:

FYI, as of 3.2rc1, Tools/ is now included in Mac OS X distributions in 
/Applications/Python 3.2/Extras/.

--
nosy: +ned.deily

___
Python tracker 

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




[issue8957] strptime(.., '%c') fails to parse output of strftime('%c', ..) in some locales

2011-01-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

The problem for Hebrew appears to be the same as the one Victor stated for 
French. March in Hebrew is also a 3-letter word which means it's equal to its 
abbreviation.

--

___
Python tracker 

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



[issue10842] Update third-party libraries for OS X installer builds

2011-01-14 Thread Ned Deily

Ned Deily  added the comment:

Committed (with release manager approval for 3.2) to py3k in r88006.

Pending potential backport to 2.7.

--
assignee: ronaldoussoren -> ned.deily
priority: release blocker -> 
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> pending

___
Python tracker 

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



[issue10843] OS X installer: install the Tools source directory

2011-01-14 Thread Ned Deily

Ned Deily  added the comment:

Committed (with release manager approval for 3.2) in r88005.

--
assignee: ronaldoussoren -> ned.deily
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue1535504] CGIHTTPServer doesn't handle path names with embeded space

2011-01-14 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

Shouldn't this be closed? CGIHTTPServer *has* been updated to use subprocess on 
windows and the dependency has been closed as wont fix.

--
nosy: +rosslagerwall

___
Python tracker 

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



[issue10907] OS X installer: warn users of buggy Tcl/Tk in OS X 10.6

2011-01-14 Thread Ned Deily

Ned Deily  added the comment:

Patch for items 2 and 3 committed (with release manager approval for 3.2) in 
r88003.  Updated the OS X installer build instructions to better reflect 
current practices including use of A/S Tcl/Tk in r88004.

Pending website changes and 2.7 backport (items 4 through 7).

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

___
Python tracker 

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



[issue1602] windows console doesn't print or input Unicode

2011-01-14 Thread Glenn Linderman

Glenn Linderman  added the comment:

Victor said:
Why do you set the code page to 65001? In all my tests (on Windows XP), it 
always break the standard input.

My response:
Because when I searched Windows for Unicode and/or UTF-8 stuff, I found 65001, 
and it seems like it might help, and it does a bit.  And then I find 
PYTHONIOENCODING, and that helps some.  And that got me something that works 
better enough than what I had before, so I quit searching.

You did a better job of analyzing and testing all the cases.  I will have to go 
subtract the 65001 part, and confirm your results, maybe it is useless now that 
other pieces of the puzzle are in place.  Certainly with David-Sarah's code it 
seems to not be needed, whether it was a necessary part of the previous 
workaround I am not sure, because of the limited number of cases I tried 
(trying to find something that worked well enough, but not having enough 
knowledge to find David-Sarah's solution, nor a good enough testing methodology 
to try the pieces independently.

Thank your for your interest in this issue.

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

Le vendredi 14 janvier 2011 à 19:11 +, R. David Murray a écrit :
> Victor: we normally leave the patch file that was committed attached
> to the issue for future reference.

Sorry, but there were too much files. I was trying to figure out if
there is something useful in the files.

> The _plus_tests file was just the original patch plus the existing cgi
> tests adjusted to pass in bytes instead of strings to cgi, if I recall
> correctly.  Nor original code of mine in either part :)

Ok.

--

___
Python tracker 

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



[issue10912] PyObject_RichCompare differs in behaviour from PyObject_RichCompareBool ; difference not noted in documentation

2011-01-14 Thread Devin Jeanpierre

New submission from Devin Jeanpierre :

PyObject_RichCoareBool is, according to the documentation in trunk 
(Doc\c-api\object.rst), exactly the same as PyObject_RichCompare, except it 1, 
0, or -1 for error, false, and true respectively. However, it differs in 
behavior by both that, and also by assuming that identity implies equality. 
This noted in a two year-old ML post (sadly, no bug report was posted as best 
as I can find): 
http://mail.python.org/pipermail/python-list/2009-March/1195170.html

Ideally PyObject_RichCompareBool should probably be named something else, since 
it can no longer be used, strictly, as "PyObject_RichCompare, but returning a C 
bool" (or, rather, a C int). Some suggestions were offered in the mailing list 
thread above.

I'm filing this as a documentation bug because I find that outcome unlikely. At 
least the documentation should note the difference in behavior, so that people 
do not accidentally write C code that does not behave as intended.

This issue is related to, but different from issue 4296, which objected to the 
new container behavior created by the change to PyObject_RichCompareBool. My 
only objection here is that the latter change does not appear to be documented.

I would supply a patch for the tests, but PyObject_RichCompareBool is 
apparently not directly tested anywhere, just tested obliquely through testing 
the containment operator, and this was changed by the same commit that changed 
PyObject_RichCompareBool. I don't know how to word the (very small!) change to 
the docs.

--
assignee: docs@python
components: Documentation
messages: 126306
nosy: Devin Jeanpierre, docs@python
priority: normal
severity: normal
status: open
title: PyObject_RichCompare differs in behaviour from PyObject_RichCompareBool 
; difference not noted in documentation

___
Python tracker 

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



[issue10817] urllib.request.urlretrieve never raises ContentTooShortError if no reporthook

2011-01-14 Thread Robert Siemer

Changes by Robert Siemer :


--
nosy: +siemer

___
Python tracker 

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



[issue6771] Curses.wrapper: documentation/implementation error

2011-01-14 Thread Radiant

Radiant  added the comment:

Adding version=3.2 and component=Documentation.

--
assignee:  -> docs@python
components: +Documentation
nosy: +Radiant, docs@python
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



[issue1602] windows console doesn't print or input Unicode

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

> ..., because right now, I'm including instructions for the use to 
> (1) choose Lucida or Consolas font if they can't figure out 
> any other font that gets rid of the square boxes 
> (2) chcp 65001 
> (3) set PYTHONIOENCODING=UTF-8

Why do you set the code page to 65001? In all my tests (on Windows XP), it 
always break the standard input.

--

___
Python tracker 

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



[issue1602] windows console doesn't print or input Unicode

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

Here are some results of my test of unicode2.py. I'm testing py3k on Windows 
XP, OEM: cp850, ANSI: cp1252.

Raster fonts


With a fresh console, unicode2.py displays "?". input() accepts 
characters encodable to the OEM code page.

If I set the code page to 65001 (chcp program+set PYTHONIOENCODING=utf-8; or 
SetConsoleCP() + SetConsoleOutputCP()), it displays weird characters. input() 
accepts ASCII characters, but non-ASCII characters (encodable to the console 
and OEM code pages) display weird characters (smileys! control characters?).

Lucida console
--

With my system code page (OEM: cp850), characters not encodable to the code 
pages are displayed correctly. I can type some non-ASCII characters (encodable 
to the code page). If I copy/paste characters non encodable to the code page, 
there are replaced by similar glyph (eg. Ł => L) or ? (€ => ?).

If I set the code page to 65001, all characters are still correctly displayed. 
But I cannot type non-ASCII characters anymore: input() fails with EOFError (I 
suppose that Python gets control characters).

Redirect output to a pipe
-

I patched unicode2.py to use sys.stdout.buffer instead of sys.stdout for 
UnicodeOutput stream. I also patched UnicodeOutput to replace \n by \r\n. 

It works correctly with any character. No UTF-8 BOM is written. But "Here 1" is 
written at the end. I suppose that sys.stdout should be flushed before the 
creation of UnicodeOutput.

But it always use UTF-8. I don't know if UTF-8 is well supported by any 
application on Windows.

Without unicode2.py, only characters encodable to OEM code page are supported, 
and \n is used as end of line string.

Let's try to summarize
--

Tests:
 d1) Display characters encodable to the console code page
 t1) Type characters encodable to the console code page
 d2) Display characters not encodable to any code page
 t2) Type characters not encodable to any code page

I'm using Windows with OEM=cp850 and ANSI=cp1252. For test (t2), I copy €-Ł and 
paste it to the console (right click on the window title > Edit > Paste).

Raster fonts, console=cp850:

d1) ok
t1) ok
d2) FAIL: €-Ł is displayed ?-L
t2) FAIL: €-Ł is read as ?-L

Raster fonts, console=cp65001:

d1) FAIL: é is displayed as 2 strange glyphs
t1) FAIL: EOFError
d2) FAIL: only display unreadable glyphs
t2) FAIL: EOFError

Lucida console, console=cp850:

d1) ok
t1) ok
d2) ok
t2) FAIL: €-Ł is read as ?-L

Lucida console, console=cp65001:

d1) ok
t1) FAIL: EOFError
d2) ok
t2) FAIL: EOFError

So, setting the console code page to 65001 doesn't solve any issue, but it 
breaks the input (input with the keyboard or pasting text).

With Raster fonts or Lucida console, it's possible to display characters 
encodable to the code page. But it is not new, it's already possible with 
Python 3. But for characters not encodable to the code page, it works with 
unicode2.py and Lucida console, with is something new :-)

For the input, I suppose that we need also to use a Windows console function, 
to support unencodable characters.

--

___
Python tracker 

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



[issue2128] sys.argv is wrong for unicode strings

2011-01-14 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



[issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

belopolsky> Limiting field width when formatting error messages is 
belopolsky> a good safety measure.

The problem is that PyUnicode_FromFormatV() doesn't support %.100s format (it 
ignores .100). If we truncate at 100 bytes, it may truncate an UTF-8 string in 
the middle of a character :-/ And I don't want to implement it because I don't 
like arbitrary limitations in Python.

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

Because I'm unable to read the whole history and analyze each file attached to 
this issue, I opened #10911 to ask to write more tests for the cgi module.

--

___
Python tracker 

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



[issue10911] cgi: add more tests

2011-01-14 Thread STINNER Victor

New submission from STINNER Victor :

cgi was recently fixed just before Python 3.2 final, but the module has few 
tests. More tests should be written.

You can find some examples attached to #4953.

--
components: Library (Lib), Tests
messages: 126300
nosy: haypo
priority: normal
severity: normal
status: open
title: cgi: add more tests
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



[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2011-01-14 Thread Bert JW Regeer

New submission from Bert JW Regeer :

I was recently attempting to get Botan (http://botan.randombit.net) working 
with Python 2.6.6 on FreeBSD when it failed to compile, I filled a bug with 
Botan (http://bugs.randombit.net/show_bug.cgi?id=135) and first thought it was 
a compiler issue, and then thought it might be a Boost.Python issue.

However after further digging, see comment 3 
(http://bugs.randombit.net/show_bug.cgi?id=135#c3) I figured out it had to do 
with the fix that went in to pyport.h for issues with isspace/toupper/et al. on 
FreeBSD's libc and also Mac OS X.

As can be seen in 
http://svn.python.org/view/python/trunk/Include/pyport.h?r1=36519&r2=36793 a 
change was added to override the original definitions with a new one that used 
the wide character support. It was modified again in 
http://svn.python.org/view/python/trunk/Include/pyport.h?r1=77585&r2=80178 to 
also include Mac OS X for http://bugs.python.org/issue7072.

The issue here is that if this file is included in any C++ code that then also 
includes  or any of other functions that might pull in localefwd.h the 
defines will cause actual C++ code functions to be overwritten with invalid 
data, and the C++ compiler will throw errors such as:

/usr/include/c++/4.2/bits/localefwd.h:58:34: error: macro "isspace" passed 2
arguments, but takes just 1

Putting an #if 0, #endif around that block of code allows Botan's python module 
to cleanly compile without issues.

I do apologise that I don't have a simple C++ program that reproduces the 
problem.

--
assignee: ronaldoussoren
components: Build, Extension Modules, Library (Lib), Macintosh, Unicode, ctypes
messages: 126299
nosy: X-Istence, ronaldoussoren
priority: normal
severity: normal
status: open
title: pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation
type: compile error
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue10874] test_urllib2 shouldn't use is operator for comparing strings

2011-01-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Łukasz, please close issues when they are fixed.

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



[issue1170] shlex have problems with parsing unicode

2011-01-14 Thread Doug Hellmann

Changes by Doug Hellmann :


--
nosy: +doughellmann

___
Python tracker 

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



[issue10694] zipfile.py end of central directory detection not robust

2011-01-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: unit test needed -> patch review

___
Python tracker 

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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-01-14 Thread David Beazley

David Beazley  added the comment:

Just wanted to say that I agree it's nonsense to continue reading on a socket 
that timed out (I'm not even sure what I might have been thinking when I first 
submitted this bug other than just experimenting with edge cases of the socket 
interface).It's still probably good to precisely specify what the behavior 
is in any case.

--

___
Python tracker 

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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-01-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Looks good and simple enough. I would probably shift the timeout test after the 
closed test, but that's almost a detail.

--

___
Python tracker 

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



[issue9527] Add aware local time support to datetime module

2011-01-14 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
title: Add aware local time support to datetime module (issue9527) -> Add aware 
local time support to datetime module

___
Python tracker 

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



[issue9527] Add aware local time support to datetime module (issue9527)

2011-01-14 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Forwarding Rietveld conversation to the tracker.  It looks like
Rietveld integration has a bug and sends reviews to
n...@psf.upfronthosting.co.za rather than to rep...@bugs.python.org.

Forwarded conversation
Subject: Add aware local time support to datetime module (issue9527)


From: 
Date: Thu, Jan 13, 2011 at 7:14 PM
To: belopol...@users.sourceforge.net
Cc: n...@psf.upfronthosting.co.za

I'm not proficient in C and not an expert in datetime issues either, but
because nobody else stepped in to do review, I've left some comments.
Perhaps making the issue more acceptable by general public will help to
close it faster.

http://bugs.python.org/review/9527/diff/1568/2704
File Lib/datetime.py (right):

http://bugs.python.org/review/9527/diff/1568/2704#newcode1420
Lib/datetime.py:1420: def localtime(cls, t=None, isdst=-1):
The t param should probably be called 'time'.

http://bugs.python.org/review/9527/diff/1568/2704#newcode1421
Lib/datetime.py:1421: """Return local time as an aware datetime object.
ISTM that we need an object hierarchy like DateTime->DateTimeTZ, because
debugging which object is TZ aware and which is not is rather hard.

http://bugs.python.org/review/9527/diff/1568/2704#newcode1435
Lib/datetime.py:1435: t = _time.time()
Here we should always receive aware object, but I couldn't find
reference to C standard to ensure that all systems return this
correctly.

http://bugs.python.org/review/9527/diff/1568/2704#newcode1437
Lib/datetime.py:1437: if t.tzinfo is None:
I'd replace this with elif and place comment that here we detect
non-aware time object. Docstring above is nice, but it will probably be
parsed into documentation, and I am not sure if these details should be
present in user manual.

http://bugs.python.org/review/9527/diff/1568/2704#newcode1438
Lib/datetime.py:1438: tm = t.timetuple()[:-1] + (isdst,)
IIUC return result of time() value is time.struct_time which doesn't
have timetuple() method. If you work with datetime objects only, then
you need to name variables accordingly.

http://bugs.python.org/review/9527/show

--
From: 
Date: Fri, Jan 14, 2011 at 12:28 PM
To: belopol...@users.sourceforge.net
Cc: n...@psf.upfronthosting.co.za

On 2011/01/14 04:30:11, sasha wrote:
> Can you comment on whether you find the
> proposed function useful?  Is the interface intuitive?

I prefer to threat UTC time and timezone separately. My API wannabe:

global.time() - returns value that can be printed and it will be in UTC
global.offset() - difference in seconds between current timezone and UTC
(so that +2 will be 7200 seconds and -2 is -7200)
global.fromiso() - returns value parsed from ISO 8601 format, probably
pair (UTC time, offset)
global.toiso(time, [offset]) - for symmetry

Maybe its even better if global.time() returns tuple (UTC time, offset)

As you may see I am not interested in DST details etc. All I need is the
ability to parse and generate timestamps. If your datetime.localtime()
returns datetime object, how should I use it to generate Atom timestamp
with proper TZ modifier?

http://www.atomenabled.org/developers/syndication/atom-format-spec.php#date.constructs

In my low-level and non-OOP API it is:

global.toiso(global.time(), global.offset())

epoch as an
> argument (unlike the eponymous time module function).  It takes an
arbitrary
> datetime instance and converts it to an aware datetime instance with
tzinfo set
> to an appropriate fixed offset timezone.

At first I thought about datetime.toaware(dt), but this description of
yours is better than the one provided in docstring. If
datetime.localtime([dt]) gets local time in timezone aware object or
converts existing datetime (how about other types?), then the name
datetime.localtime() seems fine. But I would consider alternative
datetime.globaltime() name with the meaning that we get datetime object
that is globally synchronized, in other words it can be used not only
locally. .localtime() is ambiguous in this respect.
On 2011/01/14 04:30:11, sasha wrote:
> implementation.   I would not call it "time" because that conflicts
with the
> time class and localtime expects a datetime instance in t.

dt is a consistent name for datetime parameters in Python manual.
On 2011/01/14 04:30:11, sasha wrote:
> Early versions of datetime has a separate datetimetz class.  I don't
remember
> what were the actual reasons for removing it, but I am glad that this
was done.
> Hopefully applications will stop using naive datetime objects at some
point, so
> there will be less need to distinguish naive and aware instances.

It must be recorded for history if we want to get rid of date/time curse
in Python4 without missing any details. Removing naive objects in favor
of normalized objects with UTC timestamps seems like a way to go.
On 2011/01/14 04:30:11, sasha wrote:
> No.  _time.time() returns seconds since epoch. Naive/aware distinction
is not
> applicable.

But these seconds are in UT

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2011-01-14 Thread ronnix

ronnix  added the comment:

The regex 0.1.20110106 package fails to install with Python 2.6, due to the use 
of 2.7 string formatting syntax in setup.py:

print("Copying {} to {}".format(unicodedata_db_h, SRC_DIR))

This line should be changed to:

print("Copying {0} to {1}".format(unicodedata_db_h, SRC_DIR))

Reference: http://docs.python.org/library/string.html#formatstrings

--
nosy: +ronnix

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Glenn Linderman

Glenn Linderman  added the comment:

Thanks to Pierre for producing patch after patch and testing testing testing, 
and to Victor for committing it, as well as others that contributed in smaller 
ways, as I tried to.  I look forward to 3.2 rc1 so I can discard all my 
temporary patched copies of cgi.py

--

___
Python tracker 

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



[issue9527] Add aware local time support to datetime module

2011-01-14 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Following Anatoly's review, I renamed datetime argument and a local variable, 
added comments and expanded docstring.  I am uploading a new patch: 
datetime-localtime-proto-1.diff.

Martin, I could not figure out how to add the new patch to rietveld and I don't 
think auto-review feature works.

--
nosy: +loewis
Added file: http://bugs.python.org/file20410/datetime-localtime-proto-1.diff

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Glenn Linderman

Changes by Glenn Linderman :


--
versions: +Python 3.2 -Python 3.3

___
Python tracker 

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



[issue10904] PYTHONIOENCODING is not in manpage

2011-01-14 Thread Peter Kleiweg

Peter Kleiweg  added the comment:

Ah, I see it's fixed in the latest version.

The variable PYTHONIOENCODING was present at least since Python 2.6.4, but not 
documented in the manpage of versions 2.6.4, 2.7 and 3.1.1.
I thought I had recent versions, but I see now versions 2.7.1 and 3.1.3, and 
they both have the variable in the manpage.

I'm sorry for the inconveniance.

--
resolution:  -> out of date
status: open -> closed
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue9257] cElementTree iterparse requires events as bytes; ElementTree uses strings

2011-01-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

r78942 is quite large unfortunately.
But just patching _elementree.c::xmlparser_setevents() should be possible.
This would at least fix the "invalid event tuple" error.

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread R. David Murray

R. David Murray  added the comment:

Victor: we normally leave the patch file that was committed attached to the 
issue for future reference.

The _plus_tests file was just the original patch plus the existing cgi tests 
adjusted to pass in bytes instead of strings to cgi, if I recall correctly.  
Nor original code of mine in either part :)

--

___
Python tracker 

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



[issue1602] windows console doesn't print or input Unicode

2011-01-14 Thread Brian Curtin

Brian Curtin  added the comment:

I think we even agreed to drop 2000, although the PEP hasn't been updated and I 
couldn't find the supposed email where this was said.

For implementing functionality that isn't supported on all Windows versions or 
architectures, you can look at PC/winreg.c for a few examples. 
DisableReflectionKey is a good example off the top of my head.

--

___
Python tracker 

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



[issue9257] cElementTree iterparse requires events as bytes; ElementTree uses strings

2011-01-14 Thread Peter

Peter  added the comment:

This wasn't fixed in Python 3.1.3 either.

Is the trunk commit Amaury identified from py3k branch (r78942) suitable to 
back port to Python 3.1.x?

--

___
Python tracker 

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



[issue1602] windows console doesn't print or input Unicode

2011-01-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

http://www.python.org/dev/peps/pep-0011/ says

Name: Win9x, WinME, NT4
Unsupported in:   Python 2.6 (warning in 2.5 installer)
Code removed in:  Python 2.6

Only xp+ now. email sent to webmaster@...

Even if the best fix only applies to win7, please include it.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue10904] PYTHONIOENCODING is not in manpage

2011-01-14 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On the second thought, maybe "de manpage" is not a misspelling of "the 
manpage", but a reference to a German locale manpage?  I don't think python.org 
releases include manpage translations.  You may need to report it to your 
system vendor.

--

___
Python tracker 

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



[issue10904] PYTHONIOENCODING is not in manpage

2011-01-14 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

What "manpage" are you reporting?  In py3k branch,

$ groff -Tascii -man Misc/python.man
..

   PYTHONIOENCODING
  If this is set before running the interpreter, it overrides  the
  encoding  used  for stdin/stdout/stderr, in the syntax encoding-
  name:errorhandler The errorhandler part is optional and has  the
  same meaning as in str.encode. For stderr, the errorhandler
   part is ignored; the handler will always be 'backslashreplace'.
..

There is a missing period after the first sentence, but otherwise LGTM.

It is also documented in the reST manual and python -h help, 

http://docs.python.org/dev/using/cmdline.html#envvar-PYTHONIOENCODING

--
nosy: +belopolsky

___
Python tracker 

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



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2011-01-14 Thread anatoly techtonik

anatoly techtonik  added the comment:

Great. Thanks!

--

___
Python tracker 

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



[issue10909] thread hang, possibly related to print

2011-01-14 Thread Scott M

New submission from Scott M :

New to Python; be gentle if I've simply missed something. i'M running on 
Windows XP, using a recently downloaded 2.7.1. I'm running by hitting F5 in 
IDLE.

The attached .py creates 2 threads, one which updates a Tkinter label 10 times 
a second forever, and one which sleeps for a second and then thrashes the CPU 
for ~4 seconds, forever. I wrote this to see how Python dealt with CPU-pig 
threads, and was pleased to see both threads got to run in a decently 
interleaved way, even in the face of a tight loop.

But at a random point, one of the threads (which one varies) stops running. The 
other continues fine. The problem manifests in less then 5 minutes (often less 
than 1).

At least once, but not ever time, the thread that stopped gave a traceback:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "D:\Python27\lib\threading.py", line 530, in __bootstrap_inner
self.run()
  File "F:\Python27\MyProjects\e.py", line 24, in run
print "evil!"  #<--- point 1
  File "D:\Python27\lib\idlelib\rpc.py", line 595, in __call__
value = self.sockio.remotecall(self.oid, self.name, args, kwargs)
  File "D:\Python27\lib\idlelib\rpc.py", line 211, in remotecall
return self.asyncreturn(seq)
  File "D:\Python27\lib\idlelib\rpc.py", line 240, in asyncreturn
response = self.getresponse(seq, wait=0.05)
  File "D:\Python27\lib\idlelib\rpc.py", line 280, in getresponse
response = self._getresponse(myseq, wait)
  File "D:\Python27\lib\idlelib\rpc.py", line 305, in _getresponse
cvar = self.cvars[myseq]
KeyError: 8680

BUT in some cases there wasn't a traceback (the last time there wasn't, it was 
BThread that had stopped running; the label was no longer updating.)

If you comment out the print at point 2, or point 1, it seems to work fine, at 
least for as long as I cared to watch it.

Also, I've noticed that if I close the app's window, that at least one thread 
keeps running and writing to the Python shell console. (One generally dies 
because the Tkinter label has gone away). They are both marked as daemonic; 
shouldn't they stop more or less instantly?

--
components: Interpreter Core
files: e.py
messages: 126282
nosy: PythonInTheGrass
priority: normal
severity: normal
status: open
title: thread hang, possibly related to print
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file20409/e.py

___
Python tracker 

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



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2011-01-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Sorry, I missed that the request had changed to just the .pyd name. That at 
least is useful, since you then know where to start with depends.exe. It should 
be fairly straightforward to implement as well.

Adjusted issue title accordingly.

--
resolution: wont fix -> 
status: closed -> open
title: Output DLL name in error message of ImportError when DLL is missing -> 
Output .pyd name in error message of ImportError when DLL load fails

___
Python tracker 

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



[issue10854] Output DLL name in error message of ImportError when DLL is missing

2011-01-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

As Martin says, we aren't inclined to implement or maintain the equivalent of 
depends.exe in order to provide a slightly better error message.

If anyone wants to reopen this issue, provide a patch. Otherwise devs are just 
going to close it again.

Optionally, campaign for a fix on python-list and see if you can persuade 
someone *else* to provide a patch.

You could even go to the source of the problem and ask *Microsoft* to provide a 
better error message.

--
nosy: +ncoghlan
status: open -> closed

___
Python tracker 

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



[issue10903] ZipExtFile:_update_crc fails for CRC >= 0x80000000

2011-01-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Can you provide such a file? What system are you testing on?

--
nosy: +pitrou

___
Python tracker 

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



[issue10907] OS X installer: warn users of buggy Tcl/Tk in OS X 10.6

2011-01-14 Thread Michael Foord

Michael Foord  added the comment:

This looks good Ned. My main concern is that we make it clear from the 
*Download* page that users who want IDLE to "just work" (even on 10.6) they 
should install the 32 bit version.

Noting that Activestate Tcl/Tk 8.5 is a *requirement* for Tkinter/IDLE with the 
64bit (10.6) build sounds wise. Just putting it in the installer README isn't 
enough as it is too late. Obviously fine to put it in the README as *well*.

Having a page linked to from the download page with up to date info on Mac OS X 
10.6 is good. You'll probably want website commit rights to maintain this Ned. 
You can get it by emailing the pydotorg mailing list and preferably should also 
join pydotorg-www. :-)

--

___
Python tracker 

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



[issue10907] OS X installer: warn users of buggy Tcl/Tk in OS X 10.6

2011-01-14 Thread David Beazley

David Beazley  added the comment:

A comment from the training world:  The instability of IDLE on the Mac makes 
teaching introductory Python courses a nightmare at the moment.   Sure, one 
might argue that students should install an alternative editor, but then you 
usually end up with two problems instead of one.  It would be great if IDLE 
just "worked" out of the box for starting out.

Glad to see someone looking at this.

--
nosy: +dabeaz

___
Python tracker 

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



[issue3978] ZipFileExt.read() can be incredibly slow; patch included

2011-01-14 Thread Andre Berg

Andre Berg  added the comment:

"Decryption is extremely slow as it is implemented in native Python rather than 
C"

Right, of course, I missed this when reading the docs.
I have a habit of jumping straight to the point.

As I was asked to try it with a non-password protected zip file here's the 
numbers for comparison.

Same file, re-zipped without encryption, extractall.py now finishes in  16 s.

--

___
Python tracker 

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



[issue10278] add time.wallclock() method

2011-01-14 Thread Brian Curtin

Brian Curtin  added the comment:

> In Windows, it should probably use GetTickCount64 if available,
> otherwise GetTickCount with logic to handle wrapping.  I think
> QueryPerformanceCounter is problematic as a general-purpose timer:
> depending on the hardware and Windows version, it can be offset
> differently across CPUs, and may not be reliable on some processors.  It
> may be fixed in Vista or Win7, I'm not sure; if so it's much higher
> resolution than GTC.

I don't have a ton of experience with this, but by creating a synchronization 
point based on when the system clock changes, QueryPerformanceCounter can be 
pretty accurate and as you already stated, and higher resolution than most 
other solutions. http://msdn.microsoft.com/en-us/magazine/cc163996.aspx is 
where I got the idea and most of the implementation from. I'm essentially using 
the code from Figure 2 in a C extension right now to do something similar to 
threading.Timer in a performance testing tool.

--
nosy: +brian.curtin

___
Python tracker 

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



[issue10907] OS X installer: warn users of buggy Tcl/Tk in OS X 10.6

2011-01-14 Thread Ned Deily

Ned Deily  added the comment:

(I'll plan to commit to py3k later today pending any review comments and submit 
expanded pydotorg changes.)

--
nosy: +michael.foord, ronaldoussoren
stage:  -> commit review
Added file: http://bugs.python.org/file20408/pydotorg_10_6_tk.patch

___
Python tracker 

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



[issue10896] trace module compares directories as strings (--ignore-dir)

2011-01-14 Thread SilentGhost

SilentGhost  added the comment:

#10908 is dealing with this and other issue re ignored dirs.

--
status: open -> closed
superseder:  -> Improvements to trace._Ignore

___
Python tracker 

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



[issue10908] Improvements to trace._Ignore

2011-01-14 Thread SilentGhost

New submission from SilentGhost :

In the course of fixing #10896 I've noticed a few things:

 1. --ignore-dir='$prefix' doesn't work on windows. I don't know if it has to, 
there is no information in docs regarding it at all. It does work on Unix.
 2. The way module check is done is inefficient.
 3. I'm not sure if filename could ever get the value of None in _Ignore.names 
(there is check for that though)
 4. it's not clear why _Ignore initialised with default values of None, that 
path was never exercised and while I've added a test for it, I'm actually not 
sure if it's needed.
 5. general clean up was needed for the code dealing with ignoring.

Attached is the patch.
 The only change, that I consider beneficial, is that the ignored dir doesn't 
have actually be a directory.

--
components: Library (Lib)
files: trace_ignore.diff
keywords: easy, patch
messages: 126271
nosy: SilentGhost, belopolsky, vrutsky
priority: normal
severity: normal
status: open
title: Improvements to trace._Ignore
versions: Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file20407/trace_ignore.diff

___
Python tracker 

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



[issue10907] OS X installer: warn users of buggy Tcl/Tk in OS X 10.6

2011-01-14 Thread Ned Deily

New submission from Ned Deily :

With 2.7 and now 3.2, we have been supplying two variants of OS X installers: 
the traditional 32-bit only version dynamically linked with Tk 8.4, the only 
version available across all supported OS X releases; and a new 64-bit/32-bit 
version dynamically linked with Tk 8.5 for 10.6 only.  The Tcl/Tk 8.5 version 
supplied by Apple in OS X 10.6 has proven to work badly with IDLE and other 
Tkinter applications; issues reported include hangs when pasting text or 
opening new editor windows or after syntax errors.  Until recently, it was the 
only standard version of non-X11 Tcl/Tk that was supported for both 64-bit and 
32-bit executables.  Recently, ActiveState has released a newer version of Tk 
8.5 that is ABI-compatible with the Apple 10.6 one but which behaves much 
better with IDLE and Tkinter, with none of the previously reproducible hangs 
detected so far.  Since the Python OS X installer depends on an external source 
for Tk, either the default Apple-suppled one or, now, an option
 al 3rd-party install like those from ActiveState, it is important that users 
are aware that there are options and that they can avoid bad experiences with 
IDLE crashing, etc.  Because we are dependent on dynamic libraries, it is 
possible that the situation could change over the lifetime of the Python 
release, i.e. the Apple could update Tk in 10.6 or new problems could be found. 
 So the solution here should allow for that.

The attached patches take the following approach:

1. Define a canonical URL on the Python web site for a page that provides the 
latest status information on supported and recommended Tcl/Tk versions for all 
recent Python OS X installers.  The URL chosen is:  
http://www.python.org/download/mac/tcltk/

2. Add to the OS X Installer Welcome message and ReadMe files prominent 
references to the new web page.

3. Add an OS X only check in IDLE initialization to see if tkinter is running 
with the known buggy Apple version.  If so, output a warning message via a 
print statement executed in the IDLE shell window:

   WARNING: The version of Tcl/Tk (8.5.7) in use may be unstable.
   Visit http://www.python.org/download/mac/tcltk/ for current information.

Since it is possible the user will not be able to install ActiveTcl for some 
reason (licensing issues, perhaps), issuing the warning through the existing 
shell window will be much less obtrusive than opening an error window that 
would need to be dismissed every time IDLE is invoked.

4. Populate and maintain the new web page with the relevant information about 
OS X installer versions and Tcl/Tk versions.  Make it easy for the user to find 
do the right thing.  Attached is a first draft of the web page to show the 
basic approach.

5. Add and maintain references on the main Download page and the 
release-specific pages to the new web page.  Those changes are also included in 
the web site patch.

6. Document and publish workarounds for 2.7.1 64-bit installer users.

7. Backport the 3.2 fixes for 2.7.2.

--
assignee: ned.deily
components: Build, IDLE, Macintosh
files: issue_10_6_tk.patch
keywords: patch
messages: 126270
nosy: benjamin.peterson, georg.brandl, ned.deily
priority: release blocker
severity: normal
status: open
title: OS X installer: warn users of buggy Tcl/Tk in OS X 10.6
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file20406/issue_10_6_tk.patch

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

Remove tmpy44zj7.html and tmpav1vve.html: a similar file is included in 
full_source_and_error.zip.

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12751/tmpy44zj7.html

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file12750/tmpav1vve.html

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file20269/cgi_plus_tests.diff

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

Remove cgi_plus_tests.diff: it looks to be an old version of cgi_32.patch.

@r.david.murray: Did you write cgi_plus_tests.diff, or is it based on the work 
on Pierre Quentel?

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file20403/cgi_32.patch

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

haypo>> What is the latest patch for test_cgi?
quentel> My latest patch for test_cgi is in cgi_32.patch

Ok, but cgi_32.patch doesn't add any test. I only adapt existing tests for your 
other changes.

I remove cgi_32.patch because it was commited.

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel

Pierre Quentel  added the comment:

My latest patch for test_cgi is in cgi_32.patch

I will try to add more tests later

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel

Changes by Pierre Quentel :


Removed file: http://bugs.python.org/file20405/unnamed

___
Python tracker 

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



[issue8232] webbrowser.open incomplete on Windows

2011-01-14 Thread Dev Player

Dev Player  added the comment:

Don't forget to check if the MS Internet Explorer's advanced option to open new 
URLS in a seperate windows effects this.  Users can have this advanced setting 
set differently on different computers(or even accounts). Also different 
browser versions call that option by different names. And I think there may 
even be a way to turn off tabs altogether, so check that too.

--
nosy: +devplayer

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

TODO: Add more tests to test_cgi. What is the latest patch for test_cgi?

--

___
Python tracker 

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



[issue10906] wsgiref should mention that CGI scripts usually expect HTTPS variable to be set to 'on'

2011-01-14 Thread anatoly techtonik

New submission from anatoly techtonik :

http://docs.python.org/library/wsgiref.html#wsgiref.util.guess_scheme

The documentation says servers typically set HTTPS variable to a value of “1” 
or “yes”, when a request is received via SSL, but CGI tutorials, IIS and Apache 
set this to “on”.

Misleading documentation may be the reason of the bug with mod_wsgi that 
changes Apache's variable from “on” to “1” - 
https://issues.apache.org/bugzilla/show_bug.cgi?id=50581

The documentation should at least stress that “on” is the mainstream value for 
this variable. It will help to mention at least one popular server that returns 
“1”.

--
assignee: docs@python
components: Documentation
messages: 126263
nosy: docs@python, techtonik
priority: normal
severity: normal
status: open
title: wsgiref should mention that CGI scripts usually expect HTTPS variable to 
be set to 'on'
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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel

Pierre Quentel  added the comment:

Thanks a lot Victor !

I wrote the patch : Pierre Quentel (pierre.quen...@gmail.com) with many
inputs by Glenn Linderman

2011/1/14 STINNER Victor 

>
> STINNER Victor  added the comment:
>
> Oh, I forgot to credit the author(s): who wrote the patch?
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--
title: cgi module cannot handle POST with multipart/form-data in3.x -> 
cgi module cannot handle POST with multipart/form-data in 3.x
Added file: http://bugs.python.org/file20405/unnamed

___
Python tracker 

___Thanks a lot Victor !I wrote the patch : Pierre Quentel (mailto:pierre.quen...@gmail.com";>pierre.quen...@gmail.com) with many 
inputs by Glenn Linderman2011/1/14 STINNER 
Victor rep...@bugs.python.org>

STINNER Victor victor.stin...@haypocalc.com> 
added the comment:

Oh, I forgot to credit the author(s): who wrote the patch?

--

___
Python tracker rep...@bugs.python.org>
http://bugs.python.org/issue4953>
___

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



[issue3978] ZipFileExt.read() can be incredibly slow; patch included

2011-01-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I am still seeing the same performance as the OP when I use
> extractall() with a password protected ZIP of size 287 MB (containing
> one compressed movie file of size 297 MB).

Please try with a non-password protected file.

--

___
Python tracker 

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



[issue3978] ZipFileExt.read() can be incredibly slow; patch included

2011-01-14 Thread Andre Berg

Andre Berg  added the comment:

If I may chime in, as I don't know where else to put this.

I am still seeing the same performance as the OP when I use extractall() with a 
password protected ZIP of size 287 MB (containing one compressed movie file of 
size 297 MB).

The total running time for extractall.py was
real35m24.448s
user34m52.423s
sys0m1.448s

For a bash script using unzip -P the running time on the same file was

real0m19.026s
user0m8.359s
sys 0m0.414s

extractall.py loops over the contents of a directory using os.walk, identifies 
zip files by file extension and extracts a certain portion of the filename as 
password using a regex. If I leave the ZipFile.extractall part out of it and 
run it it takes 0.15 s.

This is with Python 2.7.1 and Python 3.1.2 on Mac OS X 10.6.4 on an 8-core 
MacPro with 16 GB of RAM. The file is read from an attached USB drive. Maybe 
that makes a difference. I wish I could tell you more.

This is just for the record. I don't expect this to be fixed.

--
nosy: +andreb

___
Python tracker 

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



[issue10905] zipfile: fix arcname with leading '///' or '..'

2011-01-14 Thread Zhigang Wang

Zhigang Wang  added the comment:

Yes, in zipfile, we just overwrite it. Actually, ZipFile.extract() overwrite 
existing files already. If we want it more powerful, we can add a 'overwrite' 
parameter. But turning zipfile a full featured zip/unzip tool needs much more 
extra work...

--

___
Python tracker 

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



[issue10905] zipfile: fix arcname with leading '///' or '..'

2011-01-14 Thread Zhigang Wang

Zhigang Wang  added the comment:

$ unzip -l t.zip 
Archive:  t.zip
  Length  DateTimeName
-  -- -   
3  01-14-2011 21:11   ../foo
3  01-14-2011 21:11   foo
- ---
6 2 files
[zhigang@localhost tmp]$ unzip -d aa t.zip
Archive:  t.zip
warning:  skipped "../" path component(s) in ../foo
 extracting: aa/foo  
replace aa/foo? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
 extracting: aa/foo  


$ 7za x -oaa t.zip 

7-Zip (A) 9.13 beta  Copyright (c) 1999-2010 Igor Pavlov  2010-04-15
p7zip Version 9.13 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,1 CPU)

Processing archive: t.zip

file aa/foo
already exists. Overwrite with 
../foo?
(Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename all / (Q)uit? A
Extracting  ../foo
Extracting  foo

Everything is Ok

Files: 2
Size:   6
Compressed: 198

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, I forgot to credit the author(s): who wrote the patch?

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread STINNER Victor

STINNER Victor  added the comment:

r87996+r87997 adds encoding and errors argument to parse_qs() and parse_qsl() 
of urllib.parse. It is needed to decoded correctly %XX syntax in cgi.

r87998 is the patch on the cgi module.

Changes with cgi_32.patch:

 * Use TextIOWrapper instead of TextIOBase, because TextIOBase has no buffer
   attribute
 * typo in a docstring: "it must must" => "must"
 * (docstring) default: sys.stdin => default: sys.stdin.buffer
 * PEP 8: hasattr(a,b) => hasattr(a, b) (same for isinstance) and
   "encoding = 'utf-8'" => "encoding='utf-8'" (in the argument list)
 * "xxx.decode(...) # str": remove useless # str comment. decode() always give
   unicode in Python 3 (same change for ".encode() # bytes")
 * Rename "next" variables to "next_boundary" because next is a builtin
   function in Python 3 (unrelated change).
 * FieldStorage.innerboundary and FieldStorage.outerboundary are bytes objects:
   encode innerboundary in the constructor, and raise an error if outerboundary
   is not a bytes object
 * Rename _use_bytes to _binary_file
 * isinstance(bytes) test: write the type, not the value, in the error message
 * Replace line[:2] == b'--' by line.startswith(b'--'), and then replace
   line.strip() by line.rstrip()
 * test_fieldstorage_multipart() uses ASCII (and specifiy the encoding to 
FieldStorage)
 * add FieldStorage.errors attribute: pass it to parse_qsl()
 * add errors attribute to FieldStorage: same default value than 
urllib.parse.unquote(): 'replace'
 * parse(): pass encoding argument to parse_qs()
 * FieldStorage: pass encoding and errors arguments to parse_qsl()

Because the patch on TextIOBase, it patched the docstring:
---
fp  : file pointer; default: sys.stdin.buffer
(not used when the request method is GET)
Can be :
1. an instance of (a subclass of) TextIOWrapper, in this case it
must provide an attribute "buffer" = the binary layer that returns
bytes from its read() method, and preferably an attribute
"encoding" (defaults to latin-1)
2. an object whose read() and readline() methods return bytes
---
becomes
---
fp  : file pointer; default: sys.stdin.buffer
(not used when the request method is GET)
Can be :
1. a TextIOWrapper object
2. an object whose read() and readline() methods return bytes
---

Replace "type(value) is type([])" is done in another commit: r87999.

I consider that the work on this issue is done, and so I close it. If I am 
wrong, explain why and repoen the issue.

Please test the cgi as much as possible before Python 3.2 final: reopen the 
issue if it doesn't work.

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



[issue10905] zipfile: fix arcname with leading '///' or '..'

2011-01-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

What happens when the archive contains both 'foo' and '../foo'? They seem to be 
extracted at the same place.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue10905] zipfile: fix arcname with leading '///' or '..'

2011-01-14 Thread Zhigang Wang

New submission from Zhigang Wang :

We only support arcname with one leading '/', but not more. This patch fixes it.

We don't support arcname with '..' well. The default behavior of unzip and 7z 
is to ignore all '..'. This patch does the same.

Also updated the doc. If there are other security related issues exist, we 
should revise the doc.

Please review.

--
components: Library (Lib)
files: python-zipfile-fix-arcname.patch
keywords: patch
messages: 126254
nosy: zhigang
priority: normal
severity: normal
status: open
title: zipfile: fix arcname with leading '///' or '..'
type: security
versions: Python 3.3
Added file: http://bugs.python.org/file20404/python-zipfile-fix-arcname.patch

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel

Changes by Pierre Quentel :


Removed file: http://bugs.python.org/file20402/cgi_32.patch

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel

Pierre Quentel  added the comment:

Glenn, you read my mind ;-)

Thanks for mentioning the O_BINARY thing. New (last !) patch attached

--
Added file: http://bugs.python.org/file20403/cgi_32.patch

___
Python tracker 

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



[issue10904] PYTHONIOENCODING is not in manpage

2011-01-14 Thread Peter Kleiweg

New submission from Peter Kleiweg :

The environment variable PYTHONIOENCODING should be documented in de manpage

--
assignee: docs@python
components: Documentation, IO
messages: 126252
nosy: docs@python, pebbe
priority: normal
severity: normal
status: open
title: PYTHONIOENCODING is not in manpage
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Glenn Linderman

Glenn Linderman  added the comment:

Pierre, Thank you for the new patch, with the philosophy of "it's broke, so 
let's produce something the committers like to get it fixed".

I see you overlooked removing the second use of O_BINARY.  Locally, I removed 
that also, and tested your newest patch, and it still functions great for me.

--

___
Python tracker 

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



[issue10903] ZipExtFile:_update_crc fails for CRC >= 0x80000000

2011-01-14 Thread arindam

New submission from arindam :

File: zipfile.py
Function: _update_crc
statement: if eof and self._running_crc != self._expected_crc:

Due to comparison of long with int, "if eof and self._running_crc != 
self._expected_crc:" fails when _expected_crc is negative (0x8000 or more). 
Type of _running_crc is long while _expected_crc is int.

How to reproduce: Unzip a zip file containing a file having CRC >= 0x8000.

The issue is seen with 3.1 also.

--
components: Library (Lib)
messages: 126250
nosy: arindam
priority: normal
severity: normal
status: open
title: ZipExtFile:_update_crc fails for CRC >= 0x8000
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Etienne Robillard

Etienne Robillard  added the comment:

+1

thanks for this input. I agree for the most part. However if the io
semantics in python 3 is radically different than on python 2, I could
have expected that WSGI scripts would similarly depend on a newer
type of file descriptor access using the ``sys`` module.

cheers!

--

___
Python tracker 

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



[issue10278] add time.wallclock() method

2011-01-14 Thread Matt Joiner

Matt Joiner  added the comment:

This is sorely needed. IMO the current behaviour of time.clock works for 
Windows, and clock_gettime(CLOCK_MONOTONIC) on POSIX or 
clock_gettime(CLOCK_MONOTONIC_RAW) on Linux>=2.6.28.

There are some related discussions on StackOverflow that may contain useful 
ideas also:
http://stackoverflow.com/questions/1205722/how-do-i-get-monotonic-time-durations-in-python
http://stackoverflow.com/questions/4687408/retrieve-wall-time-in-python-using-the-standard-library

--
nosy: +anacrolix

___
Python tracker 

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



[issue10902] Doc type: "run_*" instead of "run*" on http://docs.python.org/library/pdb.html

2011-01-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

Committed to release31 in r87995 (with svnmerge)

--
status: open -> closed

___
Python tracker 

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



[issue9844] calling nonexisting function under __INSURE__

2011-01-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

Backported to release31: r87994 (with svnmerge)

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



[issue10902] Doc type: "run_*" instead of "run*" on http://docs.python.org/library/pdb.html

2011-01-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

Georg, thanks - will keep that in mind. Here I started with 2.7 since this is 
what the user reported on. I plan to have it committed to all 3 branches today 
anyhow.

--

___
Python tracker 

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



[issue10902] Doc type: "run_*" instead of "run*" on http://docs.python.org/library/pdb.html

2011-01-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Ah, true - I forgot svnmerge for 27-maint was based on the py3k branch.

--

___
Python tracker 

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



[issue10902] Doc type: "run_*" instead of "run*" on http://docs.python.org/library/pdb.html

2011-01-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

Committed to py3k r87993

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel

Changes by Pierre Quentel :


Removed file: http://bugs.python.org/file20387/cgi_32.patch

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.x

2011-01-14 Thread Pierre Quentel

Pierre Quentel  added the comment:

@Victor

Thanks for the comments

"- I don't understand why FieldStorage changes sys.stdout and sys.stderr (see 
remarks about IOMix above): please remove the charset argument (it is also 
confusing to have two encoding arguments). it should be done somewhere else"

done

"please remove the O_BINARY hack: the patch is for Python 3.2 and I closed 
issue #10841. If you would like a backport, another patch should be written 
later"

done

""encoding = 'latin-1' # ?": write a real comment or remove it"

I removed this part

"'self.fp.read(...) # bytes': you should add a test on the type if you are not 
sure that fp.read() gives bytes"

added tests in read_urlencoded(), read_multi() and read_binary()

 "file: the file(-like) object from which you can read the data *as bytes*": 
you should mention that TextIOWrapper is also tolerated (accepted?)"

not done : here "file" is not the argument passed to the FieldStorage 
constructor, but the attribute of values returned from calls to FieldStorage. 
In the new implementation, its read() method always returns bytes

"you may set fp directly to sys.stdin.buffer (instead of sys.stdin) if fp is 
None (it will be easier after removing the O_BINARY thing)"
 
done
 
 "the patch adds a tab in an empty line, please don't do that :-)"
 
done (hopefully :-)
 
"you should add a (private?) attribute to FieldStorage to decide if it works on 
bytes or unicode, instead of using "self.filename is not None" test (eg. 
self._use_bytes = (self.filename is not None)"

done

 "i don't like the idea of having a generic self.__write() method supporting 
bytes and unicode. it would prefer two methods, eg. self.__write_text() and 
self.__write_binary() (they can share a third private method)"
 
not done, the argument of __write is always bytes
 
"i don't like "stream_encoding" name: what is the "stream" here? do you process 
a "file", a "string" or a "stream"? why not just "self.encoding"?"

done

 - "import email.parser,email.feedparser" one import is useless here. I prefer 
"from email.feedparser import FeedParser" because you get directly a 
ImportError if the symbol is missing. And it's already faster to get FeedParser 
instead of email.feedparser.FeedParser in a loop (dummy micro-optimization)

done

" even I like the following change, please do it in a separated patch:
-if type(value) is type([]):
+if isinstance(value,list):"

not done

"I really don't like the IOMix thing:"

removed

"I vote +0 to commit the patch now (if the release manager agrees), and +1 if 
all of my remarks are fixed."

should be close to +0.8 now ;-)

--
Added file: http://bugs.python.org/file20402/cgi_32.patch

___
Python tracker 

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



[issue10902] Doc type: "run_*" instead of "run*" on http://docs.python.org/library/pdb.html

2011-01-14 Thread Georg Brandl

Georg Brandl  added the comment:

That's the wrong way of porting though... py3k first, then 2.7 and 3.1.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue10902] Doc type: "run_*" instead of "run*" on http://docs.python.org/library/pdb.html

2011-01-14 Thread Eli Bendersky

Eli Bendersky  added the comment:

Committed to release27-maint r87992

--
resolution:  -> fixed

___
Python tracker 

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