[issue4615] de-duping function in itertools

2008-12-18 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

My inclination is to not include this as a basic C coded itertool
because it holds potentially all of the data in memory (generally, not a
characteristic of an itertool) and because I don't see it as a basic
building block (itertools are intended to be elemental, composable
components of an iterator algebra).  Also, the pure python equivalent of
dedup() is both easy to write and runs efficiently (it gains little from
being recoded in C).

Instead, I'm think of adding two recipes to the itertools docs:

def unique_everseen(iterable, key=None):
# unique_everseen('BBBCCDAABBB') --> A B C D
# unique_everseen('ABBCcAD', str.lower) --> A B C D
seen = set()
seen_add = seen.add
if key is None:
for elem in iterable:
if elem not in seen:
seen_add(elem)
yield elem
else:
for elem in iterable:
k = key(elem)
if k not in seen:
seen_add(k)
yield elem

def unique_lastseen(iterable, key=None):
# unique_lastseen('BBBCCDAABBB') --> A B C D A B
# unique_lastseen('ABBCcAD', str.lower) --> A B C A D
return imap(next, imap(itemgetter(1), groupby(iterable, key)))

___
Python tracker 

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



[issue4692] Framework build fails if OS X on case-sensitive file system

2008-12-18 Thread Ned Deily

New submission from Ned Deily :

In the main python Makefile.pre.in, the frameworkinstallextras target, 
only used on OS X, has a bogus "Make" command instead of "$(MAKE)" as in 
other targets.  Traditionally and by default, the OS X root file system is 
case-insensitive, in which case "Make" coincidentally does invoke 
/usr/bin/make.  However, with OS X installed on a case-sensitive fs, the 
command fails.  One-liner patch attached.

--
components: Build
files: makefile-make.diff
keywords: patch
messages: 78016
nosy: nad
severity: normal
status: open
title: Framework build fails if OS X on case-sensitive file system
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file12393/makefile-make.diff

___
Python tracker 

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



[issue4688] GC optimization: don't track simple tuples and dicts

2008-12-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le jeudi 18 décembre 2008 à 06:12 +, Martin v. Löwis a écrit :
> I think this approach is difficult to maintain, and also may miss some
> objects.

But what counts is where tuples can be created in massive numbers or
sizes: the eval loop, the tuple type's tp_new, and a couple of other
places. We don't need to optimize every single tuple created by the
interpreter or extension modules (and even the, one can simply call
_PyTuple_Optimize()).

> I'd rather see that integrated into collection: e.g. when iterating over
> survivors of a collection, check whether they can be untracked.

That's what I had tried at first, but it crashes. I haven't
investigated, but I suspect removing an object from the GC list while
that list is being walked isn't very well supported by the GC.

Also, this approach is more expensive since it involves checking tuples
again and again each time they are walked by the GC. The patch only does
it once, when the tuple is being built.

___
Python tracker 

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



[issue4688] GC optimization: don't track simple tuples and dicts

2008-12-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> > I'd rather see that integrated into collection: e.g. when iterating over
> > survivors of a collection, check whether they can be untracked.
> 
> That's what I had tried at first, but it crashes.

To be clearer, I tried adding it to the tp_traverse method of tuples. I
could try to add it to the collection machinery in gcmodule.c instead.

___
Python tracker 

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



[issue2183] optimize list comprehensions

2008-12-18 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Recommend having both MAP_ADD and STORE_MAP.  The latter is repeated
often in a typical dict literal so it needs to be compact and fast.  The
former needs the flexibility of the offset argument to be workable in a
dict comprehension.  I also like that MAP_ADD eliminates the need for
the awkward ROT_TWO stack re-arrangement.  Also, MAP_ADD can include a
PREDICT(JUMP_ABSOLUTE) for a further speed-up.  All in all, this is a
nice clean-up and speed-up that more than justifies a second opcode.

--
assignee: rhettinger -> pitrou

___
Python tracker 

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



[issue4691] IDLE Code Caching Windows

2008-12-18 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

You are using IDLE with the "-n" option, so the same interpreter session
is reused each time you hit F5.

The second run works because the Struct from the first run is still
present - but disappears of course when you restart IDLE.

It's not really caching, but normal manipulation of variables, just like
"a = 5" followed by "print a" works because 'a' is saved in-between.

I suggest to remove this "-n" option, a fresh interpreter is started
each time you press F5, and errors appear sooner...

--
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue4688] GC optimization: don't track simple tuples and dicts

