[issue1503] test_xmlrpc is still flakey

2008-03-28 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Ugh.  The manpage for accept on Ubuntu 6.10 says:


On  Linux,  the  new  socket returned by accept() does not inherit file
status flags such as O_NONBLOCK and O_ASYNC from the listening  socket.
This  behaviour  differs from the canonical BSD sockets implementation.
Portable programs should not rely on inheritance or non-inheritance  of
file  status  flags and always explicitly set all required flags on the
socket returned from accept().


http://msdn2.microsoft.com/en-us/library/aa450277.aspx says that Windows
(CE, but I assume all variants) are like BSD in that they inherit
attributes.

The newly created socket is the socket that will handle the actual
connection and has the same properties as socket s, including the
asynchronous events registered with the WSAEventSelect function.

I assume that means blocking behavior.

I checked in r61993 which should fix the immediate problem with
test_xmlrpc.  I wonder if we should change socket to do the same thing
for all platforms.

--
nosy: +nnorwitz

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



[issue2497] stdbool support

2008-03-28 Thread Rolland Dudemaine

Rolland Dudemaine [EMAIL PROTECTED] added the comment:

In this precise case, this is for an RTOS called INTEGRITY, which does 
define true and false as macros. The compiler is the vendor compiler 
(Green Hills), but the definition conflicting with Python's definition 
is comiung from the system header.
Note, the issue still remains outside this context.
 Using stdbool.h when it is available will ensure bool is defined as a
 type following the correct definition, which may or may not be an enum
 depending on the compiler.
 

 But would that help in any way with respect to above compilers?
 If they don't follow the C standard, why should they provide stdbool.h?
   
That's not the point.
If stdbool is not available, C99 still defines false and true as macros.
If stdbool is available, then most compilers will define false and true 
as macros. This includes Green Hills' compiler, but more importantly gcc 
as well.
Look at 
http://gcc.gnu.org/viewcvs/trunk/gcc/ginclude/stdbool.h?revision=130805view=markup
 
for the current definition of stdbool.h in gcc.
Look at 
http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html 
for a definition of how false, true and _Bool should be defined.
In both cases, if stdbool was included by any system header in the 
future, that would conflict with your current definition.
 Even when using gcc, stdbool.h is here to define bool in C language, so
 why not use it ?
 

 Because we cannot *rely* on stdbool.h being present. Therefore,
 inclusion of stdbool.h must be conditional, with a fallback definition
 if stdbool.h is absent, and it thus complicates the source code of
 Python, with no gain whatsoever.
   
This is the main reason why I added the conditional in the code, so that 
for compilers that do not have a definition everything will work fine, 
and for those who have, then it's doing the right and expected thing.
But actually, you're right, the line should be completely eliminated, 
and replaced with the following :
typedef unsigned char _Bool;
#define bool _Bool
#define true 1
#define false 0

Btw, there are already a number of fallback definitions in Python.h and 
such. This one is another portability issue, just adding to the others. 
stdbool.h is a standard facility created to help portability, so again, 
why not use it ?

I can post an updated patch if you want.

Do you agree with these changes then?
--Rolland
 __
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue2497
 __


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



[issue2499] Fold unary + and not on constants

2008-03-28 Thread Raymond Hettinger

Raymond Hettinger [EMAIL PROTECTED] added the comment:

It would be helpful if we talked before going further on build-outs to 
the peephole optimizer.  IIRC, we chose to not do this one because it 
interfered with other more important optimizations.

More importantly, we decided that the peepholer is the wrong place to 
do much of this work.  Most of the peepholer is going to be migrated 
up the chain, after the AST is generated, but before the opcodes are 
generated.  That is a faster, more reliable, and more general 
approach. 

The constant folding anti-duplication patch should also not be done 
for this same reason.  That patch slows down compilation and makes it 
more fragile but does not add speed (just like the dead code 
elimination patches).  When the peepholer is moved-up, the anti-
duplication code won't be needed (as you won't need its attendant 
rescan/rewrite pass of the bytecode).

You're writing these faster than I have time to review and likely 
reject them.  Please show some moderation.  The peepholer is 
intentionally very conservative.

--
nosy: +rhettinger

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



[issue2429] Patch for test_urllib2_net moving tests to use a local server

2008-03-28 Thread Gregory P. Smith

Changes by Gregory P. Smith [EMAIL PROTECTED]:


--
assignee:  - gregory.p.smith
nosy: +gregory.p.smith

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



