[issue8673] configure script doesn't recognize 10.5 SDK correctly

2010-05-10 Thread Ronald Oussoren

New submission from Ronald Oussoren :

I got a build error when building the 2.7b2 installers because the MacOS module 
couldn't be build. That turns out to be caused by an issue in the configure 
script: for some reason the check for the 10.5 SDK gives the wrong answer (both 
with and without building using the 10.4u SDK).

I haven't had time to research the issue and worked around it by hardcoding the 
right answer in the configure script during my build, but that's obviously not 
the correct solution.

--
assignee: ronaldoussoren
components: Build, Macintosh
messages: 105426
nosy: ronaldoussoren
priority: high
severity: normal
stage: needs patch
status: open
title: configure script doesn't recognize 10.5 SDK correctly
type: compile error
versions: Python 2.7

___
Python tracker 

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



[issue8510] update to autoconf2.65

2010-05-10 Thread Roumen Petrov

Roumen Petrov  added the comment:

I don't have access to source so my comment will be based only on diffs from 
above mentioned revisions.
r80969:
- AC_LANG_PROGRAM ... with main function in body . It is legal as I don't know 
C compiler that fail to compile code like ...int main() { int main() {...} ...} 
but is better to left body empty. Counted three times. All those cases tests 
for compiler flags and I think that AC_LANG_SOURCE is enough.

- body include  #include "confdefs.h" - may be buggy (before) and now 
AC_LANG_PROGRAM will add all defines. Counted any times. I think that is save 
to remove  #include "confdefs.h" from all those test cases.

--

___
Python tracker 

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



[issue8577] test_distutils fails if srcdir != builddir

2010-05-10 Thread Roumen Petrov

Roumen Petrov  added the comment:

Hmm, this issue was fixed before.
My be restore of 2.6 distutils ignore those fixes. It is good to compare 
current Lib/distutils/sysconfig.py with version from Dec 2009 .

--
nosy: +rpetrov

___
Python tracker 

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



[issue8577] test_distutils fails if srcdir != builddir

2010-05-10 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

I intend to forward port the fix to 3.2 in the near future, to avoid missing 
real issues when I do updates to the platform support for OSX.

--

___
Python tracker 

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



[issue8673] configure script doesn't recognize 10.5 SDK correctly

2010-05-10 Thread Mark Dickinson

Mark Dickinson  added the comment:

I think this was fixed in r80969, but confirmation would be good.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue8673] configure script doesn't recognize 10.5 SDK correctly

2010-05-10 Thread Mark Dickinson

Mark Dickinson  added the comment:

Sorry;  r81004, rather.

--

___
Python tracker 

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



[issue8673] configure script doesn't recognize 10.5 SDK correctly

2010-05-10 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Cool, thanks. I'll check this later this week.

--

___
Python tracker 

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



[issue7879] Too narrow platform check in test_datetime

2010-05-10 Thread Andrej Krpic

Changes by Andrej Krpic :


--
components: +Windows
type:  -> behavior

___
Python tracker 

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



[issue3704] cookielib doesn't handle URLs with / in parameters

2010-05-10 Thread John J Lee

John J Lee  added the comment:

I'll upload a patch when I'm back home (bugs.python.org went down yesterday).

Will turn docstring into comment.

--

___
Python tracker 

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



[issue8674] audioop: incorrect integer overflow checks

2010-05-10 Thread Tomas Hoger

New submission from Tomas Hoger :

SVN commit r64114 added integer overflow checks to multiple modules.  Checks 
added to audioop module are incorrect and can still be bypassed:

http://svn.python.org/view/python/trunk/Modules/audioop.c?r1=64114&r2=64113

- audioop_tostereo - should be fine, but relies on undefined behaviour
- audioop_lin2lin - undetected overflow: size=1, size2=4, len=0x4001
- audioop_ratecv - undetected overflow: nchannels=0x5fff (32bit)
- audioop_ulaw2lin - undetected overflow: size=4, len=0x4001
- audioop_alaw2lin - same as audioop_ulaw2lin
- audioop_adpcm2lin - undetected overflow: size=4, len=0x2001

