[issue15943] urllib2 always sends header connection: close

2012-09-14 Thread Santiago Velasco

New submission from Santiago Velasco:

I have noticed that urllib2 will always send the 'connection: close' in the 
headers, looking at the code there is no way to override this from outside of 
the open method.

 I am currently working with a server that kills connection upon reading the 
header, and content will not get served, or only a partial bit of the content 
gets served, I have tried with several other agents, all are able to download 
the full content served by the server.

I created a modified version without the 'connection: close' header and that 
solved the problem for me. I do not always have problems with that header, but 
I would like the ability to define my own headers, and since the connection: 
close header gets slapped inside an objects internal method, there is currently 
no other way I can bypass it.

--
components: Library (Lib)
messages: 170473
nosy: sanxiago
priority: normal
severity: normal
status: open
title: urllib2 always sends header connection: close
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue8109] Server-side support for TLS Server Name Indication extension

2012-09-14 Thread danblack

Changes by danblack :


Removed file: http://bugs.python.org/file26950/issue8109_server_side_sni.patch

___
Python tracker 

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



[issue8109] Server-side support for TLS Server Name Indication extension

2012-09-14 Thread danblack

danblack added the comment:

> Daniel, your patch looks quite interesting. Please, send a contributor 
> agreement to the PSF: http://www.python.org/psf/contrib/contrib-form-python/ 
> . Let me know when you status have changed.

Already done. Has been accepted and I've got an acknowledgement email.

> Why are you changing "Lib/test/keycert2.pem"?
I was mistakely assuming that this was the only test that used it. Fixed now. 
Also added a CA key and server for validating key chains. I didn't end up using 
it however thought it would be handy.

> Please, provide also a documentation patch.

Done. Also improved error checking and reference counting.