[issue2498] bdb modernized

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Go ahead and commit -- and don't forget the issue number :)

--
assignee: georg.brandl - benjamin.peterson
resolution:  - accepted

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



[issue2429] Patch for test_urllib2_net moving tests to use a local server

2008-03-28 Thread Gregory P. Smith

Gregory P. Smith [EMAIL PROTECTED] added the comment:

committed to trunk in r61998.  time to watch the buildbots, it looked
good to me and passed on my machine.  i'll close it once i see buildbot
test love.

tweaks i made:  I reenabled the commented out ProxyAuth test, as it
works and I assumed that was leftover from your debugging.  I also
changed the URL in the ProxyAuth test to http://localhost just in case
it triggered any network traffic.

--
resolution:  - accepted
status: open - pending

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



[issue2406] Improvement suggestions for the gzip module documentation

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Committed patch in r61999. Thanks!

--
resolution:  - accepted
status: open - closed

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



[issue2426] pysqlite provides no interface for database SQL dump

2008-03-28 Thread Gregory P. Smith

Gregory P. Smith [EMAIL PROTECTED] added the comment:

thanks!

committed to trunk in r62000.

--
priority:  - normal
resolution:  - accepted
status: open - closed

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



[issue2500] Sync _sqlite module code

2008-03-28 Thread Christian Heimes

New submission from Christian Heimes [EMAIL PROTECTED]:

The source code of the _sqlite module in 3.0 is not in sync with the
code from 2.6. Some features and fixes are missing. If I recall
correctly I didn't merge a revision from 2.6 to 3.0 because 2.6a1 and
3.0a3 were released on the same day.

--
assignee: ghaering
components: Extension Modules
messages: 64623
nosy: ghaering, tiran
priority: critical
severity: normal
status: open
title: Sync _sqlite module code
type: feature request
versions: Python 3.0

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



[issue2500] Sync _sqlite module code

2008-03-28 Thread Gerhard Häring

Gerhard Häring [EMAIL PROTECTED] added the comment:

I know. I'll do it this weekend.

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



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-03-28 Thread Mark Summerfield

New submission from Mark Summerfield [EMAIL PROTECTED]:

The tiny program at the end of this message runs under Python 2.5 
30a3. Under 2 it gives the following output:

: python sax.py test.xml
('+', u'document')
('+', u'outer')
('+', u'inner')
('-', u'inner')
('-', u'outer')
('-', u'document')
Done

Under 3 it does not terminate:
: python3 sax.py test.xml
+ document
+ outer
+ inner
- inner
- outer
- document
Traceback (most recent call last):
  File sax.py, line 19, in module
parser.parse(sys.argv[1])
  File /home/mark/opt/python30a3/lib/python3.0/xml/sax/expatreader.py,
line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
  File /home/mark/opt/python30a3/lib/python3.0/xml/sax/xmlreader.py,
line 124, in parse
buffer = file.read(self._bufsize)
  File /home/mark/opt/python30a3/lib/python3.0/io.py, line 774, in read
current = self.raw.read(to_read)
KeyboardInterrupt

The xml.sax.parser() function seems to work fine if you give it an open
file object and close the file after the call. But the documentation
says you can give it a filename, but if you do that the parser does not
terminate in Python 3 although it works fine in Python 2.

# sax.py
import sys
import xml.sax
BUG = True
class SaxHandler(xml.sax.handler.ContentHandler):
def startElement(self, name, attributes):
print(+, name)
def endElement(self, name):
print(-, name)
handler = SaxHandler()
parser = xml.sax.make_parser()
parser.setContentHandler(handler)
if BUG:
parser.parse(sys.argv[1])
else:
fh = open(sys.argv[1], encoding=utf8)
parser.parse(fh)
fh.close()
print(Done)
# end of sax.py

Here is the test file:

?xml version=1.0 encoding=UTF-8?
document
outer
inner
/inner
/outer
/document

--
components: XML
messages: 64625
nosy: mark
severity: normal
status: open
title: xml.sax.parser() doesn't terminate when given a filename
type: behavior
versions: Python 3.0

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