Most of these are triggered by large fragment as an input.

Attached patch replaces checks added in r64114 by checks using INT_MAX.

--
components: Extension Modules
files: python2.6-audioop-int-overflows.diff
keywords: patch
messages: 105434
nosy: thoger
priority: normal
severity: normal
status: open
title: audioop: incorrect integer overflow checks
type: security
versions: Python 2.6
Added file: 
http://bugs.python.org/file17281/python2.6-audioop-int-overflows.diff

___
Python tracker 

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



[issue8256] TypeError: bad argument type for built-in operation

2010-05-10 Thread R. David Murray

R. David Murray  added the comment:

Victor, you've been dealing with Python's default encoding lately, care to 
render an opinion on the correct fix for this bug?

@Filip: the patch will need a unit test, which will also help with assessing 
the validity of the fix.

--
nosy: +haypo

___
Python tracker 

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



[issue8256] TypeError: bad argument type for built-in operation

2010-05-10 Thread Filip Gruszczyński

Filip Gruszczyński  added the comment:

I'll try to code a small test this evening.

--

___
Python tracker 

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



[issue8618] test_winsound fails when no playback devices configured

2010-05-10 Thread Brian Curtin

Changes by Brian Curtin :


--
title: test_winsound failing on Windows Server 2008 -> test_winsound fails when 
no playback devices configured

___
Python tracker 

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



[issue8674] audioop: incorrect integer overflow checks

2010-05-10 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks for the patch.  I agree that undefined behaviour (e.g., from signed 
overflow) should be avoided where at all possible.

Do you have any Python examples that failed to trigger the overflow on your 
platform?  If so, it would be useful to add them to Lib/test/test_audioop.py as 
extra testcases.

One other question:  is there something about the formats that audioop is 
dealing with that limits sizes to INT_MAX (rather than PY_SSIZE_T_MAX, for 
example)?  I'm not really familiar with audio formats.

As an aside, I also find it strange that the code raises MemoryError in these 
cases, since these exceptions can be raised even when there's plenty of memory 
available.  IMO MemoryError should only be raised as a result of a failed 
attempt to allocate memory from the system.  Some other exception---perhaps 
OverflowError---would seem more appropriate here.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue8674] audioop: incorrect integer overflow checks

2010-05-10 Thread Mark Dickinson

Mark Dickinson  added the comment:

Unless you have an explicit exploit, I think the 'type' should be 'behavior' 
rather than 'security'.

--
stage:  -> unit test needed
type: security -> behavior
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue8256] TypeError: bad argument type for built-in operation

2010-05-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The patch is wrong: _PyUnicode_AsString(Py_None) should not return "utf8"!

I suggest that since PyOS_Readline() write the prompt to stderr, the conversion 
uses the encoding of stderr.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2010-05-10 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

This is now committed as r81041.
I've also removed the long description from what's new file, as you were 
suggesting.

The other two patches should be adapted for 3.2.

--

___
Python tracker 

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



[issue8674] audioop: incorrect integer overflow checks

2010-05-10 Thread Mark Dickinson

Mark Dickinson  added the comment:

Okay, it looks to me as though all those 'int' lengths should really be 
'Py_ssize_t'.  I don't think that's something we can change in 2.6, though;  
probably not in 2.7 either, since we're getting too close to the release.  It 
can and should be changed in py3k, though.

I'll review this patch and (assuming it looks good) apply it to the 2.x 
branches.  It would be great to have some tests, though.

--

___
Python tracker 

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



[issue4256] optparse/argparse: provide a simple way to get a programmatically useful list of options

2010-05-10 Thread R. David Murray

R. David Murray  added the comment:

zsh's completion system is completely programmable.  I looks like it would be 
pretty easy to add generic 'python script' support widgets(*) using this hidden 
option, and probably other neat tricks as well.  Something that would make it 
even more useful for zsh completion would be to include information on the type 
of the argument when known.  A zsh completer could then be programmed to do 
smart completion on the option value as well.

