[issue2130] [feature-request] Please add bool data type to optparse module

2008-02-17 Thread Guilherme Polo

Guilherme Polo added the comment:

Have you read
http://docs.python.org/lib/optparse-standard-option-actions.html ?

If yes, what is the problem with store_true/store_false ?

--
nosy: +gpolo

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2130
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2131] codecs module on Windows uses incorrect end-of-line, wiriting broken Unicode (UTF-8) files

2008-02-17 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

As Antoine already pointed out: the codecs.open() function does not
support the C lib's text mode. As a result, no magical conversion of a
single newline to a CRLF takes place.

Closing as invalid.

--
resolution:  - invalid
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2131
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2124] xml.sax and xml.dom fetch DTDs by default

2008-02-17 Thread Virgil Dupras

Virgil Dupras added the comment:

-1 on the systematic warnings too, but what I was talking about is a 
warning that would say The server you are trying to fetch your resource 
from is refusing the connection. Don't cha think you misbehave? only on 
5xx and 4xx responses, not on every remote resource fetching.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2124
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2066] Adding new CNS11643, a *huge* charset, support in cjkcodecs

2008-02-17 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Whether or not to keep placing all builtin modules into the Windows
Python DLL is not really a question to be discussed on the tracker.
Given the size of the Python DLL (around 2MB) and the extra 350kB that
the support for CNS11643 would cost, I think such a discussion is pretty
pointless.

I'm still +1 on the basis of enhancing the Taiwanese Python experience
by adding their standard character set to the default Python install.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2066
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2131] codecs module on Windows uses incorrect end-of-line, wiriting broken Unicode (UTF-8) files

2008-02-17 Thread Georg Brandl

Georg Brandl added the comment:

The note in the docstring wasn't in the documentation. Fixed this in r60873.

--
nosy: +georg.brandl

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2131
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2131] codecs module on Windows uses incorrect end-of-line, wiriting broken Unicode (UTF-8) files

2008-02-17 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Thanks, Georg.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2131
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2112] mmap.error should be a subclass of EnvironmentError and not a direct EnvironmentError

2008-02-17 Thread John Lenton

John Lenton added the comment:

Ran the regression test with this patch, all ok (on Ubuntu Gutsy).
Attached diff is the same, with the addition of the NEWS entry.

--
nosy: +Chipaca
Added file: http://bugs.python.org/file9443/mmap3.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2112
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1916] Add inspect.isgenerator

2008-02-17 Thread Javier Mansilla

Javier Mansilla added the comment:

I merged my working copy with your patches and they look fine. I fixed a
typo on the method doc (is instead of i) so I'm attaching  my
inspect.py.diff patch

--
nosy: +javimansilla
Added file: http://bugs.python.org/file9444/test_inspect.py.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1916
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1916] Add inspect.isgenerator

2008-02-17 Thread Javier Mansilla

Javier Mansilla added the comment:

Sorry, I attached the wrong file

The previous post saying fixing typo should attached inspect.py.diff.
This is the one.

Added file: http://bugs.python.org/file9445/test_inspect.py.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1916
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1050828] reindent.py strips execute permission on Unix

2008-02-17 Thread Facundo Batista

Facundo Batista added the comment:

Fixed in r60877, as of the description in my last comment.

--
resolution:  - fixed
status: open - closed

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1050828
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1916] Add inspect.isgenerator

2008-02-17 Thread Javier Mansilla

Javier Mansilla added the comment:

My dear, what is wrong with my browser (or with me). Now, yes, the one
with the typo.

Added file: http://bugs.python.org/file9446/inspect.py.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1916
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1916] Add inspect.isgenerator

2008-02-17 Thread Javier Mansilla

Javier Mansilla added the comment:

And now I'm attaching a new patch test_inspect.py.diff with a more
complete test coverage. You didn't add isgenerator nor
isgeneratorfunction tests. I did.

Added file: http://bugs.python.org/file9447/test_inspect.py.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1916
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2001] Pydoc interactive browsing enhancement

2008-02-17 Thread Ron Adam

Ron Adam added the comment:

Remade the diff with correct directory name so it patches correctly.