> This is a feature enhancement. Would be applied to 3.4, it is too late for 
> 3.3 :-(. Too bad! :(

Was expected. Its been 2.5 years since the bug opened. A little more won't hurt.

I've also changed SSLSocket.context to be a property. Its not quite working. 
The current test case as is working however using an assignment as per line 
1958 of Lib/test/test_ssl.py.

--
Added file: http://bugs.python.org/file27190/issue8109_server_side_sni.patch

___
Python tracker 

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



[issue15943] urllib2 always sends header connection: close

2012-09-14 Thread R. David Murray

R. David Murray added the comment:

This is a duplicate of issue 12849.  I'm not sure that we support keep-alive 
using urllib.  We do using httplib, if I understand correctly.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> urllib2 headers issue

___
Python tracker 

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



[issue12849] urllib2 headers issue

2012-09-14 Thread R. David Murray

R. David Murray added the comment:

I've closed issue 15943 as a duplicate of this one.  As I said there, I'm not 
sure that we (can?) support keep-alive in urllib, though we do in httplib 
(which is the http package in python3).

--
nosy: +r.david.murray, sanxiago
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6

___
Python tracker 

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



[issue12849] Cannot override 'connection: close' in urllib2 headers

2012-09-14 Thread R. David Murray

Changes by R. David Murray :


--
title: urllib2 headers issue -> Cannot override 'connection: close' in urllib2 
headers

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread David Beazley

New submission from David Beazley:

I've been playing with the interaction of ctypes and memoryviews and am curious 
about intended behavior.  Consider the following:

>>> import ctypes
>>> d = ctypes.c_double()
>>> m = memoryview(d)
>>> m.ndim
0
>>> m.shape
()
>>> m.readonly
False
>>> m.itemsize
8
>>>

As you can see, you have a memory view for the ctypes double object.  However, 
the fact that it has a 0-dimension and no shape seems to cause all sorts of 
weird behavior.  For instance, indexing and slicing don't work:

>>> m[0]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: invalid indexing of 0-dim memory
>>> m[:]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: invalid indexing of 0-dim memory
>>> 

As such, you can't really seem to do anything interesting with the resulting 
memory view.  For example, you can't pull data out of it.  Nor can you 
overwrite the contents (i.e., replacing the contents with an 8-byte byte 
string).

Attempting to cast the memory view to something else doesn't work either.

>>> d = ctypes.c_double()
>>> m = memoryview(d)
>>> m2 = m.cast('c')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: memoryview: source format must be a native single character format 
prefixed with an optional '@'
>>> 

I must be missing something really obvious here.  Is there no way to get access 
to the memory behind a ctypes object?

--
messages: 170477
nosy: dabeaz
priority: normal
severity: normal
status: open
title: memoryviews and ctypes
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue15842] Some SocketIO methods can succeed after close()

2012-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fad797916266 by Antoine Pitrou in branch '3.2':
Issue #15842: the SocketIO.{readable,writable,seekable} methods now raise 
ValueError when the file-like object is closed.
http://hg.python.org/cpython/rev/fad797916266

New changeset 3b0e20f71d8a by Antoine Pitrou in branch 'default':
Issue #15842: the SocketIO.{readable,writable,seekable} methods now raise 
ValueError when the file-like object is closed.
http://hg.python.org/cpython/rev/3b0e20f71d8a

--
nosy: +python-dev

___
Python tracker 

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



[issue15842] Some SocketIO methods can succeed after close()

2012-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, I've committed the patch. Thanks Alessandro!

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

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

You can still read the underlying representation:

>>> d = ctypes.c_double(0.6)
>>> m = memoryview(d)
>>> bytes(m)
b'33\xe3?'
>>> d.value = 0.7
>>> bytes(m)
b'ff\xe6?'

--
nosy: +pitrou, skrah

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread David Beazley

David Beazley added the comment:

I don't want to read the representation by copying it into a bytes object.  I 
want direct access to the underlying memory--including the ability to modify 
it.  As it stands now, it's completely useless.

--

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread Stefan Krah

Stefan Krah added the comment:

0-dim memory is indexed by x[()]. The ctypes example has an additional
problem, because format=">> x = ndarray(3.14, shape=[], format='d', flags=ND_WRITABLE)
>>> x[()]
3.14
>>> tau = 6.28
>>> x[()] = tau
>>> x[()]
6.28
>>> m = memoryview(x)
>>> m[()]
6.28
>>> m[()] = 100.111
>>> m[()]
100.111

--

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread Stefan Krah

Stefan Krah added the comment:

BTW, if c_double means "native machine double", then ctypes should
fill in Py_buffer.format with "d" and not "

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread David Beazley

David Beazley added the comment:

Even with the 

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



[issue15898] OSX TTY bug

2012-09-14 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue15419] distutils: build should use a version-specific build directory

2012-09-14 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I'd change the name of the subdirectories of build instead of the name of the 
build directory itself. That way distutils will still create one build 
directory regardless of how many python versions you use, and the name of that 
directory is easily predicatble (which is nice when using basic tools to clean 
up a directory).

The distribute/setuptools projects do this as well, and implementing this 
should only require a fairly trival patch to distutils.commands.build (the 
defaults for the various build_ directories need to be updated).

BTW. How likely is the acceptance of such a patch? IIRC distutils is more or 
less closed for development w.r.t. new features. Would that also apply to this 
feature request?

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue15419] distutils: build should use a version-specific build directory

2012-09-14 Thread Éric Araujo

Éric Araujo added the comment:

> I'd change the name of the subdirectories of build instead of the name of the 
> build directory itself.
Yep that’s what I was thinking about (or if I wasn’t, I should have been :)

> IIRC distutils is more or less closed for development w.r.t. new features.
Not more or less: it is frozen.  The only exceptions are changes required by 
other changes like the pycache or ABI tag PEPs.

> Would that also apply to this feature request?
If we agree this is a bug, we can fix it.  What do RMs think?

--
nosy: +benjamin.peterson, georg.brandl

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread David Beazley

David Beazley added the comment:

I don't think memoryviews should be imposing any casting restrictions at all. 
It's low level.  Get out of the way.

--

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread Stefan Krah

Stefan Krah added the comment:

The decision was made in order to be able to cast back and forth between
known formats. Otherwise one would be able to cast from '>> import ctypes, struct
>>> d = ctypes.c_double()
>>> m = memoryview(d)
>>> struct.pack_into(m.format, m, 0, 22.7)
>>> struct.unpack_from(m.format, m, 0)[0]
22.7

--

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread Stefan Krah

Stefan Krah added the comment:

So you want to be able to segfault the core interpreter using the
builtins?

--

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread David Beazley

David Beazley added the comment:

No, I want to be able to access the raw bytes sitting behind a memoryview as 
bytes without all of this casting and reinterpretation.  Just show me the raw 
bytes.  Not doubles, not ints, not structure packing, not copying into byte 
strings, or whatever.   Is this really impossible?   It sure seems so.

--

___
Python tracker 

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



[issue9253] argparse: optional subparsers

2012-09-14 Thread Benjamin West

Benjamin West added the comment:

https://gist.github.com/1202975#file_test_opt_subcommand.py

I sketched out a sloppy test earlier.  I think this test is probably not quite 
comprehensive enough, and I'm not sure it fits into the python style either.  I 
suppose there are other tests I can more or less copy.

--

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread David Beazley

David Beazley added the comment:

Just to be specific, why is something like this not possible?

>>> d = ctypes.c_double()
>>> m = memoryview(d)
>>> m[0:8] = b'abcdefgh'
>>> d.value
8.540883223036124e+194
>>>

(Doesn't have to be exactly like this, but what's wrong with overwriting bytes 
with bytes of a compatible size?).

--

___
Python tracker 

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



[issue15831] comma after leading optional argument is after bracket in docs

2012-09-14 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks, Ezio!

By the way, I didn't do a thorough check, but I noticed this difference in the 
2.7 application of the patch.  The *key* argument for max() needs to be marked 
keyword-only.  This difference doesn't exist for the min() function.  Or are we 
not using the "bare *" notation in the 2.7 docs?  If not, the min() docs need 
to be changed instead (and possibly in several other places).

Default branch:

-.. function:: max(iterable[, args...], *[, key])
+.. function:: max(iterable, *[, key])
+  max(arg1, arg2, *args[, key])

2.7 branch:

-.. function:: max(iterable[, args...][key])
+.. function:: max(iterable[, key])
+  max(arg1, arg2, *args[, key])

--

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread David Beazley

David Beazley added the comment:

I should add that 0-dim indexing doesn't work as described either:

>>> import ctypes
>>> d = ctypes.c_double()
>>> m = memoryview(d)
>>> m[()]
Traceback (most recent call last):
  File "", line 1, in 
NotImplementedError: memoryview: unsupported format >>

--

___
Python tracker 

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



[issue15831] comma after leading optional argument is after bracket in docs

2012-09-14 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Someone pointed out that keyword-only arguments were introduced only in 3.0, 
but I'm not sure whether that means we can't use them as a notational device in 
the 2.7 docs.

--

___
Python tracker 

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



[issue15880] os.path.split() and long UNC names

2012-09-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue15883] Add Py_errno to work around multiple CRT issue

2012-09-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
type: behavior -> enhancement

___
Python tracker 

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



[issue15944] memoryviews and ctypes

2012-09-14 Thread Stefan Krah

Stefan Krah added the comment:

Please read msg170482. It even contains a copy and paste example!

--

___
Python tracker 

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



[issue15887] urlencode should accept iterables of pairs

2012-09-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The first sentence of the urlencode entry is a bit garbled as something is 
clearly missing.

"Convert a mapping object or a sequence of two-element tuples, which may either 
be a str or a bytes, to a “percent-encoded” string."

Mappings, duple sequences, and duples cannot be str or bytes. I presume the 
query argument can be a string (as stated in the docstring, but not here, 
though only vacuously true since only empty strings are accepted -- see below), 
mapping, or duple sequence, and that the phrase "which may either be a str or a 
bytes" refers to the unstated string option. This sentence should be fixed 
after deciding that the new truth should be.

The stated requirement of 'two-element tuples' is overly strict. The two loop 
headers
  for k, v in query:
only requires pairs, or rather iterables that produce two items, just as in 
two-target assignment statements.