(*) You can write a 'widget' and assign it to a key, and then when you use that 
key the completion widget (shell function) is called and could run the command 
with the hidden option to get the option info and generate the completion list. 
 That's just the *easiest* way to integrate support for this into zsh 
completion.

--

___
Python tracker 

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



[issue8674] audioop: incorrect integer overflow checks

2010-05-10 Thread Tomas Hoger

Tomas Hoger  added the comment:

> Do you have any Python examples that failed to trigger the overflow
> on your platform?

No, I've not really tried to create some, as I found it while looking into 
similar checks added to rgbimg module (which is dead and removed upstream now) 
in the same commit r64114.

Having another close look, I can reproduce crash with lin2lin:
  audioop.lin2lin("A"*0x4001, 1, 4)

ratecv may cause issues too.  Other cases use for loop with multiplication 
product as an upper bound, so the integer overflow should be harmless in those 
case.

> is there something about the formats that audioop is dealing
> with that limits sizes to INT_MAX (rather than PY_SSIZE_T_MAX,
> for example)?

I've started looking into this on oldish python 2.4, where 
PyString_FromStringAndSize accepts int size, rather than Py_ssize_t.  Rest of 
the audioop code was using ints too.  It's possible it is ok to more to size_t 
in current python version.

--

___
Python tracker 

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



[issue8490] asyncore test suite

2010-05-10 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Committed in r81043 (trunk) and r81044 (3.2).
Thanks for your comments.

--
assignee: josiahcarlson -> giampaolo.rodola
components: +Tests
resolution:  -> fixed
stage:  -> committed/rejected
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue8490] asyncore test suite

2010-05-10 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
status: open -> closed

___
Python tracker 

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



[issue7040] test_smtplib fails on os x 10.6

2010-05-10 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Closed as duplicate of issue7037.

--
nosy: +giampaolo.rodola
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue8666] Allow ConfigParser.get*() to take a default value

2010-05-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

what is this "raise_on_bad" additional argument?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue2982] more tests for pyexpat

2010-05-10 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I'm not a xml* modules user but I've tried to apply the patch against the trunk 
and it seems it still works.

--
nosy: +effbot, giampaolo.rodola, loewis
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.0

___
Python tracker 

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



[issue1285086] urllib.quote is too slow

2010-05-10 Thread Tres Seaver

Tres Seaver  added the comment:

I can only reiterate that Zope apps can call 'urllib.quote' dozens,
hundreds, even thousands of times on a single request:  the
reason for the original bug report was that 'urllib.quote' was
showing up frequently on profiling output for such requests.
Short-circuiting the case for the empty string and the case that
the string being quoted actually contains only safe characters
together made 'urllib.quote' disappear from the profiler output.

Newer frameworks, such as 'repoze.bfg', avoid using
'urliib.quote' at all for just this reason.

--

___
Python tracker 

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



[issue8674] audioop: incorrect integer overflow checks

2010-05-10 Thread Mark Dickinson

Mark Dickinson  added the comment:

Yes, writing portable tests turns out to be tricky;  I also don't want to write 
tests based on int that'll fail when/if Py_ssize_t is substituted.

Applied the patch (with a couple of minor changes) in r81045 through r81048.  
I'll open another issue for the int->Py_ssize_t changes.

Thanks again for the patch!

--
assignee:  -> mark.dickinson
resolution:  -> fixed
stage: unit test needed -> 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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-05-10 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

The problem is apparently due to the fact that small_set -= large_set
iterates over the large set removing entries from small_set while more
efficient small_set - large_set builds a new set iterating over a
small_set and adding items that are not in the large set.  Since
lookups are O(1), it is more efficient to iterate over a small set
while looking up a large set than the other way around.  I am
attaching a minimalist patch which gives up in-place update for s1 -=
s2 if len(s1) < len(s2) and effectively replaces it with s1 = s1 - s2.
 The code can be further optimized by replicating set_difference logic
in set_isub instead of relying on fall back behavior, but the big
question here  with whether it is acceptable to give up preserving set
identity in in-place subtract to gain performance.