2008-12-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is an alternate patch which does the tuple optimization in the GC.
I don't like it a lot, first because it puts some type-specific code in
gcmodule, second because it invalidates the dict optimization (since
tuples are untracked only when walked by the GC, they are still tracked
when added to a dict and therefore the dict will be tracked too).

Added file: http://bugs.python.org/file12394/dictopts2.patch

___
Python tracker 

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



[issue4688] GC optimization: don't track simple tuples and dicts

2008-12-18 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file12394/dictopts2.patch

___
Python tracker 

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



[issue4688] GC optimization: don't track simple tuples and dicts

2008-12-18 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file12395/tupleopts-alt.patch

___
Python tracker 

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



[issue4688] GC optimization: don't track simple tuples and dicts

2008-12-18 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file12395/tupleopts-alt.patch

___
Python tracker 

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



[issue4688] GC optimization: don't track simple tuples and dicts

2008-12-18 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file12396/tupleopts-alt.patch

___
Python tracker 

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



[issue4685] IDLE will not open (2.6.1 on WinXP pro)

2008-12-18 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Can you start it from a command prompt (cmd.exe):

> cd c:\python26
> python Lib\idlelib\idle.py

The console may display interesting error messages.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue2183] optimize list comprehensions

2008-12-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Committed to py3k in r67839.

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



[issue4688] GC optimization: don't track simple tuples and dicts

2008-12-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch which combines the alternate approach (untrack simple
objects when doing a GC collection) for tuples and dicts.
I'm surprised by the results: after a full regression test suite, there
are roughly 55000 tracked objects (measured with len(gc.get_objects()))
while there are 15 of them with the original interpreter.

Some eyes are welcome.

Added file: http://bugs.python.org/file12397/tuple+dictopts-alt.patch

___
Python tracker 

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



[issue4621] zipfile returns string but expects binary

2008-12-18 Thread Eddie

Eddie  added the comment:

Sorry, my bad.
I did tried it but with the wrong version (2.5). And it worked perfectly.

So sorry again for my mistake.

Anyways, I've found the error.

The problem is caused by different encodings used when zipping.

In open, the method is comparing b't\x82st.xml' against
b't\xc3\xa9st.xml', and of course they are different.
But they are no so different, because b't\x82st.xml' is
'tést'.encode('cp437') and b't\xc3\xa9st.xml' is 'tést'.encode(utf-8).

The problem arises because the open method supposes the filename is in
utf-8 encoding, but in __init__ it realizes that the encoding depends on
the flags. 
if flags & 0x800:
filename = filename.decode.('utf-8')
else:
filename = filename.decode.('cp437')

___
Python tracker 

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



[issue4690] asyncore calls handle_write() on closed sockets when use_poll=True

2008-12-18 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola, josiah.carlson

___
Python tracker 

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



[issue4683] urllib2.HTTPDigestAuthHandler fails on third hostname?

2008-12-18 Thread Daniel Diniz

Daniel Diniz  added the comment:

Chris,
Is there a chance that this is some sort of protection on LJ's side?
Does a given instance mean the same connection being reused? What
happens with longer sleeps?

--
nosy: +ajaksu2

___
Python tracker 

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



[issue4217] Add file comparisons to the unittest library

2008-12-18 Thread Senthil

Changes by Senthil :


--
nosy: +orsenthil

___
Python tracker 

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



[issue4683] urllib2.HTTPDigestAuthHandler fails on third hostname?

2008-12-18 Thread Chris Boyle

Chris Boyle  added the comment:

When I say a given instance, I mean an HTTPDigestAuthHandler object. If
I take the three lines before my loop (authhandler=, opener=,
install_opener) and move them into the loop, the problem goes away,
whereas moving only the latter two of those doesn't help. So, creating a
new HTTPDigestAuthHandler each time fixes the problem, where surely it
shouldn't make any difference? Also, I've tried sleeps of 30 seconds,
with the same results (reuse handler -> fail on the 3rd request, new
handler each time -> works for all requests).

___
Python tracker 

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



[issue4683] urllib2.HTTPDigestAuthHandler fails on third hostname?

2008-12-18 Thread Daniel Diniz

Daniel Diniz  added the comment:

Hmm, notice that AbstractDigestAuthHandler handles retries: 

class AbstractDigestAuthHandler:
def __init__(self, passwd=None):
...
self.retried = 0
...
def reset_retry_count(self):
self.retried = 0