Is there a way to add the patch keyword?

Added file: http://bugs.python.org/file9448/pydocnotk.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2001
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1916] Add inspect.isgenerator

2008-02-17 Thread Facundo Batista

Changes by Facundo Batista:


Removed file: http://bugs.python.org/file9445/test_inspect.py.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1916
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1916] Add inspect.isgenerator

2008-02-17 Thread Facundo Batista

Changes by Facundo Batista:


Removed file: http://bugs.python.org/file9444/test_inspect.py.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1916
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2128] sys.argv is wrong for unicode strings

2008-02-17 Thread Giovanni Bajo

Giovanni Bajo added the comment:

I'm attaching a simple patch that seems to work under Py3k. The trick is
that Py3k already attempts (not sure how or why) to decode argv using
utf-8. So it's sufficient to setup argv as UTF8-encoded strings.

Notice that brings the output of python à from this:

Fatal Python error: no mem for sys.argv
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-2:
invalid data

to this:

TypeError: zipimporter() argument 1 must be string without null bytes,
not str

which is expected since zipimporter_init() doesn't even know to ignore
unicode strings (let alone handle them correctly...).

Added file: http://bugs.python.org/file9449/argv_unicode.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2128
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2112] mmap.error should be a subclass of EnvironmentError and not a direct EnvironmentError

2008-02-17 Thread Facundo Batista

Facundo Batista added the comment:

Fixed in r60878. Thanks everybody!

--
nosy: +facundobatista
resolution:  - fixed
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2112
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2132] Blocking sockets take entirely too long to timeout

2008-02-17 Thread Nathan Duran

New submission from Nathan Duran:

The following code:

import smtplib

test = smtplib.SMTP('mail.host.com')

will hang the entire script for about ten minutes when run on a machine 
which is connected to the internet via an ISP who blocks port 25 (which is 
pretty much all of them these days). Closer inspection of the smtplib 
sources reveals that it is making use of blocking sockets, which is all 
well and good, but I do not believe they should be allowed to block for 
such a ridiculously lengthy period of time. 

My task is to walk the list of MX records provided by a DNS query, connect 
to each server listed and check a user-supplied address for validity. If I 
have to wait 10 minutes for an exception to be thrown for each 
unresponsive server, this process could easily take hours per address, 
which is completely unacceptable. 

My workaround is to ditch smtplib entirely and write my own socket code, 
but setting a timeout on a socket throws it into non-blocking mode, which 
is not entirely what I want, either. PHP allows one to apply a perfectly 
sane timeout to a blocking socket without any difficulty, and this is 
something I'm frankly rather surprised to see Python choke on.

What I'd expect to see is an exception after less than a minute's worth of 
repeated failures so the caller can catch it and try another port.

--
components: Library (Lib)
messages: 62498
nosy: khiltd
severity: normal
status: open
title: Blocking sockets take entirely too long to timeout
type: behavior
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2132
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2133] a typo in pydoc.py causes modules to be cyan instead of white

2008-02-17 Thread Elliott Hughes

New submission from Elliott Hughes:

A typo ('#f' instead of '#ff') in pydoc.py causes the Modules
section to have cyan text instead of white text. I don't believe this is
deliberate because (a) it looks wrong and (b) anyone doing that
deliberately would have put a '0' in the color to make it look
deliberate. This patch doesn't address the large-scale duplication of
'#ff' (instead of using a constant, or even the named color
'white'), and just adds the single missing character.

--
components: Demos and Tools
files: no-cyan-modules.diff.txt
messages: 62501
nosy: elliotth
severity: normal
status: open
title: a typo in pydoc.py causes modules to be cyan instead of white
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file9450/no-cyan-modules.diff.txt

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2133
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2132] Blocking sockets take entirely too long to timeout

2008-02-17 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I recommend that you stay with non-blocking sockets, and use select/poll
on all sockets. Then you can simultaneously check multiple servers, and
select will tell you which ones you got connected to. For this
application, putting a time-out on the socket and doing the connections
sequentially seems unreasonable - that's exactly what select was
invented for.