The enhancement proposal should be the expansion of 'sequence' to 'iterable'. 
This is in line with the general trend in 3.x of replacing list or sequence 
with iterable. There is no good reason to force the creation of an temporary 
list. The two loops
  for k, v in query:
work perfectly well with any key-value iterable. In fact, dict (mapping) 
queries are now (in Python3) handled by replacing them with a key-value 
iterable that is not a sequence.
if hasattr(query, "items"):
query = query.items()
So directly passing dict.items(), for instance, should be allowed.

The only change needed is to the query argument rejection logic.

Currently, non-empty strings are rejected, even though the doc string and docs 
state or imply that query may be a string. They should state that only empty 
strings are accepted (though I do not see the point of accepting and returning 
an empty string, so maybe empty strings should also be disallowed). I believe 
the following reproduces current behavior as regards strings except for giving 
a more accurate error message.

if isinstance(query, (str, bytes)):
  if len(query): raise TypeError("non empty strings not allowed")
  else: return query

.with_traceback is meant for when one replaces one exception type with another 
or modified the tb object. The current usage in the code does neither and is a 
no-op and should be omitted in a patch.

The main part of the code can be wrapped with try-except to customize an error 
message if query is not iterable or if the items produced by iterating query 
are not iterables of pairs.

--
nosy: +terry.reedy
title: urlencode should accept generators or two elements tuples -> urlencode 
should accept iterables of pairs

___
Python tracker 

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



[issue15627] Add a method to importlib.abc.SourceLoader for converting source to a code object

2012-09-14 Thread Julian Berman

Changes by Julian Berman :


--
nosy: +Julian

___
Python tracker 

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



[issue15935] clarify argparse docs re: add_argument() type and default arguments

2012-09-14 Thread Chris Jerdonek

Chris Jerdonek added the comment:

If this looks good, can one of you three (Steven, Barry, or David) commit it in 
the three branches?

--

___
Python tracker 

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



[issue15831] comma after leading optional argument is after bracket in docs

2012-09-14 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Since the bare * notation wasn't added until 3.0, my guess is that we want to 
remove the * below (from the 2.7 application of the patch) rather than adding 
it back in the max() function I pasted above:

-.. function:: min(iterable[, args...][key])
+.. function:: min(iterable, *[, key])
+  min(arg1, arg2, *args[, key])

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

___
Python tracker 

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



[issue15831] comma after leading optional argument is after bracket in docs

2012-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 881acdf9133f by Ezio Melotti in branch '2.7':
#15831: avoid using 3.x syntax for keyword-only args.
http://hg.python.org/cpython/rev/881acdf9133f

--

___
Python tracker 

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



[issue15831] comma after leading optional argument is after bracket in docs

2012-09-14 Thread Ezio Melotti

Ezio Melotti added the comment:

The * is not supposed to be used on 2.7, but I missed that.
Thanks for noticing!

--
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
type: behavior -> enhancement

___
Python tracker 

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



[issue15932] files in the csv documentation's examples are not closed

2012-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ade667076c14 by Ezio Melotti in branch '2.7':
#15932: use with statement in csv doc examples.
http://hg.python.org/cpython/rev/ade667076c14

New changeset 8a06fb321074 by Ezio Melotti in branch '3.2':
#15932: use with statement in csv doc examples.  Patch by Dario Bertini.
http://hg.python.org/cpython/rev/8a06fb321074

New changeset a5a8d255daee by Ezio Melotti in branch 'default':
#15932: merge with 3.2.
http://hg.python.org/cpython/rev/a5a8d255daee

--
nosy: +python-dev

___
Python tracker 

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



[issue15932] files in the csv documentation's examples are not closed

2012-09-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

--
assignee: docs@python -> ezio.melotti
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed
type:  -> enhancement
versions: +Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue15922] make howto/urllib2.rst doctests pass

2012-09-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
type:  -> enhancement

___
Python tracker 

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



[issue15897] zipimport.c doesn't check return value of fseek()

2012-09-14 Thread Felipe Cruz

