[issue10877] Make Tools (and subdirs) a package (and subpackages)

2011-01-11 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

I don't think this is a good idea.  For one thing, it only works in a checkout 
or source tarball, something that most users aren't going to work with.

If we now publish that they can do import Tools.demo.redemo and so on, 
confusion will be great among those whose installation doesn't include Tools.  
In effect, you've added a new (and huge!) standard library package, and that's 
not something we do lightly or just before rc :)

Also, Tools is mostly interesting for developers only.  I'd rather put the 
things useful for users into the standard library at some point.

--
resolution:  - rejected
status: open - closed

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



[issue6792] Distutils-based installer does not detect 64bit versions of Python

2011-01-11 Thread Christoph Gohlke

Changes by Christoph Gohlke cgoh...@uci.edu:


--
nosy: +cgohlke

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread Tomas Kubes

Tomas Kubes mr_na...@centrum.cz added the comment:

I am sorry, but as an original initiator of the the issue I find the 
argumentation of Alexander Belopolsky vastly ridiculous. Are you really 
seriously convinced that an average person responsible for Python application 
development and maintenance would be aware of a necessity to look for an ANSI C 
documentation to find a description and definitions of time functions?

You sound like Marie Antoinette who replied to peasants complaining the they do 
not have any bread to eat that they should eat brioches instead. Maybe in the 
context of the “royal programmers family” documentation to ANSI C is wildly 
known and even memorized, but I do insist that Python documentation should be 
accessible and understandable even to ordinary peasants of the computer kingdom.

And I keep my case that the current description might trick programmers to 
think that it holds information whether the summer time currently applies 
rather than just plain information about current time zone being able to use 
summer time.

Regards
Tomas

--
status: pending - open

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



[issue4112] Subprocess: Popen'ed children hang due to open pipes

2011-01-11 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

This issue has been fixed on 3.2.

--
nosy: +rosslagerwall
versions:  -Python 3.2

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



[issue10556] test_zipimport_support mucks up with modules

2011-01-11 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Even more special: put a test_doctest in first and the attempt to clean up 
sys.modules in test_zipimport_support leaves things alone so the _ssl module 
doesn't break (test_doctest just leaves sys.modules alone and doesn't even try 
to remove all the modules it implicitly imports).

I'm actually tempted to remove test.support.modules_setup() and 
modules_cleanup() and delete the calls from the affected tests. Trying to clear 
out implicitly imported modules is going to create far more problems than it 
resolves.

--

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

Classic user developer impedance mismatch. =)

I agree that Python should guard its users against crazy standards that creep 
into standard lib, because nobody had time to think about pythonic API.

I propose the following change:

http://docs.python.org/library/time.html#time.altzone
-  UTC offset of the local DST timezone if one is defined. Only use this if 
daylight is nonzero.
+  UTC offset of the current timezone with Daylight Savings Time (DST) 
correction. To check if DST is currently active, use 
`time.localtime(t).tm_isdst`

http://docs.python.org/library/time.html#time.daylight
-  Nonzero if a DST timezone is defined.
+  Flag indicating that current timezone has Daylight Savings Time (DST) 
offset. To check if DST is currently active, use `time.localtime(t).tm_isdst`

http://docs.python.org/library/time.html#time.timezone
-  UTC offset of the local (non-DST) timezone
+  UTC offset of the current timezone. It doesn't include Daylight Savings Time 
(DST) correction. See `time.altzone` for that.


BTW, isn't the following check redundant?
if time.localtime(t).tm_isdst and time.daylight:

--

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



[issue1667546] Time zone-capable variant of time.localtime

2011-01-11 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

IIUC #9527 is about datetime and this request is about time.localtime, i.e. 
about making the API more intuitive for users. I don't think this issue should 
be closed.

--
status: pending - open

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



[issue10556] test_zipimport_support mucks up with modules

2011-01-11 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Fixed for 3.2 in r87925. (I simply dropped the attempt to restore sys.modules 
to its original state from test_zipimport_support)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10556
___
___
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.0

2011-01-11 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

I said:
I wonder what result you get with the same browser, at the web page 
http://rishida.net/tools/conversion/ by entering the euro symbol into the 
Characters entry field, and choosing convert.

But I couldn't wait, so I ran a test with € in one of my input boxes, using 
Firefox, a FORM as:
form enctype=multipart/form-data method=post action=...

and below is the Live Headers report.  I note several things that seem relevant 
to this issue.

1) The character encoding isn't specified anywhere.  In fact, the only 
content-type specification is the multipart/form-data in the environment.

2) Except for the Euro, everything in the data stream is ASCII (but could be 
ISO-8859-1, or latin-1).  

3) Looking separately at the byte stream read by my experimental version of 
cgi.py which prints the bytes as they are read, I see that the encoding of the 
Euro is UTF-8:  '\xe2\x82\xac'

4) Because of 1), it is clear that default encoding types must be applied, and 
it is clear that Firefox provides UTF-8.

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) 
Gecko/20101203 Firefox/3.6.13
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Type: multipart/form-data; 
boundary=---1650566221634
Content-Length: 527
-1650566221634
Content-Disposition: form-data; name=type

summary
-1650566221634
Content-Disposition: form-data; name=submit

Search
-1650566221634
Content-Disposition: form-data; name=pre

€
-1650566221634
Content-Disposition: form-data; name=part


-1650566221634
Content-Disposition: form-data; name=key


-1650566221634--

--

___
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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-11 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

R. David:

Pierre said:
BytesFeedParser only uses the ascii codec ; if the header has non ASCII 
characters (filename in a multipart/form-data), they are replaced by ? : the 
original file name is lost. So for the moment I leave the text version of 
FeedParser

I say:
Does this mean BytesFeedParser, to be useful for cgi.py, needs to accept an 
input parameter encoding, defaulting to ASCII for the email case?  Should that 
be a new issue?  Or should cgi.py, since it can't use email to do all its work 
(no support for file storage, no support for encoding) simply not try, and use 
its own code for header decoding also?  The only cost would be support for 
Encoded-Word -- but it is not clear that HTTP uses them?  Can anyone give an 
example of such?  Read the next message here for an example of filename 
containing non-ASCII.

--

___
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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-11 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

In my previous message I quoted Pierre rightly cautioning about headers 
containing non-ASCII... and that BytesFeedParser doesn't, so using it to parse 
headers may be questionable.

So I decided to try one... I show the Live HTTP headers below, from a simple 
upload form.  What is not so simple is the filename of the file to be 
uploaded... it contains a couple non-ASCII characters... in fact, one of them 
is non-latin-1 also: foöţ.html.  It rather seems that Firefox provides the 
filename in UTF-8, although Live HTTP headers seems to have displayed it using 
Latin-1 on the screen!  But in saving it to a file, it didn't write a BOM, and 
the byte sequence for the filename is definitely UTF-8, and pasted here to be 
viewed correctly.

So my question: where does Firefox get its authority to encode the filename 
using UTF-8 ???

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) 
Gecko/20101203 Firefox/3.6.13
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://rkivs.com.gl:8032/row/test.html
Content-Type: multipart/form-data; 
boundary=---207991835220448
Content-Length: 304
-207991835220448
Content-Disposition: form-data; name=submit

upload
-207991835220448
Content-Disposition: form-data; name=pre; filename=foöţ.html
Content-Type: text/html