I don't understand the setting a timeout ... is not entirely what I
want, either remark. The only way to specify a timeout for connect *is*
to set it into non-blocking mode. I'm sure PHP does the same.

If you want to see timeouts for smtplib, a work-around is to set a
global timeout for all sockets, through socket.setdefaulttimeout. This
will transparently apply to smtplib as well.

--
nosy: +loewis

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2132
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1740] use unittest for test_logging

2008-02-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Hmm, apparently another patch was committed in rev 60872.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1740
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2133] a typo in pydoc.py causes modules to be cyan instead of white

2008-02-17 Thread Georg Brandl

Georg Brandl added the comment:

Fixed in r60883. Thanks!

--
nosy: +georg.brandl
resolution:  - fixed
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2133
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1224] SimpleHTTPServer doesn't understand // at beginning of path anymore

2008-02-17 Thread Anthony Lenton

Anthony Lenton added the comment:

Attached is an diff against trunk that adds philfr's suggesitions.  I've
also added a test file for testing url parsing, so's these things stay
fixed.  Updated Misc/NEWS.  No doc or functionallity modified.

--
nosy: +elachuni, facundobatista
Added file: http://bugs.python.org/file9451/1224.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1224
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1600] str.format() produces different output on different platforms (Py30a2)

2008-02-17 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Eric, because of this issue the windows buildbots turned to red.
Does the proposed patch still apply? of should be make the tests more
tolerant?

--
nosy: +amaury.forgeotdarc, eric.smith

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1600
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1740] use unittest for test_logging

2008-02-17 Thread Brett Cannon

Brett Cannon added the comment:

Yeah, that's my fault. I forgot to search the issue tracker first before
committing the GHOP rewrite.

I will do a review of this patch and see which version is better.

--
assignee:  - brett.cannon
nosy: +brett.cannon

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1740
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1960] test_gdbm.py converted to unittest

2008-02-17 Thread Brett Cannon

Changes by Brett Cannon:


--
assignee:  - brett.cannon

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1960
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1952] test_select.py converted to unittest

2008-02-17 Thread Brett Cannon

Changes by Brett Cannon:


--
assignee:  - brett.cannon
nosy: +brett.cannon

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1952
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1864] test_locale doesn't use unittest

2008-02-17 Thread Brett Cannon

Changes by Brett Cannon:


--
keywords: +patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1864
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2055] test_fcntl.py converted to unittest

2008-02-17 Thread Brett Cannon

Changes by Brett Cannon:


--
assignee:  - brett.cannon
nosy: +brett.cannon

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2055
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1600] str.format() produces different output on different platforms (Py30a2)

2008-02-17 Thread Eric V. Smith

Eric V. Smith added the comment:

The PEP 3101 float formatting code (in Objects/stringlib/formatter.h)
uses PyOS_ascii_formatd for all specifier codes except 'n'.  So applying
the patch would fix the issue that was originally brought up in msg58485.

I think the approach of the patch (if not its content, I haven't
inspected it yet) is correct.  Fix the underlying code and benefit from
this everywhere.  I don't think we should change the tests to be more
tolerant, I think we should be consistent across platforms.

My only concern is breaking code in the wild.  This seems like a change
with wide-reaching implications.

I think 'n' should also be addressed.  It calls PyOS_snprintf directly.

I'll review the patch and comment back here.  Unfortunately, I don't
have a Windows box set up for testing.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1600
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2134] function generate_tokens at tokenize.py yields wrong token for colon

2008-02-17 Thread Guilherme Polo

New submission from Guilherme Polo:

function generate_tokes at tokenize.py yields token OP (51) for colon,
while it should be token COLON (11). It probably affects other python
versions as well.

I'm attaching a minor sample that demonstrates this, running it returns
the following output:

1 'if' (1, 0) (1, 2) if a == 2:
1 'a' (1, 3) (1, 4) if a == 2:
51 '==' (1, 5) (1, 7) if a == 2:
2 '2' (1, 8) (1, 9) if a == 2:
51 ':' (1, 9) (1, 10) if a == 2:
1 'print' (2, 0) (2, 5) print 'hey'
3 'hey' (2, 6) (2, 11) print 'hey'
0 '' (3, 0) (3, 0)