def http_error_auth_reqed(self, auth_header, host, req, headers):
authreq = headers.get(auth_header, None)
if self.retried > 5:
# Don't fail endlessly - if we failed once, we'll probably
# fail a second time. Hm. Unless the Password Manager is
# prompting for the information. Crap. This isn't great
# but it's better than the current 'repeat until recursion
# depth exceeded' approach 
raise HTTPError(req.get_full_url(), 401, "digest auth failed",
headers, None)
else:
self.retried += 1
if authreq:
scheme = authreq.split()[0]
if scheme.lower() == 'digest':
return self.retry_http_digest_auth(req, authreq)


The fact that your password manager is queried six times suggests you're
seeing the "if self.retried > 5:" above. 


Could you make a local copy of /usr/lib/python2.5/urllib2.py
 and add some prints (specially around get_authorization) to see what is
going on?

___
Python tracker 

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



[issue4615] de-duping function in itertools

2008-12-18 Thread David W. Lambert

David W. Lambert  added the comment:

(but of course with imap in version 2.7 and with something else in
version 3.x)

--
nosy: +LambertDW

___
Python tracker 

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



[issue4693] Idle for Python 3.0 is default even without doing make fullinstall

2008-12-18 Thread Senthil

New submission from Senthil :

I am not sure, if this is intentional. But if you look at Python 3k and
3.1 installation.

changing mode of /usr/local/bin/pydoc to 755
changing mode of /usr/local/bin/idle to 755
changing mode of /usr/local/bin/2to3 to 755
changing mode of /usr/local/bin/smtpd.py to 755
running install_egg_info
* Note: not installed as 'python'.
* Use 'make fullinstall' to install as 'python'.
* However, 'make fullinstall' is discouraged,
* as it will clobber your Python 2.x installation.
o...@goofy:~/python/py3k$ 

pydoc, idle, 2to3 and smtp.py by default are Py3k's.
Where as python is Py2.x's.

Do you see the difference when one wants to try out python prompt.
- If he types python in the console, he would be greeted by 2.x
- If he types idle, he would be greeted by 3k.

pydoc may cause similar confusion too.
2to3 is okay because it is to be used by 3k,
Not sure about smtp.py

Do you agree this as an issue and if so, how do we address it?
- label idle as idle3.0 and pydoc as pydoc3.0 and make it default with
make fullinstall ?

--
components: IDLE
messages: 78030
nosy: orsenthil
severity: normal
status: open
title: Idle for Python 3.0 is default even without doing make fullinstall
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue4685] IDLE will not open (2.6.1 on WinXP pro)

2008-12-18 Thread Ilan

Ilan  added the comment:

It didn't work.

"cd c:\python26" successfully prompted "C:\Python26>",

But then entering "python Lib\idlelib\idle.py" did not work, the message
is too long to enter in this reply but here are some of the lines in the
body:

"Unhandled server exception!
Thread: SockThread"
[...]
"ImportError: cannot import name Random
*** Unrecoverable, server existing!"
[...]
"EOFError"

I hope this helps, I have no clue what to do...

___
Python tracker 

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



[issue4583] segfault when mutating memoryview to array.array when array is resized

2008-12-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Fixed in r67840. No need to backport to 2.x since the array object there
doesn't support the new buffer protocol.

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



[issue1068268] subprocess is not EINTR-safe

2008-12-18 Thread Matteo Bertini

Matteo Bertini  added the comment:

Python 2.5.3 is near but the I think the fix in
http://svn.python.org/view?rev=65475&view=rev
is not enough, there are a lot of other places where EINTR can cause and 
error.

--
versions: +Python 2.5.3

___
Python tracker 

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



[issue1068268] subprocess is not EINTR-safe

2008-12-18 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue4017] Tkinter cannot find Tcl/Tk on Mac OS X

2008-12-18 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I've uploaded a .dmg for 2.6.1 to
http://www.python.org/ftp/python/2.6.1/. Could you please test it?

___
Python tracker 

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



[issue3860] GzipFile and BZ2File should support context manager protocol

2008-12-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch for the trunk. I'm waiting for the opinion other
developers before deciding to commit or no.

--
keywords: +patch
nosy: +pitrou
stage:  -> patch review
Added file: http://bugs.python.org/file12398/withgzip.patch

___
Python tracker 

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



[issue4017] Tkinter cannot find Tcl/Tk on Mac OS X

2008-12-18 Thread Joachim Strombergson

Joachim Strombergson  added the comment:

I downloaded the newly built 2.6.1 dmg and can confirm that, at least
for me:

(1) import Tkinter works.
(2) Starting IDLE works.

It looks like we have a winner, good job Benjamin!

___
Python tracker 

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



[issue3860] GzipFile and BZ2File should support context manager protocol

2008-12-18 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Here's the StringIO discussion: #1286

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue4694] _call_method() in multiprocessing documentation

2008-12-18 Thread David M. Beazley