aoheutns

-207991835220448--

--

___
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



[issue10885] multiprocessing docs

2011-01-11 Thread Ross Lagerwall

New submission from Ross Lagerwall rosslagerw...@gmail.com:

I think there is a small docs bug: it says that multiprocessing.Semaphore is a 
bounded semaphore. Shouldn't it says that it is just a semaphore.

Attached is a patch to fix this.

--
components: Library (Lib)
files: docupdate.patch
keywords: patch
messages: 125995
nosy: georg.brandl, rosslagerwall
priority: normal
severity: normal
status: open
title: multiprocessing docs
versions: Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file20354/docupdate.patch

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



[issue10886] Unhelpful backtrace for multiprocessing.Queue

2011-01-11 Thread Torsten Landschoff

New submission from Torsten Landschoff t.landsch...@gmx.net:

When trying to send an object via a Queue that can't be pickled, one gets a 
quite unhelpful traceback:

Traceback (most recent call last):
  File /usr/lib/python2.6/multiprocessing/queues.py, line 242, in _feed
send(obj)
PicklingError: Can't pickle type 'module': attribute lookup 
__builtin__.module failed

I have no idea where I am sending this. It would be helpful to get the call 
trace to the call to Queue.put.

My workaround was to create a Queue via this function MyQueue:

def MyQueue():
import cPickle
def myput(obj, *args, **kwargs):
cPickle.dumps(obj)
return orig_put(obj, *args, **kwargs)

q = Queue()
orig_put, q.put = q.put, myput
return q

That way I get the pickle exception in the caller to put and was able to find 
out the offending code.

--
components: Library (Lib)
messages: 125996
nosy: torsten
priority: normal
severity: normal
status: open
title: Unhelpful backtrace for multiprocessing.Queue
type: feature request
versions: Python 2.6

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread Tomas Kubes

Tomas Kubes mr_na...@centrum.cz added the comment:

Hello,

I find this version very clear.

Thanks
Tomas

--

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



[issue10887] Add link to development ML

2011-01-11 Thread anatoly techtonik

New submission from anatoly techtonik techto...@gmail.com:

Tarek, can you add link to 
http://groups.google.com/group/the-fellowship-of-the-packaging to distutils dev 
pages at https://bitbucket.org/tarek/distutils2/wiki/Home ?

--
assignee: tarek
components: Distutils2
messages: 125998
nosy: eric.araujo, tarek, techtonik
priority: normal
severity: normal
status: open
title: Add link to development ML

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Thanks for writing this.
Follows my comments.

I would focus on trying to provide a unique interface across all platforms. 
Being sendfile() not a standard POSIX I think we should not worry about 
providing a strict one-to-one interface.

headers and trailers arguments should be available everywhere as they are 
crucial in different protocols such as HTTP.
On Linux this is possible by using the TCP_CORK option.
man sendfile on Linux provides some information. Also you might find useful 
to see how medusa did this (/medusa-20010416/sendfile/sendfilemodule.c):
http://www.nightmare.com/medusa/