I didn't check if there are problems with other tokens, I noticed this
with colon because I was trying to make some improvements on tabnanny.

--
components: Library (Lib)
files: tokenize_sample.py
messages: 62509
nosy: gpolo
severity: normal
status: open
title: function generate_tokens at tokenize.py yields wrong token for colon
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6
Added file: http://bugs.python.org/file9452/tokenize_sample.py

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2134
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2135] Restructure import.c into PEP 302 importer objects

2008-02-17 Thread Douglas Greiman

New submission from Douglas Greiman:

This patch reorganizes import.c to move functionality into two new PEP
302-style Importer objects.  I attempted to change as little as
feasible, but the patch is still ~4700 lines long, about 1000 of which
is new tests.

BuiltinImporter: handles C_BUILTIN and PY_FROZEN modules
DirectoryImporter: handles PY_SOURCE, PY_COMPILED, PKG_DIRECTORY,
C_EXTENSION modules

BuiltinImporter is put on sys.meta_path, DirectoryImporter is put on
sys.path_hooks.

To preserve backward compatibility of methods like imp.find_module(),
they use new variables sys.builtin_meta_path and sys.builtin_path_hooks
which are analogous to sys.meta_path and sys.path_hook but contain only
the two importer objects above.

Character encoding issues were substantial.  The existing code was
somewhat inscrutable in this regard.  The tests disabled in issue 1377
were re-added with more safeguards and harder tests.  It is possible to
import modules with non-ascii names from non-ascii paths.  Tested on
Windows XP and Linux.

Areas for discussion:

Naming: Names of the importer classes, names of variables, etc

sys: I added three variables to sys.  Is there a better alternative?

ModuleInfo: The importers use a somewhat tricky way to store an open
file between calls to importer.find_module() and importer.load_module(),
so that the new code doesn't do any more system calls that the old code.

semantics: There are many import corner cases where the semantics are
unknown or unclear.  

Frozen packages: the __path__ of a frozen package is a string rather
than a list, and it is possible to replace that string to change how
imports inside that package are resolved.  I have attempted to keep that
functionality intact but it's not clear that it's a feature rather than
a bug.

--
components: Interpreter Core
files: builtin_importer-20080217.diff
messages: 62510
nosy: dgreiman
severity: normal
status: open
title: Restructure import.c into PEP 302 importer objects
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file9453/builtin_importer-20080217.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2135
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1945] Document back ported C functions

2008-02-17 Thread John Lenton

John Lenton added the comment:

Copied documentation from the py3k branch for the functions mentioned in
the .h's (those were: PyLong_FromSsize_t, PyLong_FromSize_t,
PyLong_AsSsize_t, PyUnicode_FromStringAndSize, PyUnicode_FromString,
PyUnicode_FromFormat, and PyUnicode_FromFormatV). Tested by building the
documentation; everything seems to be in order. Added NEWS entry.

--
nosy: +Chipaca
Added file: http://bugs.python.org/file9454/1945.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1945
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2124] xml.sax and xml.dom fetch DTDs by default

2008-02-17 Thread ajaksu

ajaksu added the comment:

Martin, I agree that simply not resolving DTDs is an unreasonable
request (and said so in the blog post). But IMHO there are lots of
possible optimizations, and the most valuable would be those darn easy
for newcomers to understand and use.

In Python, a winning combo would be an arbitrary (and explicit) FS
dtdcache that people could use with simple a drop-in import (from a
third-party module?). Perhaps the cache lives in a pickled dictionary
with IDs, checksums and DTDs. Could also be a sqlite DB, if updating the
dict becomes problematic.

In that scenario, AMK could save latter W3C hits with:

from xml.sax import make_parser
from dtdcache.sax.saxutils import prepare_input_source # - dtdcache
parser = make_parser()
inp = prepare_input_source('file:file.xhtml', cache=/tmp/xmlcache)

It might be interesting to have read-only, force-write and read-write
modes. Not sure how to map that on EntityResolver and DTD consumers (I'm
no XML user myself).