New submission from David M. Beazley :

The documentation for "Proxy Objects" in the multiprocessing module 
describes a method "_call_method" and gives various examples.   The only 
problem is that the method is actually called "_callmethod" (i.e., no 
underscore between "call" and "method").

--
assignee: georg.brandl
components: Documentation
messages: 78038
nosy: beazley, georg.brandl
severity: normal
status: open
title: _call_method() in multiprocessing documentation
type: behavior
versions: Python 2.6, Python 3.0

___
Python tracker 

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



[issue4694] _call_method() in multiprocessing documentation

2008-12-18 Thread David M. Beazley

David M. Beazley  added the comment:

The _get_value() method is also in error.  It's called "_getvalue()" in 
the source code.

___
Python tracker 

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



[issue4692] Framework build fails if OS X on case-sensitive file system

2008-12-18 Thread Mark Dickinson

Mark Dickinson  added the comment:

Fixed in r67844 (trunk), r67845 (2.6), r67846 (py3k) and r67847 (3.0).
Thanks for the report and patch!

--
nosy: +marketdickinson
resolution:  -> fixed
status: open -> closed
versions: +Python 2.7, Python 3.1

___
Python tracker 

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



[issue4695] Bad AF_PIPE address in multiprocessing documentation

2008-12-18 Thread David M. Beazley

New submission from David M. Beazley :

In the "Address Formats" part of the "Listeners and Clients" section of 
the documentation for the multiprocessing module, AF_PIPE addresses are 
described as having this format:

r'ServerName\\pipe\\PipeName'

However, it is really this:

r'\\ServerName\pipe\PipeName'

Be careful with raw strings.  The documentation is showing the output of 
repr(), not a properly formed raw string. 

I verified this fix on Windows XP.

--
assignee: georg.brandl
components: Documentation
messages: 78041
nosy: beazley, georg.brandl
severity: normal
status: open
title: Bad AF_PIPE address in multiprocessing documentation
versions: Python 2.6, Python 3.0

___
Python tracker 

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



[issue4696] email module does not fold headers

2008-12-18 Thread Ben Artin

New submission from Ben Artin :

RFC 2822 allows for certain headers to be spread across multiple lines 
(section 2.2.3). In particular, subject, comments, and keywords headers 
behave this way (section 3.6.5). 

I think the email module should unfold such headers. See attached patch.

--
components: Library (Lib)
files: feedparser.diff
keywords: patch
messages: 78042
nosy: bromine
severity: normal
status: open
title: email module does not fold headers
type: behavior
versions: Python 2.5.3, Python 2.6
Added file: http://bugs.python.org/file12399/feedparser.diff

___
Python tracker 

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



[issue4683] urllib2.HTTPDigestAuthHandler fails on third hostname?

2008-12-18 Thread Dan

Dan  added the comment:

Reasonable idea, Daniel, but changing self.retried makes no difference.
What does solve Chris' problem (which I can reproduce, btw) is
preventing the nonce_count from incrementing.

i.e. comment out the line :
 self.nonce_count += 1
in AbstractDigestAuthHandler.get_authorization

This makes me wonder if all this is being caused by LJ, intentionally or
not, rejecting repeated requests.

--
nosy: +danohuiginn

___
Python tracker 

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



[issue4697] Clarification needed for subprocess convenience functions in Python 3.0 documentation

2008-12-18 Thread Erik Sternerson

New submission from Erik Sternerson :

There are two new convenience functions in the subprocess module since
Python 3.0, getstatusoutput and getoutput. These are UNIX ONLY functions
(as per note "# NB This only works (and is only relevant) for UNIX." in
subprocess.py)

I believe the documentation page
http://docs.python.org/3.0/library/subprocess.html does not reflect this
sufficiently (not sure it does at all).

I suggest a note should be added saying "Availability: UNIX" to the two
functions mentioned.

--
assignee: georg.brandl
components: Documentation
messages: 78044
nosy: Erik Sternerson, georg.brandl
severity: normal
status: open
title: Clarification needed for subprocess convenience functions in Python 3.0 
documentation
versions: Python 3.0

___
Python tracker 

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



[issue4698] Solaris buildbot failure on trunk in test_hostshot

2008-12-18 Thread Antoine Pitrou

New submission from Antoine Pitrou :

The Solaris buildbot seems to fail deterministically on trunk with the
following message.

==
FAIL: test_logreader_eof_error (test.test_hotshot.HotShotTestCase)
--
Traceback (most recent call last):
  File
"/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_hotshot.py",
line 130, in test_logreader_eof_error
self.assertRaises((IOError, EOFError), _hotshot.logreader, ".")
AssertionError: (, ) not raised