--
keywords: +patch
Added file: http://bugs.python.org/file17282/issue8425.diff

___
Python tracker 

___Index: Objects/setobject.c
===
--- Objects/setobject.c (revision 81048)
+++ Objects/setobject.c (working copy)
@@ -1612,7 +1612,10 @@
 static PyObject *
 set_isub(PySetObject *so, PyObject *other)
 {
-if (!PyAnySet_Check(other)) {
+if (!PyAnySet_Check(other) ||
+   /* Fall back to s = s - o if len(s) < len(o) to
+  avoid interation over a large set. */
+   PySet_GET_SIZE(so) < PySet_GET_SIZE(other)) {
 Py_INCREF(Py_NotImplemented);
 return Py_NotImplemented;
 }
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-05-10 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-05-10 Thread R. David Murray

R. David Murray  added the comment:

The answer is almost certainly "no".

--
nosy: +r.david.murray

___
Python tracker 

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-05-10 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On the second thought, it is possible to preserve set identity and avoid 
iteration over a large set.   See issue8425a.diff attached.

It looks like the unit tests don't check identity preservation.  I will submit 
additional tests shortly.

--
Added file: http://bugs.python.org/file17283/issue8425a.diff

___
Python tracker 

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



[issue8666] Allow ConfigParser.get*() to take a default value

2010-05-10 Thread Tim Chase

Tim Chase  added the comment:

The "raise_on_bad" (I'm ambivalent on the name, but if you come up with a 
better name, I'd be fine with changing it) allows you to differentiate between 
an option that isn't provided, and one that is provided, but can't be converted 
to the specified int/float/boolean type.  E.g.

  [MySection]
  myFloat = hello

if you issue

  f = cp.getfloat("MySection", "myFloat", default=3.14, raise_on_bad=True)

it will raise a ValueError because "hello" can't be converted to a float.  
However there are other times you want (well, other times *I've* wanted...most 
cases, in fact) to be able to specify that if there's ANY problem, just return 
the default:

  f = cp.getfloat("MySection", "myFloat", default=3.14, raise_on_bad=False)

returns f=3.14 (the default).  The only crazy side-exception I saw in the code 
is if you make a "dumb programmer" mistake of 

  f = cp.getfloat("MySection", "myFloat", default="foo", raise_on_bad=False)

it may still give you an error or unexpected non-float results because the 
default isn't what you asked for.

The ability to get a valid result back (regardless of section or option 
presence; or data errors) is most helpful when all you want is the answer to 
the question "did the user specify a valid value I can use? otherwise, just use 
the darn default".

--

___
Python tracker 

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-05-10 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Added file: http://bugs.python.org/file17284/issue8425-tests.diff

___
Python tracker 

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



[issue8675] audioop module needs an int -> Py_ssize_t upgrade

2010-05-10 Thread Mark Dickinson

New submission from Mark Dickinson :

The audioop module still uses 'int' for most of its sizes;  it would be better 
if it used 'Py_ssize_t' instead, so that data aren't artificially limited to 
2Gb on 64-bit systems.

Converting ought to be a fairly straightforward task for someone wanting to get 
their feet wet with CPython hacking;  marking as easy.

--
keywords: easy
messages: 105454
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: audioop module needs an int -> Py_ssize_t upgrade
type: performance
versions: Python 3.2

___
Python tracker 

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-05-10 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Note that issue8425a.diff leaves small_set.difference_update(large_dict) 
unoptimized:

$ ./python.exe -m timeit -s "s = {1}; l = dict.fromkeys(range(1000));" 
"s.difference_update(l)"
1000 loops, best of 3: 842 usec per loop
$ ./python.exe -m timeit -s "s = {1}; l = dict.fromkeys(range(1000));" 
"s.difference(l)"
10 loops, best of 3: 13.2 usec per loop

It would be easy to add an extra type check, but I noticed that 
small_set.difference_update(large_dict.viewkeys()) is not optimized either:

$ ./python.exe -m timeit -s "s = {1}; l = dict.fromkeys(range(1000));" 
"s.difference(l.viewkeys())"
1000 loops, best of 3: 842 usec per loop

It would be nice if there was a uniform C-API that would allow to uniformly 
check that an object supports O(1) lookup and invoke such lookup efficiently.  
I don't think such C-API exists at the moment.

I would like to hear what others have to say before adding optimizations  to 
the patch that go beyond the scope of this issue.

--

___
Python tracker 

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



[issue4768] email.generator.Generator object bytes/str crash - b64encode() bug?

2010-05-10 Thread R. David Murray

Changes by R. David Murray :


--
priority: high -> critical

___
Python tracker 

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



[issue8666] Allow ConfigParser.get*() to take a default value

2010-05-10 Thread R. David Murray

R. David Murray  added the comment:

Rather than a raise_on_bad option, it seems to me it would be better to code a 
try/except clause in cases where you want the default even if there is an error 
converting the data in the file.  I would expect such cases to be rare, except 
for cases where you want to issue a warning message and then proceed with the 
default anyway, in which case you'd need the try/except anyway in order to 
issue the warning message.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue8676] Py3k Built-in Exceptions documentation mentions the raise statement of 2.x

2010-05-10 Thread Daniel Urban

New submission from Daniel Urban :

In the documentation of the exceptions 
(http://docs.python.org/dev/py3k/library/exceptions) there is a sentence:
"The associated value is the second argument to the raise statement."
But in py3k there is a different raise statement than in 2.x.

--
assignee: d...@python
components: Documentation
messages: 105457
nosy: d...@python, durban
priority: normal
severity: normal
status: open
title: Py3k Built-in Exceptions documentation mentions the raise statement of 
2.x
versions: Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue3704] cookielib doesn't handle URLs with / in parameters

2010-05-10 Thread John J Lee

John J Lee  added the comment:

Just re-read your comment, Tres.  Since when do docstrings determine whether a 
stdlib function is public?  If it's documented in the docs, it's public.  If 
not, it's not.  This function isn't, so it's not public.  It's also not in 
__all__, FWLTW.

--

___
Python tracker 

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



[issue3704] cookielib doesn't handle URLs with / in parameters

2010-05-10 Thread John J Lee

Changes by John J Lee :


Added file: http://bugs.python.org/file17285/issue3704.patch

___
Python tracker 

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



[issue3704] cookielib doesn't handle URLs with / in parameters

2010-05-10 Thread John J Lee

John J Lee  added the comment:

Didn't bother changing docstring to comment, since that would be inconsistent 
with rest of module.

--

___
Python tracker 

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



[issue3704] cookielib doesn't handle URLs with / in parameters

2010-05-10 Thread John J Lee

John J Lee  added the comment:

FWIW, the "certain semantics" that request_path "promises" are 1. that it 
returns the RFC 2965 request-URI (which has never been true -- it returns the 
path component of the request-URI instead) and 2. that that request-URI is as 
defined in RFC 2965, and this bug is about fixing the function so that that's 
true for the case where the URI has a query component.  So there's absolutely 
no reason for not changing the function.

--

___
Python tracker 

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



[issue8677] Modules needing PY_SSIZE_T_CLEAN

2010-05-10 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This is a list of extension modules making use of one of the "#" format codes 
("s#", "y#", etc.) without defining PY_SSIZE_T_CLEAN, and therefore being 
64-bit unclean:

Modules/audioop.c
Modules/_cursesmodule.c
Modules/_elementtree.c
Modules/_gdbmmodule.c
Modules/nismodule.c
Modules/ossaudiodev.c
Modules/pyexpat.c
Modules/socketmodule.c
Modules/_ssl.c
Modules/unicodedata.c

--
components: Extension Modules
messages: 105461
nosy: pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Modules needing PY_SSIZE_T_CLEAN
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue8677] Modules needing PY_SSIZE_T_CLEAN

2010-05-10 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
dependencies: +audioop module needs an int -> Py_ssize_t upgrade
nosy: +mark.dickinson

___
Python tracker 

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



[issue8677] Modules needing PY_SSIZE_T_CLEAN

2010-05-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The documentation says that sometimes in the future Py_ssize_t will be the 
default, so we may also need some kind of transition period for non-complying 
third-party extensions; first with warnings and then with errors perhaps.

--
nosy: +loewis

___
Python tracker 

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



[issue8303] python -m unittest -h and python -m unittest discover -h message slightly incorrect

2010-05-10 Thread Michael Foord

Michael Foord  added the comment:

Committed revision 81055.

--
resolution:  -> accepted
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



[issue8677] Modules needing PY_SSIZE_T_CLEAN

2010-05-10 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I personally don't think that a transition period would be a useful thing to 
have, in particular not if it goes like this:
- in version A, require use of PY_SSIZE_T_CLEAN
- in version A+1, make use of PY_SSIZE_T_CLEAN redundant

So I'd rather drop PY_SSIZE_T clean altogether from 3.2, and risk any breakage 
that this may cause.

--

___
Python tracker 

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



[issue8677] Modules needing PY_SSIZE_T_CLEAN

2010-05-10 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue8676] Py3k Built-in Exceptions documentation mentions the raise statement of 2.x