The offset parameter should be available everywhere, Linux included (in your 
patch you dropped Linux support).
Also, I think it should be optional since when it's NULL, sendfile() implicitly 
assumes the current offset (file's tell() return value).
This is true on Linux, at least. Not sure about other platforms but my best 
guess is that it should not be mandatory.

It turns out the only peculiar argument is flags, available only on *BSD.
I'm not sure what's best to do here. Maybe it makes sense to provide it across 
all platforms, defaulting to 0 and raise ValueError when specified on systems 
!= *BSD.
In summary, the function might look like this:

sendfile(out, in, count, offset=None, headers=None, trailers=None, flags=0)

--

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 Also, I think it should be optional since when it's NULL, sendfile() 
 implicitly assumes the current offset (file's tell() return value).
 This is true on Linux, at least. Not sure about other platforms but my 
 best guess is that it should not be mandatory.

I'm not so sure about this anymore. Please ignore this.

--

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



[issue10884] pkgutil EggInfoDistribution requirements for .egg-info metadata

2011-01-11 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Thanks Michael for the report and fix.   Would you add a test for that fix?

Minor note: I follow docstrings good practices in my commit messages, making 
sure that the first line makes sense on its own (it’s used in short logs) and 
wrapping my lines under 80 characters, for the usual reasons.

--
versions: +3rd party -Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 
3.2, Python 3.3

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



[issue10848] Move test.regrtest from getopt to argparse

2011-01-11 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
keywords:  -easy

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

Just to be clear:

There are 3 different interfaces.
The basic one with the offset included  no headers/trailers is supported by 
all the platforms, including Linux.
The one with offset as None is only supported by Linux.
The one with headers/trailers/flags is supported by FreeBSD  OS X.

So it does provide a unique interface across all platforms while still 
providing the ability to access the native functionality.

Preferably, I'd like to see a thin wrapper like this remain and then have a 
sendfile() method added to the socket object which takes a file-like object 
(not a file descriptor) and optional headers/trailers. This method can then 
figure out how best to do it depending on the platform. (i.e. using TCP_CORK if 
necessary, etc). It could even be made to work with file-like objects that 
cannot be mmap()ed.

Why not put it straight in socket anyway? Well, some of the implementations 
allow sendfile() to have a normal fd as the output. Putting it in socket then 
would't make sense.

--

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



[issue10868] ABCMeta.register() should work as a decorator

2011-01-11 Thread Edoardo Spadolini

Edoardo Spadolini keri...@gmail.com added the comment:

Yeah, I should've waited for the test to finish, but come on, it was just a 
small change :(

Now I know why you should always test everything at least, sorry about that :)

--

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



[issue10888] os.stat(filepath).st_mode gives wrong 'executable permission' result

2011-01-11 Thread dobbelaj

New submission from dobbelaj jeroen.dobbela...@gmail.com:

The 'os.stat' method on windows seems to be hardcoded to check the file name 
extension when computing the 'executable permission flag' (st_mode).

(See Modules/posixmodule.c:  win32_stat and win32_wstat)

Currently, it checks for : 
 '.bat', '.cmd', '.exe', '.com'

As dynamic libraries also must be executable on window, t should also check for 
: 
 '.dll'

It would be even better if the actual 'read and execute' permission is returned.

--
components: Windows
messages: 126004
nosy: jeroen.dobbelaere
priority: normal
severity: normal
status: open
title: os.stat(filepath).st_mode gives wrong 'executable permission' result
type: behavior
versions: Python 2.7

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



[issue9692] UnicodeDecodeError in ElementTree.tostring()

2011-01-11 Thread Ulrich Seidl

Ulrich Seidl ulrich.se...@muneda.com added the comment:

I would suggest adding an additional except branch to (at least) the following 
functions of ElementTree.py:
* _encode,
* _escape_attrib, and
* _escape_cdata 

The except branch could look like:

except (UnicodeDecodeError):
return text.decode( encoding ).encode( encoding, xmlcharrefreplace)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9692
___
___
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.0

2011-01-11 Thread Timothy Farrell

Changes by Timothy Farrell tfarr...@owassobible.org:


--
nosy:  -tercero12

___
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



[issue1667546] Time zone-capable variant of time.localtime

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Tue, Jan 11, 2011 at 5:06 AM, anatoly techtonik
rep...@bugs.python.org wrote:
..
 IIUC #9527 is about datetime and this request is about time.localtime,

This is correct, but did you notice what I wrote in my last message?


In order to properly implement #9527 in datetime.py, some kind of
tm_gmtoff support will need to be added to the time module, but I
don't want this to become a feature that is exclusively available from
the time module.


I am not rejecting this request, I am trying to consolidate two
closely related issues.  Can you explain why you believe this
functionality should be provided exclusively through the time module
and not be available in datetime?

--

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

I agree then, although I'm not sure there are other functions in the os module 
(or anywhere else) having a variable number of args depending on the platform.
I wanted to try your patch but it does not apply cleanly (python 3.2, revision 
87930).

--

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

I agree then, although I'm not sure having a function with a variable number of 
args depending on the platform is acceptable.
I wanted to try your patch but it does not apply cleanly (python 3.2, revision 
87930).

--

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


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

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



[issue10556] test_zipimport_support mucks up with modules

2011-01-11 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

2.7 and 3.1 don't appear to exhibit the fault, so closing this one.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Tue, Jan 11, 2011 at 4:55 AM, anatoly techtonik
rep...@bugs.python.org wrote:
..
 I propose the following change:
..
 http://docs.python.org/library/time.html#time.daylight
 -  Nonzero if a DST timezone is defined.
 + .. To check if DST is currently active, use `time.localtime(t).tm_isdst`

This is simply wrong. Your time.localtime(t).tm_isdst expression will
return the DST flag for the POSIX time value t, not for the current
time.  This could be fixed by replacing your proposed expression with
time.localtime().tm_isdst, but why do you think someone  reading about
time.daylight actually wants to check if DST is currently active?

What can be improved, though, is the documentation of time.tzset().
The current version fails to mention that  time.tzset() resets the
values of tzname, timezone, altzone and daylight.  This would be the
proper place to document the meaning of all three variables in greater
detail.  Individual entries can then refer to it with say See
time.tzset() for details.

Here is how POSIX tzset() is defined:


The tzset() function sets the external variable tzname as follows:

tzname[0] = std;
tzname[1] = dst;

where std and dst are as described in the XBD specification,
Environment Variables .

The tzset() function also sets the external variable daylight to 0 if
Daylight Savings Time conversions should never be applied for the time
zone in use; otherwise non-zero. The external variable timezone is set
to the difference, in seconds, between Coordinated Universal Time
(UTC) and local standard time.
  http://pubs.opengroup.org/onlinepubs/007908799/xsh/tzset.html

--

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



[issue9051] Improve pickle format for aware datetime instances

2011-01-11 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
versions: +Python 3.3 -Python 3.2

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



[issue9118] help() on a property descriptor launches interactive help

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Backported to 3.1 (r87934) and 2.7 (r87935).

--
resolution: accepted - fixed
status: open - closed

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



[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2011-01-11 Thread david

david db.pub.m...@gmail.com added the comment:

Thank you @loewis. However, I don't see where set_default_verify_path - is 
defined in the patch you have provided.

It would also be nice to do something like this:
import ssl
...
ssl._FORCE_VERIFICATION = True

and even better would be to determine the CA path as @pitrou was suggesting and 
incorporate this into the ssl module somehow.

--
nosy: +db

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



[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

New patch needed to address the issue of time.strftime() accepting %Y when year 
is 1900 and other similar oddities.  See msg107402 above.  Also a patch for 
datetime.py is needed.

--
stage: patch review - needs patch
versions: +Python 3.3 -Python 3.2

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



[issue4112] Subprocess: Popen'ed children hang due to open pipes

2011-01-11 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue5109] array.array constructor very slow when passed an array object.

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Georg,

Is it too late to commit this for 3.2?

--
nosy: +georg.brandl

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

I've just tried it against r87935 and it applies cleanly.

Perhaps you didn't apply the patch correctly (it requires -p1 since it was a 
Mercurial diff), try:
   patch -p1  sendfile_v2.patch

With regards to the different arguments, I don't know if that's acceptable or 
not or if there is a better way. Since you can have mmap.mmap() with differing 
args between Windows  Unix, maybe it is acceptable. And, Python exposes 
differing functionality via the posix module since the available functions 
differs widely between platforms.

--

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



[issue9860] Building python outside of source directory fails

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Here is a related bug:

$ make patchcheck
./python.exe ../py3k-commit/Tools/scripts/patchcheck.py
Getting the list of files that have been added/changed ... need a checkout to 
get modified files
[49399 refs]
make: *** [patchcheck] Error 1

--
versions: +Python 3.3 -Python 3.1

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



[issue10889] Fix range slicing and indexing to handle lengths sys.maxsize

2011-01-11 Thread Nick Coghlan

New submission from Nick Coghlan ncogh...@gmail.com:

Enhancement to range to correctly handle indexing and slicing when len(x) 
raises OverflowError.

Note that this enables correct calculation of the length of such ranges via:

def _range_len(x):
try:
length = len(x)
except OverflowError:
step = x[1] - x[0]
length = 1 + ((x[-1] - x[0]) // step)
return length

--
assignee: ncoghlan
messages: 126017
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Fix range slicing and indexing to handle lengths  sys.maxsize

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



[issue10888] os.stat(filepath).st_mode gives wrong 'executable permission' result

2011-01-11 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

The Read  Execute permission listed on a file's property window doesn't 
really mean anything. Executables only need read permissions [0] to actually be 
executed.

Additionally, in terms of _stat, Windows does its check by extension [1] but 
they don't specify what extensions they look for.

Adding .dll checking would be the most we could do here.



[0] http://technet.microsoft.com/en-us/library/bb727008.aspx
[1] See st_mode halfway down the page, 
http://msdn.microsoft.com/en-us/library/14h5k7ff(v=VS.90).aspx

--
components: +Extension Modules
keywords: +easy
nosy: +brian.curtin
stage:  - needs patch
versions: +Python 3.1, Python 3.2, Python 3.3

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread Tomas Kubes

Tomas Kubes mr_na...@centrum.cz added the comment:

why do you think someone  reading about
time.daylight actually wants to check if DST is currently active?

If you are not familiar with the cryptic names of POSIX but live in normal 
world, time.daylight sounds like a quite probable place where to check if the 
daylight savings are active. That's why I think the help text should 
explicitely note it has other meaning.

You should try to think like a person that does not have any background 
knowledge of underlying libraries but just looks through the time library 
trying to solve the question - how can I check if my machine uses daylight 
savings now.

Regards
Tomas

--

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
nosy:  -brian.curtin

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



[issue9305] Don't use east/west of UTC in date/time documentation

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

I've noticed that the time module docstring handles this issue rather nicely:

 help('time')
...
timezone -- difference in seconds between UTC and local standard time
altzone -- difference in  seconds between UTC and local DST time

We can use similar language for utcoffset(): difference between local time and 
UTC expressed as a timedelta.

--

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Tue, Jan 11, 2011 at 11:20 AM, Tomas Kubes rep...@bugs.python.org wrote:
..
 You should try to think like a person that does not have any background 
 knowledge of underlying libraries but
 just looks through the time library trying to solve the question - how can I 
 check if my machine uses daylight
 savings now.

I think you are confusing the purposes of a reference manual with that
of a tutorial or an FAQ collection.

I will keep this issue open, however, in case someone will come up
with a patch that does not introduce factual mistakes.   As I
suggested, the place to present details about tzname, timezone,
altzone and daylight variables is the section on time.tzset().  It is
currently devoted to a rather useless discussion of the TZ environment
variable syntax.  Instead, it should describe these variables and list
the functions whose behavior depends on the value of TZ
(time.localtime(), time.ctime(), time.mktime() and time.strftime()).

--

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



[issue10885] multiprocessing docs

2011-01-11 Thread Ross Lagerwall

Changes by Ross Lagerwall rosslagerw...@gmail.com:


--
assignee:  - d...@python
components: +Documentation
nosy: +d...@python

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread Tomas Kubes

Tomas Kubes mr_na...@centrum.cz added the comment:

 I think you are confusing the purposes of a reference manual with that
of a tutorial or an FAQ collection.

There is a fine line between them. Even though reference manual should not be a 
substitute for a tutorial, I still believe it should try to clarify potential 
confusions - after all it is the less experienced users who will most likely 
spend their time with it looking for something.

--

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



[issue10889] Fix range slicing and indexing to handle lengths sys.maxsize

2011-01-11 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Having started work on this, the code changes are probably too significant to 
consider adding it to 3.2 at this late stage.

Writing my own slice interpretation support which avoids the ssize_t limit is 
an interesting exercise :)

--
versions: +Python 3.3

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



[issue10875] Update Regular Expression HOWTO

2011-01-11 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


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

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



[issue10875] Update Regular Expression HOWTO

2011-01-11 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

Correction: r87912 and r87913 for 3.x

--

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



[issue10888] os.stat(filepath).st_mode gives wrong 'executable permission' result

2011-01-11 Thread Jeroen Dobbelaere

Jeroen Dobbelaere jeroen.dobbela...@gmail.com added the comment:

Some more background:
The actual issue was initially detected when observing that the 'tarfile' 
package produced a tar containing different permissions, depending on the 
script being executed by 'cygwin python' or 'native python'.

When using native python to do the 'untar', I did not observe any issue (as it 
seems to automatically add 'read and execute' for all files).
But, when I used 'cygwin tar', the .dll did not get its 'read and execute' 
permission (as it was not specified in the tar file), which then resulted in 
program that crashed (with a very unhelpful message). Allowing 'read and 
execute' manually resolved the crash.

So, although this permission should not mean anything, it does seem to have 
some influence :(

--

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



[issue1397474] timeit execution enviroment

2011-01-11 Thread rurpy the second

rurpy the second ru...@yahoo.com added the comment:

I find the changes suggested by T Reedy and refined in the 
patch by E Bendersky an improvement.  However, I found the 
following things confused me when reading it:

...constructor creates a function...
the constructor creates a Timeit instance, not a function.  
There is a method on that instance that is the function but 
the way it is phrased in like describing the autos coming off
a Ford production line as steering wheels.  As written, the 
statement creates an immediate WTF reaction in my mind.

...that executes the *setup* statement...
Use of term statement here is confusing as that term already
has a well defined meaning in Python docs.  One can't syntactically
use a statement as a function argument.  Only by suspending this
confusion and reading further does one discover that statement
here means a string containing text of some python code or a 
callable object.  

Use of statement (singular) also directly conflicts with following 
information that states multiple statements are ok.  

Since the synopsis line already refers to snippets, I think 
continuing to use that is better (having no preexisting conflicting
meanings) than statement.

...default to ``'pass'`... 
The call summary immediately above makes clear what the default
parameter values are.  While fine to repeat it in text, it is not
high priority information so should be moved to later in the
description.

...or newlines as long as they don’t contain  multi-line string literals...
What is a multi-line string literal?  The Language Reference - 
Lexical Analysis - String Literals section says nothing about 
multi-line literals.  
Is it a\nb?  Or a
b?  Both?
'a\nb' actually works.  'a
b' doesn't of course but it is it is also clearly not valid
python string syntax so I'm not sure that 'multi-line strings need 
even be mentioned.  If it is mentioned then it should be made clear 
that multi-line string literals are not allowed not because timeit
doesn't like them, but because python syntax allows no way to 
embed them in another string.
.
...pre-defined user objects...
What does pre-defined mean?  Builtin?  Imported from stdlib?
I would use a more explicit description here.

I also think a short explanation of *why* one needs to import 
program objects in 'setup' makes it a little easier and quicker 
to understand what one is doing with the import, particularly if
one is using timeit somewhere other than __main__..  Thus I 
suggest expanding that section slightly.

Here is my attempt to adjust taking the above observations into 
account.  (Sorry, can't supply a patch since I have slow internet
connection and don't have source.  Text below is just my hand edit
of the + lines in Eli's patch.)

  Class for timing execution speed of small code snippets.
  A Timeit instance will contain a function (see :meth:`Timer.timeit`)
  that executes a snippet of setup code once and then times some 
  number of executions of stmt code .  The code snippets, given as
  arguments *setup* and *stmt* when creating the instance, may be 
  either strings or callable objects.

  If a string, it may contain a python expression, statement, or
  multiple statements separated by ; or newlines.  Whitespace 
  adhering to the usual Python indentation rules must follow any
  newlines.

  If a callable object, (often a function), the object is called 
  with no arguments.  Note that the timing overhead is a little 
  larger in this case because of the extra function calls required.

  The *setup* and *stmt* parameters default to ``'pass'``.
  The *timer* parameter defaults to a platform-dependent 
  timer function (see the module doc string).

  When the *setup* and *stmt* are run, they are run in a 
  different namespace than that of the code that calls timeit(). 
  To give *stmt* (whether it is a callable name or code string) 
  access to  objects defined in the code that calls timeit, 
  *setup* can import any needed objects.  For example, if your
  code defines function testfunc(), *setup* can contain, 
  ``from __main__ import testfunc``, and code in   *stmt* can
  then call testfunc.

  To measure the execution time of *stmt*, use the :meth:`Timer.timeit()` 
method. 
  The :meth:`Timer.repeat()` method is a convenience to call 
:meth:`Timer.timeit()` 
  multiple times and return a list of results.

  Changed in version 2.6: The stmt and setup parameters can now
  also take objects.

Notes:

Added the line Whitespace adhering... because when using backslash-n
in strings it is easy to forget about any needed indentation.  Sentence
could be deleted if deemed too obvious.  There may also be a better 
way to phrase it; currently it might imply that some whitespace
is always neccessary if not enough attention paid to the usual
indentation rules phrase.


In msg116330 - Eli Bendersky (eli.bendersky) wrote:

 1) My tests show that passing the callable instead of the string
 'test()' actually takes longer to 

[issue10889] Fix range slicing and indexing to handle lengths sys.maxsize

2011-01-11 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Attached patch moves range indexing and slicing over to PyLong and updates the 
tests accordingly.

Georg, I think this really makes the large range story far more usable - if 
you're OK with it, I would like to check it in this week so it lands in 3.2.

--
assignee: ncoghlan - georg.brandl
keywords: +patch
nosy: +georg.brandl
versions: +Python 3.2 -Python 3.3
Added file: http://bugs.python.org/file20355/issue10889_range_subscripts.diff

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



[issue10888] os.stat(filepath).st_mode gives wrong 'executable permission' result

2011-01-11 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

 The actual issue was initially detected when observing that the
 'tarfile' package produced a tar containing different permissions,
 depending on the script being executed by 'cygwin python' or 'native python'.

I would expect that. Each of those work in their own world when it comes to 
file permissions, and there really isn't a 1-to-1 match when it comes to 
working in both environments.


On native Windows, Read  Execute has no real affect on applications, as it 
appears to be a synthetic permission probably constructed for that property 
window. I just looked at a number of definitely not executable files on my 
computer (e.g., text files), and they are all listed as Read  Execute. Even 
by right clicking and adding a new file with a garbage name, no extension, and 
no contents, it's still Read  Execute enabled.

Additionally, there is no programmatic way to set that Read  Execute flag 
that you see in the property window.

--

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



[issue10889] Fix range slicing and indexing to handle lengths sys.maxsize

2011-01-11 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Oh, and to explain my negative comment from earlier: that was my reaction when 
I realised I also needed to write PyLong versions of _PyEval_SliceIndex and 
PySlice_GetIndicesEx to make range slicing with large integers work properly.

As it turned out, the end result wasn't as scary as I initially feared (while 
compute_slice_indices is quite long, most of that is just the verbosity of 
PyLong arithmetic).

--

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



[issue2650] re.escape should not escape underscore

2011-01-11 Thread yeswanth

Changes by yeswanth swamiyeswa...@yahoo.com:


--
nosy: +swamiyeswanth

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



[issue10889] Fix range slicing and indexing to handle lengths sys.maxsize

2011-01-11 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

It's a moderate chunk of code, but lots of new tests... I'd say go for it.

--

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



[issue5109] array.array constructor very slow when passed an array object.

2011-01-11 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Should be fine to apply.  I trust all the different code paths for different 
types are tested?

--

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

It seems to me that the quoted function from bzr

def local_time_offset(t=None):
Return offset of local zone from GMT, either at present or at time t.
# python2.3 localtime() can't take None
if t is None:
t = time.time()

if time.localtime(t).tm_isdst and time.daylight:
return -time.altzone
else:
return -time.timezone

would be very helpful to add to the `time` module docs as an example.  I have 
to agree with the OP that the current state of the docs is not as clear as it 
could be.

--

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Tue, Jan 11, 2011 at 1:56 PM, Georg Brandl rep...@bugs.python.org wrote:
..
 It seems to me that the quoted function from bzr ...
 would be very helpful to add to the `time` module docs as an example.

The problem with this function is the same as with the doc patches
that have been proposed so far.  It is subtly wrong.  See issue
#1647654.  Specifically, see the link to a bug in Hg mentioned in
msg122166.

 I have to agree with the OP that the current state of the docs is not as 
clear as it could be.

In some ways the state of the docs is reflective of the state of the
code.  C/POSIX API on which time module design is based is not very
well suited to the age of smart phones and distributed VC systems.
The whole idea that there is a static system timezone is absurd when
a system is in your pocket or in the cloud.

I agree that the docs can be improved, but I don't see patches that
would constitute an improvement.  I've explained what I would see as
an improvement in my prior comments.

--

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



[issue10880] do_mkvalue and 'boolean'

2011-01-11 Thread Sergey Shepelev

Sergey Shepelev temo...@gmail.com added the comment:

Here's patch against 2.6


--- a/Python/modsupport.c   Tue Aug 24 18:19:58 2010 +0200
+++ b/Python/modsupport.c   Tue Jan 11 23:50:40 2011 +0300
@@ -459,6 +459,16 @@
 return v;
 }
 
+case '?':
+{
+int n;
+n = va_arg(*p_va, int);
+if (n == 0)
+Py_RETURN_FALSE;
+else
+Py_RETURN_TRUE;
+}
+
 case ':':
 case ',':
 case ' ':

--
nosy: +temoto

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10880
___
___
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.0

2011-01-11 Thread Pierre Quentel

Pierre Quentel pierre.quen...@gmail.com added the comment:

@Glenn
I'm curious what your system (probably Windows since you mention cp-) and 
browser, and HTTP server is, that you used for that test.  Is it possible to 
capture the data stream for that test?  Describe how, and at what stage the 
data stream was captured, if you can capture it.  Most interesting would be on 
the interface between browser and HTTP server.

I tested it on Windows XP Family Edition 2020, Service Pack 3, with Python 3.2b2
Browsers : Mozilla Firefox 3.6.13 and Internet Explorer 7.0
Servers : Apache 2.2, and the built-in server started by :

import http.server
http.server.test(HandlerClass=http.server.CGIHTTPRequestHandler)

I print the bytes received in the multipart/form-data part by 
print(odelim+line) at the end of method  read_lines_to_outerboundary() of 
FieldStorage. The bytes sent when I enter the string 
a+n tilde + the euro sign 
are : b'a\xf1\x80' - that is, the cp-1252 encoding of the string

Since it works the same with 2 browsers and 2 web servers, I'm almost sure it's 
not dependant on the configuration - but if others can tests on different 
configurations I'd like to know the result

Basically, this behaviour is not surprising : if sys.stdin.encoding is set to a 
certain value, it's natural that the bytes sent on the binary layer are encoded 
with this encoding, not with latin-1

I attach the diff file for an updated version of cgi.py :
- new argument stream_encoding instead of setting an attribute encoding to fp
- use locale.getpreferredencoding() to decode the query string

--
Added file: http://bugs.python.org/file20356/cgi_diff_20110111.txt

___
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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

On Tue, Jan 11, 2011 at 4:52 PM, Alexander Belopolsky
rep...@bugs.python.org wrote:
 ..
 http://docs.python.org/library/time.html#time.daylight
 -  Nonzero if a DST timezone is defined.
 + .. To check if DST is currently active, use `time.localtime(t).tm_isdst`

 This is simply wrong. Your time.localtime(t).tm_isdst expression will
 return the DST flag for the POSIX time value t, not for the current
 time.  This could be fixed by replacing your proposed expression with
 time.localtime().tm_isdst, but why do you think someone  reading about
 time.daylight actually wants to check if DST is currently active?

Sorry, I've just copy/pasted this snippet and haven't noticed t argument.

As for your question, I think that someone reading about time.daylight
is reading about it to know how it can be used, and if you're quoting,
please quote without removing words inside the quote, or else I won't
be able to give you the answers that will be appropriate in your
context.

 What can be improved, though, is the documentation of time.tzset().
 The current version fails to mention that  time.tzset() resets the
 values of tzname, timezone, altzone and daylight.  This would be the
 proper place to document the meaning of all three variables in greater
 detail.  Individual entries can then refer to it with say See
 time.tzset() for details.

How about making it in iterations and keep the steps as small as
possible, i.e. split the big problem into munchable chunks? First we
can accept the version of doc from my previous comment and then open a
new RFE for further work. Considering how much time this issue took
already, I see this approach as the only viable one.

 Here is how POSIX tzset() is defined:
 ...

I am sorry Alexander, but I can't really follow up on this issue. It
is interesting, but unfortunately right now I can only dedicate my
time to things that take don't more than 15 minutes of my attention,
and there are about 50 out of 700 of these in my inbox right now. We
need to split these datetime problems into smaller ones somehow. They
are really too complex for users.

To summarize: What is wrong with my previous proposal if we remove t
from params?

P.S. Looks like we need a PEP for this. =)

--

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

On Tue, Jan 11, 2011 at 9:42 PM, Alexander Belopolsky
rep...@bugs.python.org wrote:

 I have to agree with the OP that the current state of the docs is not as 
clear as it could be.

 In some ways the state of the docs is reflective of the state of the
 code.  C/POSIX API on which time module design is based is not very
 well suited to the age of smart phones and distributed VC systems.
 The whole idea that there is a static system timezone is absurd when
 a system is in your pocket or in the cloud.

 I agree that the docs can be improved, but I don't see patches that
 would constitute an improvement.  I've explained what I would see as
 an improvement in my prior comments.

Absurd need to be eliminated, but every time I touch datetime issues I
am confused by the complexity of additional information and
incompatibility of low-level C API with user needs. We need datetime
FAQ for a reference and a collection of user stories to see what it
possible (with examples/recipes) and what is impossible (with
proposals/PEP) in current state. If I was in charge - I'd mark all
datetime issues as release blockers for Py3k, so that all who wanted
Py3k released ASAP dedicate their time to this problem.

--

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



[issue7229] Manual entry for time.daylight can be misleading

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Tue, Jan 11, 2011 at 4:15 PM, anatoly techtonik
rep...@bugs.python.org wrote:
..
 To summarize: What is wrong with my previous proposal if we remove t
 from params?

Not much is wrong with it.   If it would come in a form of a patch and
without typos or mark-up mistakes, I or another committer would
probably apply it as an incremental improvement.   However, given that
additional effort is needed to apply your suggestion, I would rather
wait until a better solution is available.  Specifically, I don like
the duplication of time.localtime().tm_isdst recipe in daylight and
altzone.  Also, these variables should really be grouped together in
the docs.   I would like this to be done before a committer spends
time proofreading, fixing reST markup and committing the change.

--

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

The patch as-is did not work on Linux. 
I had to add entries in pyconfig.h.in and configure files in order to make 
os.sendfile available.
Patch is in attachment.

--
Added file: http://bugs.python.org/file20357/sendfile_v2.patch

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



[issue5109] array.array constructor very slow when passed an array object.

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Committed in revision 87942.

@Georg: Yes, I ran coverage and all branches are covered.

@Meador: I don't think the old len calculation could handle the case of array 
object in initial.  In any case, I don't find the new code much more 
complicated than the old one.  To the contrary, a chain of simple if-else looks 
cleaner than the original 2-line boolean expression.

--

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



[issue5109] array.array constructor very slow when passed an array object.

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Committed to 2.7 in revision 87944.

--
stage: commit review - committed/rejected
status: open - closed

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



[issue5109] array.array constructor very slow when passed an array object.

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Reverted backport in r87945.

--
versions:  -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5109
___
___
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 non-English locale

2011-01-11 Thread Roumen Petrov

Roumen Petrov bugtr...@roumenpetrov.info added the comment:

time.strptime(s, '%c' ) ?

--
nosy: +rpetrov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8957
___
___
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 non-English locale

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

 time.strptime(s, '%c' ) ?

Oh my.  It certainly took a long time to recognize a silly mistake!

Thanks.

--
dependencies:  -Use locale.nl_langinfo in _strptime
resolution:  - invalid

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



[issue5924] When setting complete PYTHONPATH on Python 3.x, paths in the PYTHONPATH are ignored

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

Martin v. Löwis mar...@v.loewis.de added the comment:

Unless you think the code is actually incorrect as it stands, it's certainly 
worse to change it (in whatever respect) than to leave it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5924
___
___
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 non-English locale

2011-01-11 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
status: open - closed

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



[issue10888] os.stat(filepath).st_mode gives wrong 'executable permission' result

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

Martin v. Löwis mar...@v.loewis.de added the comment:

Brian: On native Windows, Read  Execute has no real affect on 
applications. Why do you say that? The FILE_EXECUTE permission certainly has a 
meaning on Windows, see

http://msdn.microsoft.com/en-us/library/gg258116(v=vs.85).aspx

I agree that FILE_EXECUTE is, in principle, mostly the equivalent of the x bit 
on POSIX. Unfortunately, it's also confusing, since most files have that 
permission.

--
nosy: +loewis

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



[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

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

Martin v. Löwis mar...@v.loewis.de added the comment:

 Thank you @loewis. However, I don't see where 
 set_default_verify_path - is defined in the patch you have provided.

It's not defined in the patch, as it is already committed to Python.

--
title: some stdlib modules need to be updated to handle SSL certificate 
validation - some stdlib modules need to be updated to handle SSL  
certificate validation

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



[issue10882] Add os.sendfile()

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

Martin v. Löwis mar...@v.loewis.de added the comment:

 I would focus on trying to provide a unique interface across all
 platforms. Being sendfile() not a standard POSIX I think we should
 not worry about providing a strict one-to-one interface.

We absolutely need to expose sendfile as-is. If we want to provide
some unifying layer, we must not call it sendfile.

--

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



[issue10225] Fix doctest runable examples in python manual

2011-01-11 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

Doctest runs on .rst files, which are plain text files, finds and reports 
errors, and reports no errors when the errors are fixed. See #10875 where is 
was very helpful. So your last comment puzzles me.

In any case, your patch is too big to digest at once. I extracted the part for 
howto/sorting.rst and tried to apply to 3.2, but the file has changed too much 
(at least for TortoiseSVN). So I pasted the '... 's (and adjusted spacing) 
where needed, and did the two other changes you had. This left just two 
failures -- for the 2.7 code using 'cmp=xxx' args. With '# doctest: +SKIP' 
added twice, doctest passes. Patch commited for 3.2 as r87946.

 instances when human and computer reader's interests are in conflict.
What is one (or more) that you were thinking of?

--

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



[issue10225] Fix doctest runable examples in python manual

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Tue, Jan 11, 2011 at 6:10 PM, Terry J. Reedy rep...@bugs.python.org wrote:
..
 Doctest runs on .rst files, which are plain text files, finds and reports 
 errors, and reports no errors when the errors are fixed.
 See #10875 where is was very helpful. So your last comment puzzles me.


Sphinx doctest runner supports doctest fixtures that plain doctest
does not.  Some of the examples in the docs rely on these.

See http://sphinx.pocoo.org/ext/doctest.html .

--

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



[issue10888] os.stat(filepath).st_mode gives wrong 'executable permission' result

2011-01-11 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

I meant that it doesn't have any effect because it's apparently always set from 
what I could see, which was poor wording. The TechNet article also made a 
similar claim. If it is ever not set, then the file clearly can't be executed.

--

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



[issue7057] tkinter doc: more 3.x updates

2011-01-11 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 I used 'manN'
FYI, there is a :file:`man{n}` construct where braces mark up replaceable text, 
like the var element in HTML.

--
nosy: +d...@python, eric.araujo -georg.brandl

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



[issue3693] Obscure array.array error message

2011-01-11 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
components: +Extension Modules -Library (Lib)
nosy: +alexandre.vassalotti, georg.brandl
stage: unit test needed - needs patch
versions: +Python 2.7, Python 3.2

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



[issue9419] RUNSHARED needs LDFLAGS

2011-01-11 Thread Roumen Petrov

Roumen Petrov bugtr...@roumenpetrov.info added the comment:

Yes Peter, build outside source tree fail for,  fail for me and pass for python 
developers :). So no idea how to convince them to fix this issue.

Next is from my sources for python 2.7

Index: Lib/distutils/tests/test_build_ext.py
===
--- Lib/distutils/tests/test_build_ext.py   (revision 87946)
+++ Lib/distutils/tests/test_build_ext.py   (working copy)
@@ -91,6 +91,9 @@
 sys.stdout = StringIO()
 try:
 cmd.ensure_finalized()
+#Broken after issue 7712(r78136) : add a temp_cwd context manager 
to test_support ...
+#Without current working dir: ...cannot find -lpython27
+cmd.library_dirs.insert(0, test_support.SAVEDCWD)
 cmd.run()
 finally:
 sys.stdout = old_stdout
@@ -284,6 +287,12 @@
 # returns wrong result with --inplace
 other_tmp_dir = os.path.realpath(self.mkdtemp())
 old_wd = os.getcwd()
+print  sys.stderr, ...TRACE test_build_ext.py:test_get_outputs 
old_wd=%s %(old_wd)
+#Without current working dir: ...cannot find -lpython27
+#NOTE: After issue #7712(r78136) test cannot use old_wd !
+#cmd.library_dirs.insert(0, old_wd)
+cmd.library_dirs.insert(0, test_support.SAVEDCWD)
+#?#cmd.library_dirs.insert(0, old_wd)
 os.chdir(other_tmp_dir)
 try:
 cmd.inplace = 1
=

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9419
___
___
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 non-English locale

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

My tests were wrong but the problem does exist.  I am attaching a script that 
tests strptime(.., '%c') for all locales installed on my system (an unmodified  
US Mac OS X 10.6.6).  

The only failing locale that I recognize is Hebrew (he_IL).  Eli, what do you 
think about this?

 
$ ./python.exe cfmt.py 
am_ET [ማክሰ ጃንዩ 11 18:56:18 2011] %A %B %d %H:%M:%S %Y != %a %b %e %H:%M:%S %Y
et_EE [T, 11. jaan  2011. 18:56:18] %a, %d. %B %Y. %H:%M:%S != %a, %d. %b %Y. %T
he_IL [EST 18:56:18 2011 ינו 11 ג'] %Z %H:%M:%S %Y %B %d %a != %Z %H:%M:%S %Y 
%b %d %a

--
dependencies: +Use locale.nl_langinfo in _strptime
nosy: +eli.bendersky
resolution: invalid - 
status: closed - open
Added file: http://bugs.python.org/file20358/cfmt.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8957
___
___
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-11 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
title: strptime('%c', ..) fails to parse output of strftime('%c', ..) in 
non-English locale - strptime(.., '%c') fails to parse output of 
strftime('%c', ..) in some locales

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



[issue10885] multiprocessing docs

2011-01-11 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +asksol, jnoller

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



[issue4395] Document auto __ne__ generation; provide a use case for non-trivial __ne__

2011-01-11 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +d...@python -georg.brandl
stage:  - needs patch
type:  - behavior
versions: +Python 3.2

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



[issue10799] Improve webbrowser.open doc (and, someday, behavior?)

2011-01-11 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 I thought of adding 'http://' if not present but that would disable opening 
 files in a file browser.

I think that’s a Windows-specific behavior, not a promise of the *web*browser 
module.

--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10799
___
___
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-11 Thread Roumen Petrov

Roumen Petrov bugtr...@roumenpetrov.info added the comment:

- %T is equal for %H:%M:%S
- locales with %A and %B are broken on this platform as %c is Appropriate date 
and time representation (%c) with abbreviations

--

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



[issue9419] RUNSHARED needs LDFLAGS

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

 build outside source tree fail for me and pass for python
 developers :). So no idea how to convince them to fix this issue.

I am collecting out of tree build failures in issue 9860.  One issue that is 
easily reproducible is triggered when there are object files in the tree from 
another build, but it looks like you see something else.

As for convincing developers to fix a bug, the best approach is to propose a 
patch! :-)

--
nosy: +belopolsky

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9419
___
___
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-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Tue, Jan 11, 2011 at 7:26 PM, Roumen Petrov rep...@bugs.python.org wrote:
..
 - locales with %A and %B are broken on this platform as %c is Appropriate 
 date and time representation (%c) with abbreviations

According to what standard? POSIX defines it as

%c Replaced by the locale's appropriate date and time representation.

http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html

and the manual page on my system agrees:

 %cis replaced by national representation of time and date.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8957
___
___
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.0

2011-01-11 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

Pierre said:
Since it works the same with 2 browsers and 2 web servers, I'm almost sure it's 
not dependant on the configuration - but if others can tests on different 
configurations I'd like to know the result

So I showed in my just previous messages (after the one you are responding to) 
my output from Live HTTP Headers, where it seems that Firefox is using UTF-8 
transmission, both for header values (filename) and data values (euro 
character).  Without specifying Content-Type (for the data) or doing RFC 2047 
encoding as would be expected from reading the various standard documents (RFC 
2045, W3 HTML 4.01, RFC 2388).  I wonder now if Live HTTP Headers is reporting 
the logical data, prior to encoding for transmission.  But I was getting UTF-8 
data inside my CGI script... 

So now I tweaked the server to save the bytes it transfers its rfile to the cgi 
process (had already tweaked that to be binary instead of having encodings), 
and it is clearly UTF-8 at that point also.  Looks just like the Live HTTP 
headers.  Now that I have data-capture on the server side, I can run the same 
tests with other browsers... so I ran it with Opera 11, IE 8, Chrome 8, and the 
only differences were the specific value of the boundaries... all the data was 
in UTF-8, both filename, and form data value.

I can't now find a setting for Firefox to allow the user to control the 
encoding it sends to the server, but I can't rule out that I once might have, 
and set it to UTF-8.  But I'm quite certain I don't know enough about the other 
browsers to adjust their settings.  I don't have Apache installed on this box, 
so I cannot test to see if it changes something.

Is there a newer standard these browsers are following, that permits UTF-8?  Or 
even requires it?

Why is Pierre seeing cp-1252, and I'm seeing UTF-8?  I'm running Windows 6.1 
(Build 7600), 64-bit, the so-called Windows 7 Professional edition.

--

___
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



[issue9419] RUNSHARED needs LDFLAGS

2011-01-11 Thread Roumen Petrov

Roumen Petrov bugtr...@roumenpetrov.info added the comment:

Alexander, I already answer to you case.
About the patch it is part of issue3871 ;)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9419
___
___
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.0

2011-01-11 Thread Etienne Robillard

Etienne Robillard e...@gthcfoundation.org added the comment:

On 11/01/11 07:36 PM, Glenn Linderman wrote:
 Is there a newer standard these browsers are following, that permits UTF-8?  
 Or even requires it?

 Why is Pierre seeing cp-1252, and I'm seeing UTF-8?  I'm running Windows 6.1 
 (Build 7600), 64-bit, the so-called Windows 7 Professional edition.

 --

   

May be your browser have differents assumptions on what charset is valid
for encoding multipart
form data... For instance, all modern browsers allow customizing
charsets based on the user's locale.

Lastly this behavior is well-defined in RFC 2616, as the
Accept-Charset HTTP header:

   The Accept-Charset request-header field can be used to indicate what
   character sets are acceptable for the response. This field allows
   clients capable of understanding more comprehensive or special-
   purpose character sets to signal that capability to a server which is
   capable of representing documents in those character sets.

just my 2 cents while watching a boring hockey game... :-)

--

___
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



[issue10225] Fix doctest runable examples in python manual

2011-01-11 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Terry, I'm unhappy with the changes to the sorting how-to.  IMO, it was a not a 
net win (transforming code that already ran fine in something doctest would 
swallow).  The code snippets now have the visual clutter of the  and ... 
PS1 and PS2 prompts and they can no longer be readily cut and pasted into the 
interpreter so that people can experiment with them.

--
nosy: +rhettinger

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



[issue7662] time.utcoffset()

2011-01-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

I am going to close this as superseded by #9527.  All these issues, current, 
#9527, and #1647654 are really about Python's lack of access to the system 
timezone information and #9527 seem to be the most appropriate solution.

My specific concern about proposed time.utcoffset() is that you normally need 
UTC offset together with current time, but localtime() call followed by 
utcoffset() may lead to a race condition.

--
resolution:  - rejected
status: open - pending
superseder:  - Add aware local time support to datetime module

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



[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2011-01-11 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
keywords:  -patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5516
___
___
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.0

2011-01-11 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

Aha!

Found a page http://htmlpurifier.org/docs/enduser-utf8.html#whyutf8-support 
which links to another page 
http://web.archive.org/web/20060427015200/ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html
 that explains the behavior.

The synopsis is that browsers (all modern browsers) return form data
Form data is generally returned in the same character encoding as the Form page 
itself was sent to the client.

I suspect this explains the differences between what Pierre and I are 
reporting.  I suspect (but would appreciate confirmation from Pierre), that his 
web pages use 
meta http-equiv=Content-Type content=text/html; charset=CP-1252 /
or else do not use such a meta tag, and his server is configured (or defaults) 
to send HTTP headers:
Content-Type: text/html; charset=CP-1252

Whereas, I do know that all my web pages are coded in UTF-8, have no meta tags, 
and my CGI scripts are sending 
Content-Type: text/html; charset=UTF-8
for all served form pages... and thus getting back UTF-8 also, per the above 
explanation.

What does this mean for Python support for http.server and cgi?
Well, http.server, by default, sends Content-Type without charset, except for 
directory listings, where it supplies charset= the result of 
sys.getfilesystemcoding().  So it is up to META tags to define the coding, or 
for the browser to guess.  That's probably OK: for a single machine 
environment, it is likely that the data files are coded in the default file 
system encoding, and it is likely the browser will guess that.  But it quickly 
breaks when going to a multiple machine or internet environment with different 
default encodings on different machines.  So if using http.server in such an 
environment, it is necessary to inform the client of the page encoding using 
META tags, or generating the Content-Type: HTTP header in the CGI script (which 
latter is what I'm doing for the forms and data of interest).

What does it mean for cgi.py's FieldStorage?

Well, use of the default encoding can work in the single machine environment... 
so I guess there are would be worse things that doing so, as Pierre has been 
doing.  But clearly, that isn't the complete solution.  The new parameter he 
proposes to FieldStorage can be used, if the application can properly determine 
the likeliest encoding for the form data, before calling it.

On a single machine system, that could be the default, as mentioned above.  On 
a single application web server, it could be some constant encoding used for 
all pages (like I use UTF-8 for all my pages).  For a multiple application web 
server, as long as each application uses a consistent encoding, that 
application could properly guess the encoding to pass to FieldStorage.  Or, if 
the application wishes to allow multiple encodings, as long as it can keep 
track of them, and use the right ones at the right time, it is welcome to.

How does this affect email?  Not at all, directly.

How does this affect cgi.py's use of email?
It means that cgi.py cannot use BytesFeedParser, in spite of what the standards 
say, so Pierre's approach of predecoding the headers is the correct one, since 
email doesn't offer an encoding parameter.  Since email doesn't support disk 
storage for file uploads, but buffers everything in memory, it means that 
cgi.py can only pass headers to FeedParser, so has to detect end-of-headers 
itself, since email provides no feedback to indicate that end-of-headers was 
reached, and that means that cgi.py must parse the MIME parts itself, so it can 
put the large parts on disk. It means that the email package provides extremely 
little value to cgi.py, and since web browsers and multipart/form-data use 
simple subsets of the full power of RFC822 headers, email could be replaced 
with the use of its existing parse_header function, but that should be 
deprecated.  A copy could be moved inside FieldStorage class and fixed a bit.

--

___
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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-11 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

I notice the version on this issue is Python 3.3, but it affects 3.2 and 3.1 as 
well.  While I would like to see it fixed for 3.2, perhaps it is too late for 
that, with rc1 coming up this weekend?

Could at least the non-deprecated parse functions be deprecated in 3.2, so that 
they could be removed in 3.3?  Or should we continue to support them?

--

___
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



[issue10225] Fix doctest runable examples in python manual

2011-01-11 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

There are two reasons I forward ported the changes.

1. Without running doctest on doc examples, they sometimes have errors either 
originally, after patches to the doc, or after patches to Python. On other 
issues, I found 4 errors in the json doc (probably original; my fixes were 
augmented and committed by GB, I believe), and several in the re howto (due to 
non-update after re changes). There have been other error reports on the 
tracker and I presume more (other than missing '...') shown in AB's patch. (I 
just started with the first file changed in the patch.) So I thought it pretty 
well settled that getting doc examples correct (and test-ready) is be a good 
idea.

2. Examples with output always start with ' ' to differentiate input from 
output. I thought it pretty standard that continuation lines start with '... '. 
This is true of all applicable examples in re howto, module chapters for 
difflib, json, bisect, and 4 of 5 applicable examples in the Built-in Types 
chapter. Other chapters for binhex, itertools, and tkinter have no multiline 
interactive examples, so provide no precedent either way.

What is the alternative? The current sorting howto is not consistent:

For some examples, '... ' is just deleted:
 student_tuples = [
('john', 'A', 15),
('jane', 'B', 12),
('dave', 'B', 10),
]

For others, '... ' is replaced with '':
 class Student:
def __init__(self, name, grade, age):
self.name = name
self.grade = grade
self.age = age

The cmp_to_key function def is a special case: there is no output in the same 
box with the def and so (normally) should not have prompts. The only reason I 
followed AB's patch here and added them is because the definition is used in 
the next box. If the next example were changed for 3.2 to use the new-in-3.2  
functools.cmp_to_key(), then the def would not be needed.  (I already planned 
to suggest thisOr the followup example could just be marked SKIP. With either 
change, I would remove the prompts added to this function, which are the ones I 
presume bother you the most.


Summary: according to my current (and subject-to-update ;-) understanding of 
precedent and policy, the changes other than for cmp_to_key seem correct. The 
rationale for cmp_to_key changes could easily be negated, in which case they 
should be reverted.

I will put my thoughts on cut-and-paste in a separate message.

--
nosy: +georg.brandl

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



[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2011-01-11 Thread david

david db.pub.m...@gmail.com added the comment:

and what does it do ?

--
title: some stdlib modules need to be updated to handle SSL certificate 
validation - some stdlib modules need to be updated to handle SSL certificate 
validation

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



[issue10889] Fix range slicing and indexing to handle lengths sys.maxsize

2011-01-11 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Committed as r87948.

I added a few large_range tests to those in the patch. I checked that 
IndexError is raised when appropriate, as well as a specific test for the 
combination of a large range with a large negative step.

--

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



  1   2   >