--

(see e.g.
http://www.python.org/dev/buildbot/trunk.stable/sparc%20solaris10%20gcc%20trunk/builds/61/step-test/0
)

--
components: Extension Modules
messages: 78045
nosy: amaury.forgeotdarc, pitrou
priority: normal
severity: normal
status: open
title: Solaris buildbot failure on trunk in test_hostshot
type: behavior
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



[issue3860] GzipFile and BZ2File should support context manager protocol

2008-12-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks. The outcome of the StringIO discussion isn't clearly negative,
although Guido does not see a big benefit in it. If some people are
opposed to this, please stand up :) Otherwise I'll commit the patch to
trunk.

___
Python tracker 

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



[issue4683] urllib2.HTTPDigestAuthHandler fails on third hostname?

2008-12-18 Thread Dan

Dan  added the comment:

Actually, this does look more like an urllib2 bug.
According to RFC 2617, the nonce count should represent the number of
requests sent with a particular nonce. But we don't reset the nonce
count when we start using a new nonce. That discrepancy in nonce counts
causes LJ to reject the connection.

Why does it fail the third time, rather than the second? See the LJ code
from http://code.sixapart.com/svn/livejournal/trunk/cgi-bin/ljlib.pl
(which I *think* applies here, but could easily be wrong):
# check the nonce count
# be lenient, allowing for error of magnitude 1

___
Python tracker 

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



[issue4688] GC optimization: don't track simple tuples and dicts

2008-12-18 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> But what counts is where tuples can be created in massive numbers or
> sizes: the eval loop, the tuple type's tp_new, and a couple of other
> places. We don't need to optimize every single tuple created by the
> interpreter or extension modules (and even the, one can simply call
> _PyTuple_Optimize()).

Still, I think this patch does too much code duplication. There should
be only a single function that does the optional untracking; this then
gets called from multiple places.

> Also, this approach is more expensive

I'm skeptical. It could well be *less* expensive, namely if many tuples
get deleted before gc even happens. Then you currently check whether you
can untrack them, which is pointless if the tuple gets deallocated
quickly, anyway.

___
Python tracker 

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



[issue4688] GC optimization: don't track simple tuples and dicts

2008-12-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hello again,

> Still, I think this patch does too much code duplication. There should
> be only a single function that does the optional untracking; this then
> gets called from multiple places.

The point was to avoid slowing down the critical path of tuple creation
in the most common cases. If it is considered too hackish, then I agree
the other patch (tuple+dictopts-alt.patch) should be considered instead.

By the way, perhaps pybench should grow a GC test (e.g. derived from
Greg's script). What do you think?

___
Python tracker 

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



[issue4699] Typo in documentation of "signal"

2008-12-18 Thread Kurt Mueller

New submission from Kurt Mueller :

in documentation of "signal"
http://docs.python.org/library/signal.html
-
signal.SIG_DFL
This is one of two standard signal handling options; it will simply 
perform the default function for the signal. For example, on most 
systems the default action for SIGQUIT is to dump core and exit, while 
the default action for SIGCLD is to simply ignore it.
-
Typo:
SIGCLD
should be
SIGCHLD

--
assignee: georg.brandl
components: Documentation
messages: 78050
nosy: georg.brandl, yam850
severity: normal
status: open
title: Typo in documentation of "signal"
versions: Python 2.6

___
Python tracker 

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



[issue4017] Tkinter cannot find Tcl/Tk on Mac OS X

2008-12-18 Thread Don Braffitt

Don Braffitt  added the comment:

>I've uploaded a .dmg for 2.6.1 to
>http://www.python.org/ftp/python/2.6.1/. Could you please test it?

I installed the 2.6.1 .dmg on Mac OS X 10.5.5, and IDLE once again works
fine.

- Don

___
Python tracker 

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



[issue4699] Typo in documentation of "signal"

2008-12-18 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Thanks for the report! Fixed in r67848.

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



[issue4694] _call_method() in multiprocessing documentation

2008-12-18 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Thanks for the report! Fixed in r67849.

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



[issue4653] Patch to fix typos for Py3K

2008-12-18 Thread Johnny Lee

Johnny Lee  added the comment:

> It's difficult to really test such errors.

When I can't control the called function, I usually step through the 
code in a debugger and change the result variable in question to the 
appropriate value to see if the code handles failed function calls 
correctly. 

In the three Win32 API cases, it's clear that the failure path was not 
tested.

And I can't see how the ferr if statement was tested with a failure 
value either.

___
Python tracker 

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