2010-05-10 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Thanks for the report. Fixed in r81057.

--
nosy: +benjamin.peterson
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue8642] json.loads description

2010-05-10 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r81059.

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

___
Python tracker 

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



[issue8678] crashers in rgbimg

2010-05-10 Thread Brett Cannon

New submission from Brett Cannon :

Red Hat found some crashers in the rgbimg module along with a proposed patch: 
https://bugzilla.redhat.com/show_bug.cgi?id=541698 . Since the patch was sent 
to the PSRT privately before the bugs were announced, it should be fine to take 
the patch from the page and apply it.

--
messages: 105467
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: crashers in rgbimg
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue8679] write a distutils to distutils2 converter

2010-05-10 Thread Tarek Ziadé

New submission from Tarek Ziadé :

write a script that converts a distutils or setuptools based setup.py script 
into a distutils2 one.

This script will need to parse the AST and generate a new setup.py, using a few 
transformation rules.

--
assignee: tarek
components: Distutils2
messages: 105468
nosy: tarek
priority: normal
severity: normal
status: open
title: write a distutils to distutils2 converter
type: feature request

___
Python tracker 

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



[issue8678] crashers in rgbimg

2010-05-10 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

As a security fix, it probably applies to 2.5 and 2.6 as well.

--
nosy: +loewis
versions: +Python 2.5, Python 2.6