[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-03-28 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

I had to disable three unit tests in test_sax. We didn't noticed the
problem before because the tests weren't actually run. The three tests
are marked clearly with XXX and FIXME.

--
nosy: +tiran
priority:  - critical

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



[issue2502] Add enum() example for named tuples

2008-03-28 Thread Wummel

New submission from Wummel [EMAIL PROTECTED]:

Named tuples can also be used to emulate enum datatypes. The patch adds
an example to the documentation.

--
assignee: georg.brandl
components: Documentation
files: 0001-Add-enum-example-for-named-tuples.patch
keywords: patch
messages: 64627
nosy: calvin, georg.brandl
severity: normal
status: open
title: Add enum() example for named tuples
versions: Python 2.6
Added file: 
http://bugs.python.org/file9881/0001-Add-enum-example-for-named-tuples.patch

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



[issue2503] Replace == None/True/False with is

2008-03-28 Thread Wummel

New submission from Wummel [EMAIL PROTECTED]:

Test equality with None/True/False singletons should be done
by is rather than == to be on the safe side. Otherwise
objects overriding __eq__ could compare equal to one of those
singletons.

--
components: None
files: 0001-Replace-None-True-False-with-is.patch
keywords: patch
messages: 64628
nosy: calvin
severity: normal
status: open
title: Replace == None/True/False with is
versions: Python 2.6
Added file: 
http://bugs.python.org/file9882/0001-Replace-None-True-False-with-is.patch

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



[issue2502] Add enum() example for named tuples

2008-03-28 Thread Wummel

Wummel [EMAIL PROTECTED] added the comment:

The motivation for this patch is that documenting a single function
adding enum-like capabilities would hopefully eliminate the numerous
enum recipies already out there, each handling things a little different.

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



[issue1810] AST compile() patch

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

So I finally got to this one :)
I had to fix a few things, mainly error handling, and a refleak.
And I found a refleak in the compiler :)
Reviewed and committed in r62004.

--
resolution:  - accepted
status: open - closed

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



[issue2503] Replace == None/True/False with is

2008-03-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

You are right of course, but just out of curiosity, do you really have
objects that compare equal to None?

--
nosy: +amaury.forgeotdarc

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



[issue2503] Replace == None/True/False with is

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

I'm in favor of this patch. Not only is is faster here, but it is also
way more idiomatic.

--
nosy: +georg.brandl

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