Regarding the std-lib, I believe effective caching hooks for DTDs trump
implementing in-memory or sqlite/FS. IMNSHO, correct, accessible support
for catalogs shouldn't be the only change, as caching should give better
performance on both ends.

--
nosy: +ajaksu2

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2124
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2136] urllib2 basic auth handler doesn't handle realm names in single-quoted strings

2008-02-17 Thread Atul Varma

New submission from Atul Varma:

This isn't necessarily a bug in Python--it's really a bug in websites
that produce what are technically malformed WWW-Authenticate headers, I
believe.

According to RFC 2617, a WWW-Authenticate header should be of the form:

  WWW-Authenticate: Basic realm=Private

However, some websites, produce the header using single-quotes:

  WWW-Authenticate: Basic realm='Private'

The Firefox browser deals with this gracefully, but Python's urllib2
does not; specifically, an AbstractBasicAuthHandler does not recognize
the second type of header as an auth header at all, and as a result it's
impossible to access sites protected with such headers.

The attached patch alters the behavior of the class to deal with this
situation gracefully, and also adds a unit test to ensure that the
functionality works.

Implementation notes: This isn't the most well-engineered fix in the
world; in particular, I didn't change the regex used to parse
WWW-Authenticate headers, in part because (A) such a regex was difficult
to compose and (B) it would've been quite difficult to read, and I
didn't want to inadvertently mess up the current behavior of the code.

--
components: Library (Lib)
files: urllib2_single_quoted_auth_fix.patch
messages: 62513
nosy: varmaa
severity: minor
status: open
title: urllib2 basic auth handler doesn't handle realm names in single-quoted 
strings
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file9455/urllib2_single_quoted_auth_fix.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2136
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1404925] subprocess.Popen inside thread locks the thread in some case (2.4)

2008-02-17 Thread Gregory P. Smith

Gregory P. Smith added the comment:

This appears to have been fixed in 2.5 and trunk.  2.4.x is old and in
security fixes only mode so I wouldn't expect to see this in any
official 2.4.x source tree released in the future unless the bdfl
changes his mind on that.  here's the patch to fix it (as described in
the email thread mentioned earlier):

Index: Lib/os.py
===
--- Lib/os.py   (revision 60877)
+++ Lib/os.py   (working copy)
@@ -351,8 +351,8 @@
 
 __all__.extend([execl,execle,execlp,execlpe,execvp,execvpe])
 
+import errno
 def _execvpe(file, args, env=None):
-from errno import ENOENT, ENOTDIR
 
 if env is not None:
 func = execve
@@ -379,7 +379,7 @@
 func(fullname, *argrest)
 except error, e:
 tb = sys.exc_info()[2]
-if (e.errno != ENOENT and e.errno != ENOTDIR
+if (e.errno != errno.ENOENT and e.errno != errno.ENOTDIR
 and saved_exc is None):
 saved_exc = e
 saved_tb = tb

--
components: +Library (Lib) -Interpreter Core
keywords: +easy, patch
resolution:  - wont fix
status: open - closed
title: subprocess.Popen inside thread locks the thread in some case - 
subprocess.Popen inside thread locks the thread in some case (2.4)
type:  - behavior

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1404925
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2051] PYO file permission problem

2008-02-17 Thread Facundo Batista

Changes by Facundo Batista:


--
assignee:  - facundobatista
nosy: +facundobatista

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2051
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1224] SimpleHTTPServer doesn't understand // at beginning of path anymore

2008-02-17 Thread Facundo Batista

Changes by Facundo Batista:


--
assignee:  - facundobatista

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1224
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-02-17 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto:


__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-02-17 Thread Hirokazu Yamamoto

Hirokazu Yamamoto added the comment:

Follow up r60882.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-02-17 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto:


Added file: http://bugs.python.org/file9456/ocean.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2014] xmlrpclib cannot send datetime objects with dates before 1900

2008-02-17 Thread Ralf Schmitt

Ralf Schmitt added the comment:

http://bugs.python.org/issue1777412 describes the cause of this issue
(i.e. strftime not being able to handle years before 1900).

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2014
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com