___
Python tracker 

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



[issue8672] Error decompressing valid zlib data

2010-05-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

After a bit of debugging, it seems your data is not actually a complete zlib 
stream (*). What did you generate it with?

(*) in technical terms, the zlib never returns Z_STREAM_END when decompressing 
your data. The decompressobj ignores it, but the top-level decompress() 
function considers it an error.

--
nosy: +pitrou

___
Python tracker 

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



[issue8680] Add a sandbox in Distutils2

2010-05-10 Thread Tarek Ziadé

New submission from Tarek Ziadé :

Add a sandbox in distutils2, so all installation steps can be recorded or 
controlled.

Usage example: a dry-run mode that prevents anything to be written on the disk 
but just reports.

See setuptools.sandbox for example

--
assignee: tarek
components: Distutils2
messages: 105471
nosy: tarek
priority: normal
severity: normal
status: open
title: Add a sandbox in Distutils2
type: feature request

___
Python tracker 

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



[issue8679] write a distutils to distutils2 converter

2010-05-10 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

lib2to3 can be used as a framework for this feature

--

___
Python tracker 

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



[issue7833] Bdist_wininst installers fail to load extensions built with Issue4120 patch

2010-05-10 Thread Christoph Gohlke

Christoph Gohlke  added the comment:

The bdist_wininst and DLL build issues also exist in Python 2.7b2. A patch 
against svn trunk is attached. 

The pywin32 v214 package fails as reported earlier when built with Python 
2.7b2. It installs and functions when built with this patch.

--
versions: +Python 2.7
Added file: 
http://bugs.python.org/file17286/msvc9compiler_stripruntimes_trunk.patch