[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-28 Thread Skip Montanaro

Skip Montanaro [EMAIL PROTECTED] added the comment:

Jean-Philippe You're right, it does seem that using f.read(1024) to
Jean-Philippe feed the sniffer works OK in my case and allows me to
Jean-Philippe instantiate the DictReader correctly...  Why that is I'm
Jean-Philippe not sure though...

It works entirely based on chracter frequencies.  The more characters you
feed it the better it should be at guessing the correct delimiter.  In
particular, it pays attention to the frequency of the possible delimiters
per line and assumes the number of columns is the same for each line.
(Well, there's one place where it does use some knowledge of the structure
of a csv file, so my earlier assertion was incorrect.)  If you only feed it
one line it can't really use that frequency-per-line information.

Jean-Philippe I was submitting the first line as I thought is was the
Jean-Philippe right sample to provide the sniffer for it to sniff the
Jean-Philippe correct dialect regardless of the file format and file
Jean-Philippe content.

That's a good guess, but not quite spot on in this case.  In particular, the
character frequencies in the first line tend to be much different than the
other lines because it usually a row of column headers, while the remainder
of the file (though not always ;-) is a table of numbers.

Skip

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



[issue433030] SRE: (?...) is not supported

2008-03-28 Thread Jeffrey C. Jacobs

Jeffrey C. Jacobs [EMAIL PROTECTED] added the comment:

Fredrik,

If you're still listening, I am gonna try and tackle this one but I 
would like to know why you or the famous Jeffrey of the Regexp world 
claims that there is already code in the Regexp Engine for Atomic 
Grouping?  Adding a hook for (?...) should be trivial but I don't wanna 
re-invent the wheel if the proper stack-unwind code already exists.  
Thanks.  Of course, Andrew (a.k.a. A.M. Kuchling) already asked this 
question and you did not answer it, so I guess you're not reading this, 
but if you are, please respond.  Thanks!


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue433030

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



[issue433030] SRE: Atomic Grouping (?...) is not supported

2008-03-28 Thread Jeffrey C. Jacobs

Changes by Jeffrey C. Jacobs [EMAIL PROTECTED]:


--
title: SRE: (?...) is not supported - SRE: Atomic Grouping (?...) is not 
supported


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue433030

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



[issue2502] Add enum() example for named tuples

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Fixed example (a * was missing) and committed as r62007. Thanks!

--
resolution:  - accepted
status: open - closed

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



[issue2502] Add enum() example for named tuples

2008-03-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

Raymond, is this kind of recipes worth adding to the 'collections' module?

Maybe with the following form:

def enum(*valuenames):
 return namedtuple('Enum', valuenames)(*range(len(valuenames)))

--
nosy: +amaury.forgeotdarc, rhettinger

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



[issue2503] Replace == None/True/False with is

2008-03-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

Yes, PEP8 says::

Comparisons to singletons like None should always be done with
'is' or 'is not', never the equality operators.

Reading the patch:
- a change modifies x == False into not x, another moves some lines.
I checked that they are OK (x is already the result of a comparison).
- some occurrences of x != None are not replaced. Why? (ex. in
test_ast.py)

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



[issue2499] Fold unary + and not on constants

2008-03-28 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

On Fri, Mar 28, 2008 at 3:25 AM, Raymond Hettinger
[EMAIL PROTECTED] wrote:

  It would be helpful if we talked before going further on build-outs to
  the peephole optimizer.

Sure.

  IIRC, we chose to not do this one because it
  interfered with other more important optimizations.

There are two optimization in my patch: one for +const and the other
not const.  I think you recall that not const optimization could
interfere with not a is b --  a is not b and similar transformations.
 My patch, however does not affect those.  With respect to unary +, I
don't think it was intentionally omitted: I would think it is more
common to use unary + on constants than `..`, but case UNARY_CONVERT
is there in 2.x.

Constant folding promotes more readable code: 24*60*60 is more obvious
than 86400, prefixing positive numbers with + leads to better visual
alignment, etc.  Users should not be required to think twice about
which constant expressions are folded and which are not.

Here is another surprise with the current peepholer:

  1   0 LOAD_CONST   0 (1)
  3 LOAD_CONST   3 (6)
  6 BINARY_ADD
  7 RETURN_VALUE

  1   0 LOAD_CONST   4 (7)
  3 RETURN_VALUE

I have a fix in the works, but I will wait for your further comments
before submitting it.


  More importantly, we decided that the peepholer is the wrong place to
  do much of this work.  Most of the peepholer is going to be migrated
  up the chain, after the AST is generated, but before the opcodes are
  generated.  That is a faster, more reliable, and more general
  approach.


I agree.   Constant folding, is an interesting case because peepholer
has to duplicate a subset of eval logic.  I wonder if the new approach
could eliminate that.

BTW, what is the rationale for leading +/- not being part of the
number literal? Unary +/- optimization seems mostly useful for the
simple +/-x case which could be handled by the tokenizer.

What is the timeline for that project?  Maybe a comment should be
placed in peephole.c explaining that there is a plan to move
uptimization logic up the compilation chain and announcing a
moratorium on further peephole.c work.  I am not the only one
submitting peephole optimizer patches recently.

  You're writing these faster than I have time to review and likely
  reject them.  Please show some moderation.

ok :-)   One more peephole optimizer related idea that I have in the
pipeline is to implement an option to disable optimization altogether.
 Having such an option would help debugging/profiling the optimizer
and will give users a simple check when they suspect that their code
is improperly optimized.   I would propose a patch already, but I
could not think of a good command line option.  Most compilers use
-O0, but that would be confusingly similar to -OO.  What do you think?

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



[issue2503] Replace == None/True/False with is

2008-03-28 Thread Wummel

Wummel [EMAIL PROTECTED] added the comment:

Amaury, I never saw an object comparing equal to None.
I think the most likely case is a buggy x.__eq__() implementation. Then
the if x == None statement gets triggered, and somebody has a hard
time with bug hunting.

Just a note: I used an adapted source checker for this patch, which
initially came from the Sphinx documentation project, found under
tools/check_sources.py. So the credits for this go to Georg Brandl.