Felipe Cruz added the comment:

Hello!

This is one of my first patches.

Tests still OK! Let me know what you think!

Thanks!

--
keywords: +patch
nosy: +felipecruz
Added file: http://bugs.python.org/file27191/issue15897_v1.patch

___
Python tracker 

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



[issue15897] zipimport.c doesn't check return value of fseek()

2012-09-14 Thread Felipe Cruz

Felipe Cruz added the comment:

Patch updated - fseek errors messges will be "can't read Zip file' and not 
"can't Open Zip file"

--
Added file: http://bugs.python.org/file27192/issue15897_v1.patch

___
Python tracker 

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



[issue15897] zipimport.c doesn't check return value of fseek()

2012-09-14 Thread Ezio Melotti

Ezio Melotti added the comment:

I suggested to Felipe on IRC to use "read" instead of "seek" because I don't 
think it's worth making a distinction between the two.  Moreover ISTM that in 
most of the cases, if the fseek fails, the error is detected in a following 
fread, so the message currently says "can't read", and changing it to "can't 
seek" is technically backward-incompatible.

We also checked if the test suite followed any of these new error paths, but 
apparently only the "if" added in the first chunk (line 880, in read_directory) 
is already covered.  Going through the following chunks (the ones with the goto 
fseek_error) is fairly difficult.  It should be possibly to trigger the error 
at line 1071, in get_data, by changing the value of self.archive, but alas 
self.archive is read-only.

The error generated by PyErr_SetFromErrno() doesn't seem too useful.  For 
example, with "PyErr_SetFromErrno(PyExc_IOError);" instead of 
"PyErr_Format(ZipImportError, "can't open Zip file: %R", archive);", the error 
becomes "OSError: [Errno 22] Invalid argument".  This alone is fairly useless, 
even though the message might be better in other situations.  I think either 
using PyErr_Format, or a combination of the two (something like 
"ZipImportError: can't read Zip file: 'ziptestmodule' ([Errno 22] Invalid 
argument)") would be better.

--
keywords:  -easy
nosy: +ezio.melotti, pitrou
stage:  -> patch review

___
Python tracker 

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



[issue15789] mention shell-like parts of the std lib in the subprocess docs

2012-09-14 Thread Chris Rebert

Chris Rebert added the comment:

Ping. Any further comments?

--

___
Python tracker 

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



[issue15789] mention shell-like parts of the std lib in the subprocess docs

2012-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 820032281f49 by Ezio Melotti in branch '2.7':
#15789: mention shell-like parts of the stdlib in the subprocess docs.  Patch 
by Chris Rebert.
http://hg.python.org/cpython/rev/820032281f49

New changeset 9794f69c1d09 by Ezio Melotti in branch '3.2':
#15789: mention shell-like parts of the stdlib in the subprocess docs.  Patch 
by Chris Rebert.
http://hg.python.org/cpython/rev/9794f69c1d09

New changeset 09011896374d by Ezio Melotti in branch 'default':
#15789: merge with 3.2.
http://hg.python.org/cpython/rev/09011896374d

--
nosy: +python-dev

___
Python tracker 

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



[issue15789] mention shell-like parts of the std lib in the subprocess docs

2012-09-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Pong, thanks for the patch!

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue15880] os.path.split() and long UNC names

2012-09-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
nosy: +ezio.melotti
stage:  -> test needed
type: crash -> behavior
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue15887] urlencode should accept iterables of pairs

2012-09-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue15888] ipaddress doctest examples have some errors

2012-09-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
stage: needs patch -> patch review

___
Python tracker 

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



[issue15920] make howto/regex.rst doctests pass

2012-09-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
type:  -> enhancement

___
Python tracker 

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



[issue14570] Document json "sort_keys" parameter properly

2012-09-14 Thread Chris Rebert

Chris Rebert added the comment:

Any reactions? The patch is pretty straightforward...

--

___
Python tracker 

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



[issue14570] Document json "sort_keys" parameter properly

2012-09-14 Thread Ezio Melotti

Changes by Ezio Melotti :


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

___
Python tracker 

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