___
Python tracker 

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



[issue8672] Error decompressing valid zlib data

2010-05-10 Thread Matthew Brett

Matthew Brett  added the comment:

Hi,

> Antoine Pitrou  added the comment:
>
> After a bit of debugging, it seems your data is not actually a complete zlib 
> stream (*). What did you generate it with?
>
> (*) in technical terms, the zlib never returns Z_STREAM_END when 
> decompressing your data. The decompressobj ignores it, but the top-level 
> decompress() function considers it an error.

Thanks for the debugging.  The stream comes from within a matlab 'mat'
file.  I maintain the scipy matlab file readers; the variables within
these files are zlib compressed streams.

 Is there (should there be) a safe and maintained way to allow me to
read a stream that does not return Z_STREAM_END?

--

___
Python tracker 

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



[issue8672] Error decompressing valid zlib data

2010-05-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Thanks for the debugging.  The stream comes from within a matlab 'mat'
> file.  I maintain the scipy matlab file readers; the variables within
> these files are zlib compressed streams.

So this would be a Matlab issue, right?

>  Is there (should there be) a safe and maintained way to allow me to
> read a stream that does not return Z_STREAM_END?

Decompressor objects allow you to do that, but I cannot tell you how
"maintained" it is. If it has to be maintained, we could add an unit
test for it so that regressions get detected. It would be nice if you
could provide a very short zlib stream reproducing the issue.

--

___
Python tracker 

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



[issue8681] Make the zlib module emit more detailed error messages

2010-05-10 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This is a patch to use our own error descriptions when the zlib doesn't provide 
anything in particular. It would have made issue8672 easier to diagnose for the 
reporter (and for us).

--
components: Extension Modules
files: zliberrors.patch
keywords: patch
messages: 105476
nosy: gregory.p.smith, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: Make the zlib module emit more detailed error messages
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file17287/zliberrors.patch

___
Python tracker 

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



[issue8672] Error decompressing valid zlib data

2010-05-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I also think we should improve the zlib module's error messages. I've added a 
patch in issue8681 for that. With that patch, the message you'd've encountered 
would have been "Error -5 while decompressing data: incomplete or truncated 
stream", which is quite more informative.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue8672] Error decompressing valid zlib data

2010-05-10 Thread Matthew Brett

Matthew Brett  added the comment:

>> Thanks for the debugging.  The stream comes from within a matlab 'mat'
>> file.  I maintain the scipy matlab file readers; the variables within
>> these files are zlib compressed streams.
>
> So this would be a Matlab issue, right?

Yes, except scipy and numpy aim in part to be an open-source
replacement for matlab, so we very much want to be able to read their
files.

>>  Is there (should there be) a safe and maintained way to allow me to
>> read a stream that does not return Z_STREAM_END?
>
> Decompressor objects allow you to do that, but I cannot tell you how
> "maintained" it is. If it has to be maintained, we could add an unit
> test for it so that regressions get detected. It would be nice if you
> could provide a very short zlib stream reproducing the issue

This is the only .mat file stream I have yet come across that causes
the error.  It is possible to knock a portion off the end of a valid
stream to reproduce the problem?

--

___
Python tracker 

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



[issue8550] Expose SSL contexts

2010-05-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I uploaded the latest patch at http://codereview.appspot.com/1124044

--

___
Python tracker 

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



[issue8672] Error decompressing valid zlib data

2010-05-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, it turned out to be quite easy indeed. Here is a patch adding a test.

--
keywords: +patch
Added file: http://bugs.python.org/file17288/zlib-8672.patch

___
Python tracker 

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



[issue8672] Error decompressing valid zlib data

2010-05-10 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
components: +Tests -Library (Lib)
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



[issue8682] _ssl.c uses PyWeakref_GetObject but doesn't incref result

2010-05-10 Thread Antoine Pitrou

New submission from Antoine Pitrou :

PyWeakref_GetObject() returns a borrowed reference, which can therefore become 
invalid at any time (especially when the GIL gets released). This provides a 
way to crash the interpreter deliberately.
The returned reference should be incref'ed immediately before any other action 
is taken.