That is also why '!=' did not get replaced (the source checker only
searched for '=='. I will post an updated patch.

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



[issue2338] Backport reload() moving to imp.reload()

2008-03-28 Thread Collin Winter

Changes by Collin Winter [EMAIL PROTECTED]:


--
components: +2to3 (2.x to 3.0 conversion tool)

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



[issue643841] New class special method lookup change

2008-03-28 Thread John Krukoff

John Krukoff [EMAIL PROTECTED] added the comment:

I was just bit by this today in converting a proxy class from old style
to new style. The official documentation was of no help in discoverting
that neither __getattr__ or __getattribute__ are used to look up magic
attribute names. Even the link to New-style Classes off the
development documentation page is useless, as none of the resources
there (http://www.python.org/doc/newstyle/) mention the incompatible change.

This seems like an issue that is going to come up more frequently as
python 3000 pushes everyone to using only new style classes. It'd be
very useful if whatever conversion tool we get, or the python 3000
standard library includes a proxy class or metaclass that is able to
help with this conversion, such as this one:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252151

Though preferably with some knowledge of all exising magic names.

--
assignee:  - georg.brandl
components: +Documentation -None
nosy: +georg.brandl, jkrukoff
versions: +Python 2.2.1, Python 2.2.2, Python 2.2.3, Python 2.3, Python 2.4, 
Python 2.5, Python 2.6


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue643841

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



[issue815646] thread unsafe file objects cause crash

2008-03-28 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

Another approach would be to add a dedicated lock for each PyFileObject.
This sounds a bit bad performance-wise but after all the GIL itself is a
lock, and we release and re-acquire it on each file operation, so why not?


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue815646

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



[issue2174] xml.sax.xmlreader does not support the InputSource protocol

2008-03-28 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr. [EMAIL PROTECTED] added the comment:

It's certainly arguable that the current behavior is a bug, though I
suspect it shouldn't be considered major since I've not seen any prior
complaints about this.

It should be easy to fix the bug you describe by taking the character
stream and encoding it before feeding it to the XML parser; Expat can
certainly be forced to take a known encoding, ignoring what's in the XML
declaration.

On the other hand, it's not at all clear that changing this is
worthwhile.  This API borrows quite literally from the Java SAX APIs;
perhaps this separation of the character stream from the byte stream
makes sense for some of the Java XML parsers, but I don't know that
there are any Python parsers that benefit from that separation.

--
components:  -Library (Lib), Unicode
priority: normal - low

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



[issue815646] thread unsafe file objects cause crash

2008-03-28 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

On the other hand, surprisingly enough, the flockfile/funlockfile
manpage tells me that:

   The stdio functions are thread-safe.  This is achieved by 
assigning  to  each  FILE
   object  a  lockcount  and  (if the lockcount is nonzero) an
owning thread.  For each
   library call, these functions wait until the FILE object is no
longer  locked  by  a
   different thread, then lock it, do the requested I/O, and unlock
the object again.

This leaves me wondering what is happening in the above-mentioned test.


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue815646

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



[issue1346238] A constant folding optimization pass for the AST

2008-03-28 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

Raymond wrote in his recent response on issue2499 (a patch that adds
unary '+' and 'not' folding to peephole optimizer):


 More importantly, we decided that the peepholer is the wrong place to 
do much of this work.  Most of the peepholer is going to be migrated 
up the chain, after the AST is generated, but before the opcodes are 
generated.  That is a faster, more reliable, and more general 
approach.
 (See msg64618.)

This looks like the relevant patch.  I would like to take a look at the
patch, but since it is more than 2 years old, maybe someone has an
updated version.  Please advise.

--
nosy: +belopolsky
type:  - performance

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



[issue2446] 2to3 translates import foobar to import .foobar rather than from . import foobar

2008-03-28 Thread David Wolever

David Wolever [EMAIL PROTECTED] added the comment:

Can you write a test case proving this?

At the moment, the second thing that the transform function in  
fix_import.py does is return if the import doesn't look like a local  
import (see probably_a_local_import in fix_import).

At the moment, all (with an exception or two) of the import test  
cases test both cases -- the local import exists and the local import  
does not exist -- automatically.

On 28-Mar-08, at 3:04 PM, Collin Winter wrote:


 Collin Winter [EMAIL PROTECTED] added the comment:

 The problem with the fix in r61755 is that it doesn't distinguish
 between stdlib and non-stdlib imports: import os becomes from .
 import os, which is clearly wrong.

 __
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue2446
 __

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



[issue2426] pysqlite provides no interface for database SQL dump

2008-03-28 Thread Gregory P. Smith

Gregory P. Smith [EMAIL PROTECTED] added the comment:

and r62012 which adds the dump.py files I forgot to svn add in r62000.

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



[issue2426] pysqlite provides no interface for database SQL dump

2008-03-28 Thread Gregory P. Smith

Gregory P. Smith [EMAIL PROTECTED] added the comment:

although closed, i'm assigning this to ghaering so that he knows it went
in and can merge this back into pysqlite if its not already in there.

--
assignee: gregory.p.smith - ghaering
nosy: +ghaering

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



[issue2446] 2to3 translates import foobar to import .foobar rather than from . import foobar

2008-03-28 Thread Collin Winter

Collin Winter [EMAIL PROTECTED] added the comment:

Looking at it, I was confused by a quirk introduced into test_fixers:
Test_import's check_both() helper method does the wrong thing in this case:

a = import os
self.check_both(a, a)  # Fails, tries to translate import os into
from . import os

self.unchanged(a) passes, though. What's going on with these methods?

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



[issue2498] bdb modernized

2008-03-28 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Commited with a message in r60218

--
status: open - closed

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



[issue2446] 2to3 translates import foobar to import .foobar rather than from . import foobar

2008-03-28 Thread David Wolever

David Wolever [EMAIL PROTECTED] added the comment:

Ah, yes -- that may be the fault of the confusingly named  
'check_both'.  The both means both when the module in question  
exists and when it does not.  If you've got a better name, please  
change it!
Take a look at the method and you'll see how it works.

The problem is that testing this is a little tricky -- you've either  
got to give it files that you know exist, create files, or work some  
magic.
I took the work some magic route, and replaced the exists method  
which fix_import imports from os (that way the tests can check the  
list of files which are being checked).
See the test_files_checked method for that.

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



[issue815646] thread unsafe file objects cause crash

2008-03-28 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

Why hadn't I read #595601 in detail, it has an explanation: 

[quoting Jeremy Hylton]
The universal newline code is squirrels the FILE * in a
local variable, which is worse.  If it happens that
another thread closes the file, at best the local
points to a closed FILE *.  But that memory could get
recycled and then there's no way to know what it points to.
[/quoting]

Even with careful coding, there's a small window between releasing the
GIL on our side, and acquiring the FILE-specific lock in the glibc,
during which the fclose() function can be invoked and release the FILE
just before we invoke another function (e.g. fseek()) on it.


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue815646

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



[issue2388] Compiler warnings when using UCS4

2008-03-28 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

This is because in UCS, Py_UNICODE is an unsigned long. In calls to
PyErr_Format, the format specifier %c (int, the UCS2 Py_UNICODE) is
given, so the compiler gives a warning.

--
versions:  -Python 3.0

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



[issue1015989] compiler.transformer: correct lineno attribute when possible

2008-03-28 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

This patch was applied at r37285 (in svn terms).  It looks like closing 
this issue  was blocked by #1057835 which was deemed unrelated and 
resolved in any case.

I suggest to close this issue.

--
nosy: +belopolsky
type:  - behavior

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



[issue2426] pysqlite provides no interface for database SQL dump

2008-03-28 Thread Paul Kippes

Paul Kippes [EMAIL PROTECTED] added the comment:

Thanks so much.

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



[issue1015989] compiler.transformer: correct lineno attribute when possible

2008-03-28 Thread Benjamin Peterson

Changes by Benjamin Peterson [EMAIL PROTECTED]:


--
resolution:  - out of date
status: open - closed

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



[issue1546263] Segfaults with concurrent sqlite db access and schema change

2008-03-28 Thread Gerhard Häring

Gerhard Häring [EMAIL PROTECTED] added the comment:

Long fixed in 2.6 and 3.0 branches. Don't think it's worth fixing it in 2.5.

--
resolution:  - wont fix
status: open - closed

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



[issue2497] stdbool support

2008-03-28 Thread Martin v. Löwis

Martin v. Löwis [EMAIL PROTECTED] added the comment:

 If stdbool is not available, C99 still defines false and true as macros.

What do you mean by that? In C99, true and false are *not* defined in
a translation unit unless stdbool.h is included, see 7.16.

 If stdbool is available, then most compilers will define false and true 
 as macros.

*In* the header file, that is. C99 *requires* the implementation to
define true and false *only* in the header file, and *only* as
macros. Anything else would not be conforming to C99.

 In both cases, if stdbool was included by any system header in the 
 future, that would conflict with your current definition.

No system header should ever include stdbool.h; doing so would be
in violation of the standards.

 Do you agree with these changes then?

Not at all; I think the patch should be rejected.

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



[issue1731717] race condition in subprocess module

2008-03-28 Thread Robert Siemer

Robert Siemer [EMAIL PROTECTED] added the comment:

Bad design stays bad design: the hope that pids don't get reused soon
breaks two assumptions:
1) I don't have to wait() for a child process soon. It's the programs
business.
2) Pids cycle: there are security patches to make pids of future
processes hard to predict by assigning random free pids.

I actually was about to report a bug on subprocess when I bumped into
this one. My problem is pretty thread-less but related:
How do I kill() a process if it's pid got recycled behind my back??

In my opinion the module should work the Python way of doing things,
otherwise programmers will be surprised, as I was:
a) don't do my work (no wait() for things I care of/have reference to)
b) do your work (clean up things I don't care of/have no reference to)

If that's not possible, how does subprocess actually intends to replace
os.spawn*? [Library Reference]

It is still possible to extend the Popen() call to reflect if the caller
wants a P_NOWAITO or P_NOWAIT behavior, but the closer we get to the os,
the less sense does it make to replace some other modules...

--
nosy: +siemer

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



[issue815646] thread unsafe file objects cause crash

2008-03-28 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

Some good news: I've found a way to continue with my approach and make
it working. The close() method now raises an appropriate IOError when
another method is being called from another thread. Attaching a patch,
which protects a bunch of file object methods (together with tests). 

Now the bad news: the protection logic in fileobject.c is, hmm, a bit
contrived (and I'm not even sure it's 100% correct). If someone wants to
read it and put his veto before I go further...

Added file: http://bugs.python.org/file9884/filethread2.patch


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue815646

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



[issue595601] file ( socket) I/O are not thread safe

2008-03-28 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

I've posted a preliminary patch for the close()-should-raise-an-error
approach here: #815646

--
nosy: +pitrou


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue595601

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



[issue1919] Backport of io.py

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

The bytearray branch has been merged.

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

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



[issue1751] Fast BytesIO implementation + misc changes

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Bumping priority so that this gets reviewed before next release.

--
nosy: +georg.brandl
priority: normal - critical

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



[issue1745] Backport of PEP 3102 keyword-only arguments to 2.6

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Bumping priority.

--
keywords: +26backport
priority: normal - critical

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



[issue2327] Backport keyword-only arguments to 2.6

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

#1745 already has a patch.

--
nosy: +georg.brandl
resolution:  - duplicate
superseder:  - Backport of PEP 3102 keyword-only arguments to 2.6

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



[issue2327] Backport keyword-only arguments to 2.6

2008-03-28 Thread Georg Brandl

Changes by Georg Brandl [EMAIL PROTECTED]:


--
status: open - closed

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



[issue815646] thread unsafe file objects cause crash

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Closed #595601 as a duplicate.

--
nosy: +georg.brandl


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue815646

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



[issue595601] file ( socket) I/O are not thread safe

2008-03-28 Thread Georg Brandl

Changes by Georg Brandl [EMAIL PROTECTED]:


--
resolution:  - duplicate
status: open - closed
superseder:  - thread unsafe file objects cause crash


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue595601

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



[issue1717] Get rid of more refercenes to __cmp__

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Bumping priority.

--
nosy: +georg.brandl
priority: normal - critical

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



[issue1625205] sqlite3 documentation omits: close(), commit(), autocommit

2008-03-28 Thread Gerhard Häring

Gerhard Häring [EMAIL PROTECTED] added the comment:

Fixed in r62026. Thanks for bringing this up.

--
resolution:  - fixed
status: open - closed

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



[issue2500] Sync _sqlite module code

2008-03-28 Thread Gerhard Häring

Gerhard Häring [EMAIL PROTECTED] added the comment:

done. the py3k branch is now up-to-date wrt to the sqlite3 module.

--
resolution:  - fixed
status: open - closed

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



[issue1158] %f format for datetime objects

2008-03-28 Thread Georg Brandl

Changes by Georg Brandl [EMAIL PROTECTED]:


--
resolution:  - accepted
status: open - closed

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



[issue2430] Stop test_format.py from executing as side effect of import

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

This seems to have been committed in r61925.

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

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



[issue2479] Bytearray and io backport

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

The branch has been merged in r61936.

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

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



[issue1967] Backport dictviews to 2.6

2008-03-28 Thread Georg Brandl

Changes by Georg Brandl [EMAIL PROTECTED]:


--
keywords: +26backport

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



[issue1967] Backport dictviews to 2.6

2008-03-28 Thread Georg Brandl

Changes by Georg Brandl [EMAIL PROTECTED]:


--
priority: normal - critical

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



[issue1442] pythonstartup addition of minor error checking

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Backported to 2.6 in r62030 and 2.5 in r62031.

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

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



[issue2310] Reorganize the 3.0 Misc/NEWS file

2008-03-28 Thread Georg Brandl

Changes by Georg Brandl [EMAIL PROTECTED]:


--
assignee: georg.brandl - gvanrossum

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



[issue2504] Add gettext.pgettext() and variants support

2008-03-28 Thread Pierre Metras

New submission from Pierre Metras [EMAIL PROTECTED]:

Please add support for pgettext(msgctxt, msgid) and variants (dpgettext,
dcpgettext...) in the gettext module.

I will not rephrase the justification for these functions and why
contexts are essential for good localization:
http://www.gnu.org/software/gettext/manual/gettext.html#Contexts

--
components: Extension Modules
messages: 64675
nosy: genepi
severity: normal
status: open
title: Add gettext.pgettext() and variants support
type: feature request
versions: Python 2.6, Python 3.0

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



[issue965065] document docs.python.org in PEP-101

2008-03-28 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Leaving open as a reminder for coming rstdocs releases.

--
priority: normal - high


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue965065

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



[issue2176] Undocumented lastrowid attribute i sqlite3 cursor class

2008-03-28 Thread Georg Brandl

Changes by Georg Brandl [EMAIL PROTECTED]:


--
priority:  - high

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



[issue2129] Link error of gethostbyaddr and gethostname in Python Manuals (the chm file)

2008-03-28 Thread Georg Brandl

Changes by Georg Brandl [EMAIL PROTECTED]:


--
status: open - pending

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2129
__
___
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-03-28 Thread Georg Brandl

Changes by Georg Brandl [EMAIL PROTECTED]:


--
assignee:  - georg.brandl
nosy: +georg.brandl

__
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



[issue2464] urllib2 can't handle http://www.wikispaces.com

2008-03-28 Thread Gregory P. Smith

Gregory P. Smith [EMAIL PROTECTED] added the comment:

Instrumenting the code and looking closer at the tcpdump, its true. 
wikispaces.com is returning an invalid Location: header with a null byte
in the middle of it.

The fix on our end should be to handle such garbage from such broken
web servers more gracefully.  Other clients seem to treat the null as an
end of string or end of that header.

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



[issue2464] urllib2 can't handle http://www.wikispaces.com

2008-03-28 Thread Gregory P. Smith

Gregory P. Smith [EMAIL PROTECTED] added the comment:

I'm not sure what the best solution for this is.  If I truncate the
header values at a \x00 character it ends in an infinite redirect loop
(which urllib2 detects and raises on).  If I simple remove all \x00
characters the resulting url is not accepted by wikispaces.com due to
having an extra / in it.

Verdict: wikispaces.com is broken.

urllib2 could do better.  wget and firefox deal with it properly.  but
i'll leave deciding which patch to use up to someone who cares about
handling broken sites.

patch to implement either behavior of dealing with nulls where they
shouldn't be:

Index: Lib/httplib.py
===
--- Lib/httplib.py  (revision 62033)
+++ Lib/httplib.py  (working copy)
@@ -291,9 +291,18 @@
 break
 headerseen = self.isheader(line)
 if headerseen:
+# Some bad web servers reply with headers with a \x00 null
+# embedded in the value.  Other http clients deal with
+# this by treating it as a value terminator, ignoring the
+# rest so we will too.  http://bugs.python.org/issue2464.
+if '\x00' in line:
+line = line[:line.find('\x00')]
+# if you want to just remove nulls instead use this:
+#line = line.replace('\x00', '')
 # It's a legal header line, save it.
 hlist.append(line)
-self.addheader(headerseen,
line[len(headerseen)+1:].strip())
+value = line[len(headerseen)+1:].strip()
+self.addheader(headerseen, value)
 continue
 else:
 # It's not a header line; throw it back and stop here.

--
assignee: gregory.p.smith - 
priority: normal - low

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



[issue2429] Patch for test_urllib2_net moving tests to use a local server

2008-03-28 Thread Gregory P. Smith

Gregory P. Smith [EMAIL PROTECTED] added the comment:

all buildbots seem happy with the new tests.

--
status: pending - closed

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



[issue1179] [CVE-2007-4965] Integer overflow in imageop module

2008-03-28 Thread David Remahl

David Remahl [EMAIL PROTECTED] added the comment:

The following test cases still cause bus errors with the patch applied:

import imageop; imageop.rgb82rgb('A'*(2**30), 32768, 32768)
import imageop; imageop.grey2rgb('A'*(2**30), 32768, 32768)

--
nosy: +chmod007

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



[issue2477] parser support for future import of unicode_strings

2008-03-28 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Christian checked this in a few days ago in r61953 and a few other
revisions.

--
resolution:  - accepted
status: open - closed

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