--
assignee: pitrou
components: Extension Modules
messages: 105481
nosy: pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: _ssl.c uses PyWeakref_GetObject but doesn't incref result
type: crash
versions: Python 3.1, Python 3.2

___
Python tracker 

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



[issue8683] HPUX Segmentation Fault in Modules/gcmodule.c -- if (!gc_list_is_empty(from)) {

2010-05-10 Thread srid

New submission from srid :

Platform: HP-UX B.11.22 U ia64
Python: 2.7 trunk

GDB output when running built `python` binary:

Program received signal SIGSEGV, Segmentation fault (si_code: 1).
0x402a2510:1 in gc_list_merge (from=0x148, to=0x148)
at Modules/gcmodule.c:240
240 if (!gc_list_is_empty(from)) {

and the stack trace:

(gdb) bt
#0  0x402a2510:1 in gc_list_merge (from=0x148, to=0x148)
at Modules/gcmodule.c:240
#1  0x402a4720:0 in collect (generation=0) at Modules/gcmodule.c:975
#2  0x402a6620:0 in _PyObject_GC_Malloc (basicsize=65598)
at Modules/gcmodule.c:996
#3  0x4018e540:0 in PyType_GenericAlloc (type=0x1003e, nitems=65598)
at Objects/typeobject.c:743
#4  0x403107d0:0 in PyDescr_NewWrapper (type=0x0, base=0x1003e, 
wrapped=0x1003e) at Objects/descrobject.c:641
#5  0x401a4570:0 in add_operators (type=0x0)
at Objects/typeobject.c:6388
#6  0x40193670:0 in PyType_Ready (type=0x1003e)
at Objects/typeobject.c:4003
#7  0x401485b0:0 in _Py_ReadyTypes () at Objects/object.c:2092
#8  0x40270980:0 in Py_InitializeEx (install_sigs=0)
at Python/pythonrun.c:176
#9  0x402720e0:0 in Py_Initialize () at Python/pythonrun.c:370
#10 0x4009da70:0 in Py_Main (argc=0, argv=0x0) at Modules/main.c:507
#11 0x4009c770:0 in main (argc=0, argv=0x0) at ./Modules/python.c:23

--
components: Interpreter Core
messages: 105482
nosy: srid
priority: normal
severity: normal
status: open
title: HPUX Segmentation Fault in Modules/gcmodule.c -- if 
(!gc_list_is_empty(from)) {
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue8683] HPUX Segmentation fault in Modules/gcmodule.c -- if (!gc_list_is_empty(from)) {

2010-05-10 Thread srid

Changes by srid :


--
nosy: +pitrou
title: HPUX Segmentation Fault in Modules/gcmodule.c -- if 
(!gc_list_is_empty(from)) { -> HPUX Segmentation fault in Modules/gcmodule.c -- 
if (!gc_list_is_empty(from)) {

___
Python tracker 

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



[issue8684] improvements to sched.py

2010-05-10 Thread Josiah Carlson

New submission from Josiah Carlson :

This patch is against Python trunk, but it could be easily targeted for Python 
3.2 .  It is meant to extract the scheduler updates from issue1641 without 
mucking with asyncore.  It's reach is reduced and simplified, which should make 
maintenance a bit easier.

--
assignee: giampaolo.rodola
components: Library (Lib)
files: sched.patch
keywords: needs review, patch, patch
messages: 105483
nosy: giampaolo.rodola, josiahcarlson
priority: low
severity: normal
status: open
title: improvements to sched.py
type: feature request
Added file: http://bugs.python.org/file17289/sched.patch

___
Python tracker 

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



[issue1641] asyncore delayed calls feature

2010-05-10 Thread Josiah Carlson

Josiah Carlson  added the comment:

Some prodding from Giampaolo got me to pull out and simplify the sched.py 
changes here: issue8684 .

That should be sufficient to add scheduling behavior into async socket servers 
or otherwise.

--

___
Python tracker 

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