[issue3943] IDLE won't start in 3.0rc1 Subprocess didn't make connection....

2008-09-25 Thread Amaury Forgeot d'Arc

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

Did you *really* follow the suggested change proposed in #3905 ?
http://bugs.python.org/msg73496

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



[issue3936] Faulty suppression of 'as' keyword warning

2008-09-25 Thread Amaury Forgeot d'Arc

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

Patch is good to me.

Actually 2.5 is not in Release Candidate stage, do we really need
formal review?

--
keywords:  -needs review

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



[issue3944] faster long multiplication

2008-09-25 Thread Mark Dickinson

Mark Dickinson [EMAIL PROTECTED] added the comment:

Thanks for the updated patch!  Looks good, on a quick scan.

(One comment typo I noticed: there's a line
BASE - 3 = 2*MASK - 1
presumably this should be 2*BASE - 3 on the LHS.)

Just out of interest, is it possible to go further, and combine 4
partial multiplications at once instead of 2?  Or does the extra
bookkeeping involved make it not worth it?

I think it's important to make sure that any changes to longobject.c
don't slow down operations on small integers (where small means less
than 2**32) noticeably.

Re: possible changes to PyLong_SHIFT

Yes, changing PyLong_SHIFT to 16 (or 32) would be complicated, and would
involve almost a complete rewrite of longobject.c, together with much
else...  It wasn't really a serious suggestion, but it probably would
provide a speedup.  The code in GMP gives some idea how things might work.

Changing PyLong_SHIFT to 30 doesn't seem like a totally ridiculous idea,
though.  One problem is that there's no 64-bit integer type (for
twodigits) in *standard* C89;  so since Python is only allowed to assume
C89 there would have to be some fallback code for those (very few,
surely) platforms that didn't have a 64-bit integer type available.

On 64-bit machines one could presumably go further, and have
PyLong_SHIFT be 60 (or 62, or 63 --- but those break the assumption
in long_pow that the PyLong_SHIFT is a multiple of 5).  This would
depend on the compiler providing a 128-bit type for twodigits (like
__uint128_t on gcc/x86-64).  Probably not worth it, especially if it
ends up slowing down operations on everyday small integers.

Any of these changes is also going to affect a good few other parts of
the codebase (e.g. marshal, pickle?, struct?, floatobject.c, ...).  It
shouldn't be difficult to find most of the files affected (just look to
see which files include longintrepr.h), but I have a suspicion there are
a couple of other places that just assume PyLong_SHIFT is 15).

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



[issue3826] BaseHTTPRequestHandler depends on GC to close connections

2008-09-25 Thread romkyns

romkyns [EMAIL PROTECTED] added the comment:

So the GC behaviour in this case is such that Python 3.0 can't collect
the object whereas Python 2.6 can. Is this known / expected or should
this be recorded in a separate issue?

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



[issue3783] dbm.sqlite proof of concept

2008-09-25 Thread Erno Kuusela

Erno Kuusela [EMAIL PROTECTED] added the comment:

I'm looking for a bsddb-shelve replacement (because of we bsddb
corruption problems), and decided to give this a try. Don't overlook
the free locking you get from sqlite when evaluating this for inclusion!

A small bug:

 from sq_dict import shelve
 shelve('zz', 'c')[42] = 2
Traceback (most recent call last):
  File stdin, line 1, in module
  File sq_dict.py, line 144, in __setitem__
key = self._check_key(key)
  File sq_dict.py, line 287, in _check_key
(, .join(i.__name__ for i in self._allowed_keys), type(key)))
NameError: global name 'self' is not defined

--
nosy: +erno

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



[issue3946] PyObject_CheckReadBuffer crashes on memoryview object

2008-09-25 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

The test would be better in test_memoryview rather than in test_builtin.

--
nosy: +pitrou

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



[issue3826] BaseHTTPRequestHandler depends on GC to close connections

2008-09-25 Thread Amaury Forgeot d'Arc

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

The garbage collector does collect unreachable objects.

What happens is that with python 2, the socket is explicitly closed by
the HTTPServer, whereas with python 3, the explicit close() does not
work, and the socket is ultimately closed when the request has finished
and all objects are disposed.

The cause is in the socket.makefile() function: since python3, the
underlying socket uses a reference count, so that:
s = a connected socket
f = s.makefile()
s.close()
does not close the socket! adding f.close() is not enough. A del f is
necessary to really close the underlying socket.

--
nosy: +amaury.forgeotdarc

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



[issue3936] Faulty suppression of 'as' keyword warning

2008-09-25 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

On Thu, Sep 25, 2008 at 2:46 AM, Amaury Forgeot d'Arc
[EMAIL PROTECTED] wrote:

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

 Patch is good to me.

 Actually 2.5 is not in Release Candidate stage, do we really need
 formal review?

Well, it certainly can't hurt. :)

 --
 keywords:  -needs review

 ___
 Python tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue3936
 ___


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



[issue3936] Faulty suppression of 'as' keyword warning

2008-09-25 Thread Benjamin Peterson

Changes by Benjamin Peterson [EMAIL PROTECTED]:


--
assignee:  - benjamin.peterson

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2008-09-25 Thread Jeffrey C. Jacobs

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

I've enumerated the current list of Item Numbers at the official
Launchpad page for this issue:

https://launchpad.net/~pythonregexp2.7

There you will find links to each development branch associated with
each item, where a broader description of each issue may be found.

I will no longer enumerate the entire list here as it has grown too long
to keep repeating; please consult that web page for the most up-to-date
list of items we will try to tackle in the Python Regexp 2.7 update.

Also, anyone wanting to join the development team who already has a
Launchpad account can just go to the Python Regexp 2.7 web site above
and request to join.  You will need Bazaar to check out, pull or branch
code from the repository, which is available at www.bazaar-vcs.org.

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



[issue1160] Medium size regexp crashes python

2008-09-25 Thread Jeffrey C. Jacobs

Changes by Jeffrey C. Jacobs [EMAIL PROTECTED]:


--
nosy: +timehorse

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



[issue1160] Medium size regexp crashes python

2008-09-25 Thread Jeffrey C. Jacobs

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

It seems that changing the size type of the Regular Expression Byte-code
is a nice quick-fix, even though it doubles the size of a pattern.  It
may have the added benefit that most machine architectures available
today are at least partially, if not fully, 32-bit oriented so that
retrieving op codes may in fact be faster if we make this change.  OTOH,
it implies something interesting IMHO with the repeat count limits we
currently have.  Repeat counts can be explicitly set up to 65534 times
because 65535, being the largest number you can express in a 16-bit
unsigned integer, is currently reserved to mean Infinite.  It seems to
me this is a great opportunity to set that limit to (unsigned long)-1,
since that repeat count is incredibly large.

OTOH, if size is an issue, we could change the way sizes are expressed
in the Regexp Op Codes (typically in skip counts) to be 15-bit, with the
Most Significant Bit being reserved for 'extended' expressions.  In this
way, a value of 0x could be expressed as:

0x 0x 0x0003

Of course, parsing number in this form is a pain, to say the least, and
unlike in Python, the C-library would not play nicely if someone tried
to express a number that could not fit into what the architecture
defined an int to be.  Plus, there is the problem of how you express
Infinite with this scheme.  The advantage though would be we don't have
to change the op-code size and these 'extended' counts would be very
rare indeed.

Over all, I'm more of an Occam's Razor fan in that the simplest solution
is probably the best: just change the op-code size to unsigned long
(which, on SOME architectures would actually make it 64-bits!) and
define the 'Infinite' constant as (unsigned long)-1.  Mind you, I prefer
defining the constant in Python, not C, and it would be hard for Python
to determine that particular value being that Python is meant to be 'the
same' regardless of the underlying architecture, but that's another issue.

Anyway, as 2.6 is in Beta, this will have to wait for Python 2.7 / 3.1,
and so I will add an item to Issue 2636 with respect to it.

--
versions: +Python 2.7 -Python 2.5

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2008-09-25 Thread Jeffrey C. Jacobs

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

Good catch, Matthew, and if you spot any other outstanding Regular
Expression issues feel free to mention them here.

I'll give issue 1160 an item number of 25 and think all we need to do
here is change SRE_CODE to be typedefed to an unsigned long and change
the repeat count constants (which would be easier if we assume item 10:
shared constants).

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



[issue3723] Py_NewInterpreter does not work

2008-09-25 Thread djc

Changes by djc [EMAIL PROTECTED]:


--
nosy: +djc

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



[issue3960] Section permalink html anchors are wrong

2008-09-25 Thread Ronny Haryanto

New submission from Ronny Haryanto [EMAIL PROTECTED]:

With sphinx svn version 66617, generated html docs have invalid html 
anchors: a class=headerlink href=#blah instead of a 
class=headerlink name=blah.

Affected file: sphinx/htmlwriter.py, lines 71 and 373.

--
assignee: georg.brandl
components: Documentation tools (Sphinx)
messages: 73783
nosy: georg.brandl, ronny
severity: normal
status: open
title: Section permalink html anchors are wrong
type: behavior
versions: Python 2.5

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



[issue3960] Section permalink html anchors are wrong

2008-09-25 Thread Ronny Haryanto

Ronny Haryanto [EMAIL PROTECTED] added the comment:

Sorry, forgot to mention that this happened to the generated Django html 
documentations (django svn r9084), if it makes any difference.

After fixing the two lines (as I mentioned), all named link works again.

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



[issue3892] bsddb: test01_basic_replication fails on Windows sometimes

2008-09-25 Thread Jesús Cea Avión

Jesús Cea Avión [EMAIL PROTECTED] added the comment:

Oracle guys are studying this issue. I will keep you informed.

This issue is not a release blocker, in any case. See rational in msg73370.

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



[issue3960] Section permalink html anchors are wrong

2008-09-25 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Actually this is all right. The generated HTML looks like this:
span id=blah/spanh3Blaha class=headerlink href=#blah
title=Permalink to this headline¶/a/h3

So the id is in the span tag, not the a tag. The link generated for the
¶ is a convenience so that you can right-click and say copy link
location if you want to have a URL pointing to that heading.

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

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



[issue1706863] Failed to build Python 2.5.1 with sqlite3

2008-09-25 Thread Jason Tishler

Jason Tishler [EMAIL PROTECTED] added the comment:

Hirokazu Yamamoto wrote:
 Umm, it works, but I'm not sure we can call import library as
 dylib...

Agreed.

 I had considered attached patch experimental_distutils.patch.
 It's little adhoky, I'm not sure this patch is acceptable.

The new functionality is very similar to what I suggested in 
issue2445. Although it would be better to put Cygwin specific behavior 
in CygwinCCompiler, I think the changes would have be more invasive if 
you did.

I prefer your approach to mine. Can we get consensus and move forward?

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



[issue3961] Arrows key do not browse in the IDLE

2008-09-25 Thread Richard

New submission from Richard [EMAIL PROTECTED]:

I open python3.0 (rc1) IDLE from command line and it works fine, but
when i press the arrows key they writes: ^[[A ^[[B ^[[C ^[[D
also pagUP and pagDOWN writes: ^[[5~ ^[[6~
so I'm not able to browse the history and the all things with arrows key.

More Info:

my OS is Ubuntu 8.04 upgrade from 7.10

It's the first time that I have an issue with keyboard

I have look for my international settings of keyboard but I don't note
nothing of relevant. (my country is Italy-Europe)

I have installed as main python 2.5 with I have no problem (works perfect)

I made a standard alt-installation
./configure
make
make test   # 1error with urllib2 and some skip (see attach txt)
sudo make altinstall

I have no other kind of problems with python3.0rc1

Is there someone has an idea??

 -- Richard (excuse my English)

--
components: IDLE
files: maketestpython30_log.txt
messages: 73788
nosy: italian-boy
severity: normal
status: open
title: Arrows key do not browse in the IDLE
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file11599/maketestpython30_log.txt

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



[issue1647489] zero-length match confuses re.finditer()

2008-09-25 Thread Jeffrey C. Jacobs

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

Perl gives this result for your new expression:

,undef,undef
undef,undef,abc
undef,,undef

I think it has to do with not thinking of a string as a sequence of
characters, but as a sequence of characters separated by null-space. 
Null-space is can be captured, but ONLY if it is part of a zero-width
match, and once captured, it can no longer be captured by another
zero-width expression.  This is in keeping which what I see as Perl's
behaviour, namely that the (q*) group never participates in the first
match because, initially the (^z*) captures it.  OTOH, when it gets to
the null-space AFTER the 'abc' capture, the (^z*) cannot participate
because it has a at-beginning restriction.  The evaluator then moves
on to the (q*), which has no such restriction and this time it matches,
consuming the final null-space.

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



[issue3962] single architecture framework build fails on OS X 10.5

2008-09-25 Thread Chris

New submission from Chris [EMAIL PROTECTED]:

Hi,

Our group ended  up needing a non-universal x86_64 framework build 
because we had  trouble building some modules with the non-framework 
build. We had  to modify the makefile in two places to get it to work. 
First we fixed a place where configure generates '-arch_only i386'. That 
fixes the the build phase. Then we got rid of some install targets that  
were trying to pull  in Carbon code. 

The first problem seems like it could easily be fixed by somebody who 
understands the configure script. 

I'm not sure what's going on with the second problem. Is --disable-
toolbox-glue not being handled  correctly when the install target is 
generated? It seems like the build phase is skipping the Carbon 
dependent extension modules correctly but install is trying to pull in 
modules that  depend on those disabled modules. FYI, here's what  were 
doing:

./configure --prefix=${HOME} --with-cxx-main='/usr/bin/mpicxx -arch 
x86_64'\  --enable-framework=${HOME} --disable-toolbox-glue 
CC='/usr/bin/mpicc -arch \ x86_64' CXX='/usr/bin/mpicxx -arch x86_64' 
LDFLAGS='-framework Accelerate \ -arch x86_64'

Edit Makefile to replace  -arch_only i386 with -arch_only x86_64 and 
remove frameworkinstallmaclib and frameworkinstallapps from the 
altinstall: target.
 
diff Makefile Makefile~
457c457
  -lSystem -lSystemStubs -arch_only x86_64 -install_name 
$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) -
compatibility_version $(VERSION) -current_version $(VERSION) ;\
---
  -lSystem -lSystemStubs -arch_only i386 -install_name 
$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) -
compatibility_version $(VERSION) -current_version $(VERSION) ;\
741c741
 sharedinstall oldsharedinstall 
frameworkaltinstallunixtools
---
 sharedinstall oldsharedinstall frameworkinstallmaclib 
frameworkinstallapps frameworkaltinstallunixtools

Here is the svn info
Path: .
URL: http://svn.python.org/projects/python/trunk
Repository Root: http://svn.python.org/projects
Repository UUID: 6015fed2-1504-0410-9fe1-9d1591cc4771
Revision: 66613
Node Kind: directory
Schedule: normal
Last Changed Author: thomas.heller
Last Changed Rev: 66611
Last Changed Date: 2008-09-24 13:26:05 -0500 (Wed, 24 Sep 2008)

--
components: Macintosh
messages: 73790
nosy: cekees
severity: normal
status: open
title: single architecture framework build fails on OS X 10.5
type: compile error
versions: Python 2.6

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2008-09-25 Thread Matthew Barnett

Matthew Barnett [EMAIL PROTECTED] added the comment:

For reference, these are all the regex-related issues that I've found
(including this one!):

id   : activity : title
#2636: 25/09/08 : Regexp 2.7 (modifications to current re 2.2.2)
#1160: 25/09/08 : Medium size regexp crashes python
#1647489 : 24/09/08 : zero-length match confuses re.finditer()
#3511: 24/09/08 : Incorrect charset range handling with ignore case
flag?
#3825: 24/09/08 : Major reworking of Python 2.5.2 re module
#433028  : 24/09/08 : SRE: (?flag:...) is not supported
#433027  : 24/09/08 : SRE: (?-flag) is not supported.
#433024  : 24/09/08 : SRE: (?flag) isn't properly scoped
#3262: 22/09/08 : re.split doesn't split with zero-width regex
#3299: 17/09/08 : invalid object destruction in re.finditer()
#3665: 24/08/08 : Support \u and \U escapes in regexes
#3482: 15/08/08 : re.split, re.sub and re.subn should support flags
#1519638 : 11/07/08 : Unmatched Group issue - workaround
#1662581 : 09/07/08 : the re module can perform poorly: O(2**n) versus
O(n**2)
#3255: 02/07/08 : [proposal] alternative for re.sub
#2650: 28/06/08 : re.escape should not escape underscore
#433030  : 17/06/08 : SRE: Atomic Grouping (?...) is not supported
#1721518 : 24/04/08 : Small case which hangs
#1693050 : 24/04/08 : \w not helpful for non-Roman scripts
#2537: 24/04/08 : re.compile(r'((x|y+)*)*') should fail
#1633953 : 23/02/08 : re.compile((.*$){1,4}, re.MULTILINE) fails
#1282: 06/01/08 : re module needs to support bytes / memoryview well
#814253  : 11/09/07 : Grouprefs in lookbehind assertions
#214033  : 10/09/07 : re incompatibility in sre
#1708652 : 01/05/07 : Exact matching
#694374  : 28/06/03 : Recursive regular expressions
#433029  : 14/06/01 : SRE: posix classes aren't supported

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



[issue1647489] zero-length match confuses re.finditer()

2008-09-25 Thread Matthew Barnett

Matthew Barnett [EMAIL PROTECTED] added the comment:

I have to report that the fix appears to be successful:

 print [m.groups() for m in re.finditer(r'(^z*)|(\w+)', 'abc')]
[('', None), (None, 'abc')]
 print re.findall(r(^z*)|(\w+), abc)
[('', ''), ('', 'abc')]
 print [m.groups() for m in re.finditer(r(^z*)|(q*)|(\w+), abc)]
[('', None, None), (None, None, 'abc'), (None, '', None)]
 print re.findall(r(^z*)|(q*)|(\w+), abc)
[('', '', ''), ('', '', 'abc'), ('', '', '')]

The patch is regex_2.6rc2+7.diff.

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



[issue3959] Add Google's ipaddr.py to the stdlib

2008-09-25 Thread Guido van Rossum

Guido van Rossum [EMAIL PROTECTED] added the comment:

On Wed, Sep 24, 2008 at 9:07 PM, Martin v. Löwis [EMAIL PROTECTED] wrote:
 Martin v. Löwis [EMAIL PROTECTED] added the comment:
 I see a list of owners in the code (although it's difficult to infer
 real names or email addresses from that list). I think we should not
 include the code without their explicit approval.

I know they *want* this to happen, no worries on this front.

 The question will then always be: what is the official master copy of
 the code? The one in Python, or the one on Google code? Whose
 responsibility would it be to keep those synchronized, and incorporate
 changes from one copy into the other?

 I would prefer if the copy in Python (say, 2.7) becomes the master copy,
 and the copy on Google code eventually disappears (when interest in
 older Python versions has died).

I'm in favor of this, and I believe the authors at Google are too --
it was written out of necessity, and once integrated, the need for a
separate Google copy will go away.

 I would object to a mere fork of the code (i.e. where one of the regular
 Python committers incorporates, from time to time, the changes that
 Google made)

Agreed.

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2008-09-25 Thread Jeffrey C. Jacobs

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

Hmmm.  Well, some of those are already covered:

#2636: self
#1160: Item 25
#1647489 : Item 24
#3511: Item 23
#3825: Item 9-2
#433028  : Item 21
#433027  : Item 20
#433024  : Item 19
#3262: Item 22
#3299: TBD
#3665: TBD
#3482: TBD
#1519638 : TBD
#1662581 : TBD
#3255: TBD
#2650: TBD
#433030  : Item 1
#1721518 : TBD
#1693050 : TBD
#2537: TBD
#1633953 : TBD
#1282: TBD
#814253  : TBD (but I think you implemented this, didn't you Matthew?)
#214033  : TBD
#1708652 : TBD
#694374  : TBD
#433029  : Item 8

I'll have to get nosy and go over the rest of these to see if any of
them have already been solved, like the duplicate test case issue from a
while ago, but someone forgot to close them.  I'm thinking specifically
the '\u' escape sequence one.

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



[issue3963] Problems when calling exec from a function

2008-09-25 Thread Erik Sandberg

New submission from Erik Sandberg [EMAIL PROTECTED]:

When an exec statement called from a function f defines a top-level
function g, the body of g cannot access the top-level symbols defined by
the exec statement (which also happen to be the local variables of f).
Example:

x = 2
def f():
exec x = 1\ndef b(): return x
print b()
f()

An unqualified guess is that the mix of being top-level and being a
local variable, makes the symbol end up somewhere between locals() and
globals(). Example:

The problem causes real-life problems when I want to create a wrapper
function around execfile() to handle certain exceptions.

--
components: Interpreter Core
messages: 73795
nosy: sandberg
severity: normal
status: open
title: Problems when calling exec from a function
type: behavior
versions: Python 2.4, Python 2.5

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



[issue3964] quiet the freeze makefile

2008-09-25 Thread Christian Höltje

New submission from Christian Höltje [EMAIL PROTECTED]:

The make process for building a freeze'd python script is a little
noisy.  This patch makes quieter unless someone adds VERBOSE=1 to the
make invocation.

--
components: Demos and Tools
files: freeze.quiet.patch
keywords: patch
messages: 73796
nosy: docwhat
severity: normal
status: open
title: quiet the freeze makefile
type: feature request
Added file: http://bugs.python.org/file11600/freeze.quiet.patch

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



[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Geoff Gilmour-Taylor

New submission from Geoff Gilmour-Taylor [EMAIL PROTECTED]:

In 2.6rc2, when I try to open a file with a unicode filename with a tab
in it, Python crashes on Win2000 and WinXP.  Bytestrings raise an
IOError as expected.  I'm using the Windows ia32 binaries.

C:\c:\python26\python
Python 2.6rc2 (r26rc2:66507, Sep 18 2008, 14:27:33) [MSC v.1500 32 bit
(Intel)] on win32
Type help, copyright, credits or license for more information.
 f = open('c:\temp\temp.txt')
Traceback (most recent call last):
  File stdin, line 1, in module
IOError: invalid filename: c:   emp emp.txt or mode: r
 f = open(u'c:\temp\temp.txt')
[[Crash happens here.]]
C:\

I also get crashes for other unprintables \a \b \f \n \r \v \x03 and so on.

I'm not getting this on 2.5.2 or 3.0rc1.

--
components: Windows
files: unicodecoredump.txt
messages: 73797
nosy: giltay
severity: normal
status: open
title: 2.6rc2 crashes when trying to open unicode filename with unprintables
versions: Python 2.6
Added file: http://bugs.python.org/file11601/unicodecoredump.txt

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



[issue3963] Problems when calling exec from a function

2008-09-25 Thread Amaury Forgeot d'Arc

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

Right. Nested scopes only work for statically compiled code; inside an
'exec' block, non-local variables are global.

In your case, I suggest to specify the context in which the code has to
execute:

x = 2
def f():
g = globals().copy()
exec x = 1\ndef b(): return x in g
print eval(b(), g)

This prints 1, as you want it, and can still access names defined
outside the f() function. And this gives you more control on the symbols
available to the executed code.
Python does something very similar when it loads a module.

I don't think that this behaviour can ever change. Tentatively closing
as won't fix.

--
nosy: +amaury.forgeotdarc
resolution:  - wont fix
status: open - closed

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



[issue3783] dbm.sqlite proof of concept

2008-09-25 Thread Josiah Carlson

Josiah Carlson [EMAIL PROTECTED] added the comment:

Thank you for the report (fixed in the newly attached version) :) .

Added file: http://bugs.python.org/file11602/sq_dict.py

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



[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-25 Thread Roumen Petrov

Roumen Petrov [EMAIL PROTECTED] added the comment:

test_mixed_4 fail on:
Python 2.6rc2+ (trunk:66617M, Sep 25 2008, 16:32:44) 
[GCC 3.4.5 (mingw special)] on win32
Type help, copyright, credits or license for more information.

sizeof(X) return 12.

--
nosy: +rpetrov

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2008-09-25 Thread Matthew Barnett

Matthew Barnett [EMAIL PROTECTED] added the comment:

Tried [EMAIL PROTECTED] twice, no reply. Succeeded with
[EMAIL PROTECTED]

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



[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Amaury Forgeot d'Arc

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

Confirmed here. This also happens on Windows when the mode is invalid:
open(ufoobar, rr)

Here is a patch, please review.

The problem does not affect py3k because open() is used in place of
fopen(), and the mode string is parsed differently.

--
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
priority:  - release blocker
Added file: http://bugs.python.org/file11603/invalid_filename.patch

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



[issue3943] IDLE won't start in 3.0rc1 Subprocess didn't make connection....

2008-09-25 Thread Robert Yodlowski

Robert Yodlowski [EMAIL PROTECTED] added the comment:

Amaury, my stupid! I must have forgotten to delete the run.pyc file
before trying out the modified run.py as suggested in #3905 . It all
works now and IDLE starts up just fine.

Sorry and, thanks for the help.

...Bob

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



[issue3966] Win32ErrorTests from test_os.py

2008-09-25 Thread Roumen Petrov

New submission from Roumen Petrov [EMAIL PROTECTED]:

test method   - call os.method
test_mkdir(self)  - os.chdir
test_access(self) - os.utime
test_chmod(self)  - os.utime

Is the test correct ?

--
messages: 73807
nosy: rpetrov
severity: normal
status: open
title: Win32ErrorTests from test_os.py

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



[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-25 Thread Thomas Heller

Thomas Heller [EMAIL PROTECTED] added the comment:

Does the following patch fix the test failure with MingW?

patch
Index: cfield.c
===
--- cfield.c(revision 66611)
+++ cfield.c(working copy)
@@ -65,10 +65,10 @@
}
if (bitsize /* this is a bitfield request */
 *pfield_size /* we have a bitfield open */
-#if defined(MS_WIN32)  !defined(__MINGW32__)
-dict-size * 8 == *pfield_size /* MSVC */
+#if defined(MS_WIN32)
+dict-size * 8 == *pfield_size /* Windows */
 #else
-dict-size * 8 = *pfield_size /* GCC, MINGW */
+dict-size * 8 = *pfield_size /* GCC */
 #endif
 (*pbitofs + bitsize) = *pfield_size) {
/* continue bit field */
end patch

Also, can you please post the output of the following code snippet?

test script
from ctypes import *

class X(Structure):
_fields_ = [(a, c_short, 4),
(b, c_short, 4),
(c, c_int, 24),
(d, c_short, 4),
(e, c_short, 4),
(f, c_int, 24)]

print X.a
print X.b
print X.c
print X.d
print X.e
print X.f
end test script

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



[issue3943] IDLE won't start in 3.0rc1 Subprocess didn't make connection....

2008-09-25 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc [EMAIL PROTECTED]:


--
resolution:  - invalid
status: open - closed

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



[issue3946] PyObject_CheckReadBuffer crashes on memoryview object

2008-09-25 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

On Thu, Sep 25, 2008 at 6:39 AM, Antoine Pitrou [EMAIL PROTECTED] wrote:

 Antoine Pitrou [EMAIL PROTECTED] added the comment:

 The test would be better in test_memoryview rather than in test_builtin.

I disagree. The test I added is really about compile, and its failure
was really just a side effect of the buffer bug.

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



[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Martin v. Löwis

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

I think it is somewhat surprising that the file name shows up at the end
in the traceback. Instead of getting

IOError: [Errno 22] invalid filename or mode 'w': '/dos/foo\n'

it might be better if it said

IOError: [Errno 22] invalid mode ('w') or filename: '/dos/foo\n'

Otherwise, the patch looks fine.

--
assignee:  - amaury.forgeotdarc
nosy: +loewis
resolution:  - accepted

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



[issue858809] Use directories from configure rather than hardcoded

2008-09-25 Thread Joseph Rothrock

Joseph Rothrock [EMAIL PROTECTED] added the comment:

Hi,

This problem still exists in 2.5.2. Setting the libdir argument doesn't
correctly set LIBDIR in the Makefile.


[EMAIL PROTECTED] Python-2.5.2]$ ./configure --prefix=/home/y
--libdir=/home/y/lib64

...

[EMAIL PROTECTED] Python-2.5.2]$ cat Makefile | grep LIBDIR=
LIBDIR= $(exec_prefix)/lib

--
nosy: +rothrock
versions: +Python 2.5 -Python 2.3

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



[issue3936] Faulty suppression of 'as' keyword warning

2008-09-25 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Fixed in r66618.

--
resolution:  - fixed
status: open - closed

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



[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Amaury Forgeot d'Arc

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

Applied patch in r66620, with the suggested change in the error message.

--
keywords:  -needs review
resolution: accepted - fixed
status: open - closed

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



[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Amaury Forgeot d'Arc

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

And, thanks a lot reporting this!

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



[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Geoff Gilmour-Taylor

Geoff Gilmour-Taylor [EMAIL PROTECTED] added the comment:

Cheers.  First bug I've found in 5 years of Python.  (Or, 5 years in and
I still keep forgetting to use raw strings for Windows paths.  :)

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



[issue3967] bytearray().count()

2008-09-25 Thread STINNER Victor

New submission from STINNER Victor [EMAIL PROTECTED]:

bytes_count() doesn't check start maximum value: _adjust_indices()
should check that start is smaller than len (smaller or egal? len or
len-1?). Example:

 b = bytearray(3)
 b.count(x, 1491491034, 0)

start=1491491034 should be replaced by 3 (or 2 or 4? I don't know
bytearray enough).

--
components: Interpreter Core
messages: 73817
nosy: haypo
severity: normal
status: open
title: bytearray().count()
type: crash
versions: Python 2.6

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



[issue3963] Problems when calling exec from a function

2008-09-25 Thread Amaury Forgeot d'Arc

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

See also:

http://docs.python.org/dev/reference/executionmodel.html#interaction-
with-dynamic-features

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



[issue3929] Incorrect exception raising in dbm.open on non-existing DB

2008-09-25 Thread Amaury Forgeot d'Arc

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

Did you know that...
with python 2.x, raise (x,y,z) is equivalent to raise x!
I could not find this in the documentation.

Committed the patch to py3k as r66622.

--
resolution:  - fixed
status: open - closed

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



[issue3967] bytearray().count()

2008-09-25 Thread Amaury Forgeot d'Arc

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

Is there a problem, a potential crash?
looking at the code, I could not find any: in fastsearch, the if (w  
0) will quickly exit the function, without reading the contents of the 
array.

--
nosy: +amaury.forgeotdarc

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



[issue3967] bytearray().count()

2008-09-25 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

Here is a trace of Valgrind:

  b=bytearray(2)
  b.count(, 3493403, 0)
0
  b.count(, 23131230123012010231023, 0)
==13650== Invalid read of size 1
==13650==at 0x812718A: fastsearch (fastsearch.h:67)
==13650==by 0x81272CB: stringlib_count (count.h:22)
==13650==by 0x8128611: bytes_count (bytearrayobject.c:1198)
==13650==by 0x81376B6: PyCFunction_Call (methodobject.c:81)
==13650==by 0x80D913D: call_function (ceval.c:3679)
==13650==by 0x80D603A: PyEval_EvalFrameEx (ceval.c:2370)
==13650==by 0x80D7891: PyEval_EvalCodeEx (ceval.c:2942)
==13650==by 0x80D0A8F: PyEval_EvalCode (ceval.c:515)
==13650==by 0x80FB4FE: run_mod (pythonrun.c:1330)
==13650==by 0x80FA166: PyRun_InteractiveOneFlags (pythonrun.c:836)
==13650==by 0x80F9EEA: PyRun_InteractiveLoopFlags (pythonrun.c:756)
==13650==by 0x80F9DAC: PyRun_AnyFileExFlags (pythonrun.c:725)
==13650==  Address 0x8444553a is not stack'd, malloc'd or (recently) free'd
==13650==
==13650== Process terminating with default action of signal 11 (SIGSEGV)

Trace of gdb:
0x0812718a in fastsearch (s=0x89b9fcaf Address 0x89b9fcaf out of 
bounds, n=-2147483647,
p=0xb7b54274 , m=4, mode=0) at Objects/stringlib/fastsearch.h:67
67  if (s[i+m-1] == p[m-1]) {
(gdb) where
#0  0x0812718a in fastsearch (s=0x89b9fcaf Address 0x89b9fcaf out of 
bounds, n=-2147483647,
p=0xb7b54274 , m=4, mode=0) at Objects/stringlib/fastsearch.h:67
#1  0x081272cc in stringlib_count (str=0x89b9fcaf Address 0x89b9fcaf 
out of bounds,
str_len=-2147483647, sub=0xb7b54274 , sub_len=4) at 
Objects/stringlib/count.h:22
#2  0x08128612 in bytes_count (self=0xb7d025f0, args=0xb7b5075c)
at Objects/bytearrayobject.c:1198
(gdb) print w
$1 = 2147483645
(gdb) print m
$2 = 4

Oh, look at stringlib_count (..., str_len=-2147483647, ..., sub_len=4): 
str_len is negative.

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



[issue3946] PyObject_CheckReadBuffer crashes on memoryview object

2008-09-25 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

 I disagree. The test I added is really about compile, and its failure
 was really just a side effect of the buffer bug.

Well, I won't fight over it, but it's really meant to check an aspect of
memoryview behaviour - otherwise why would it be part of your patch ? -,
and as such it should be in test_memoryview (and if it's meant to check
compile() then it should be in some hypothetical test_compile :-)).

In general I find it annoying that many tests are dumped into generic
test files like test_builtin, rather than in the test file appropriate
for the functionality being tested.

That said, I haven't looked at the rest of the patch yet, sorry! (back
from holidays)

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



[issue3956] turtle.py - bug in Screen.__init__()

2008-09-25 Thread Gregor Lingl

Gregor Lingl [EMAIL PROTECTED] added the comment:

First of all I'd like to point you at a posting which I posted to
Python-dev on August 18th, where I addressed this issue in full detail. 

http://mail.python.org/pipermail/python-dev/2008-August/081846.html

I hoped to provoke a clarifying discussion but I have to complain, that
I didn't succeed with this probably because many people were on vacation
at this time.

The only substantial reply I got was by Vern Ceder, a turtle graphics
veteran who contributed a lot to the old turtle module. He wrote:

Gregor,

I don't feel authoritative on the correctness/appropriateness of the 
implementation, but I do agree completely that behavior b, 
or what you have in the 3.0 version, is vastly preferable.

Cheers,
Vern 

The design decision to use a singleton is of interest only for
interactive use. (A well designed Script uses at most one Screen() call
at the beginning. So that is no issue.)

I'll demonstrate here in a short interactive session (which you can
reproduce using IDLE with the -n switch as usual), why the solution
Martin proposes doesn't meet the requirements I tried to accomplish with
my code. This session 'simulates' a student curiously playing around and
experimenting with *the* Screen():

 from turtle import Screen, Turtle
 class YellowScreen(Screen):
def __init__(self):
Screen.__init__(self)
self.bgcolor(yellow)


 s = YellowScreen()
 t = Turtle()
 for i in range(10):
t.fd(50)
t.lt(36)


 s1 = Screen()
 s1.bgcolor(pink)
 s = YellowScreen()
 s1.bgcolor()
'yellow'
 s1.turtles()
[turtle.Turtle object at 0x01490450]
 class TextScreen(Screen):
def __init__(self):
Screen.__init__(self)
self. writer = Turtle(visible=False)
self.writer.pu()
def writeAt(self, x, y, txt):
self.writer.goto(x,y)
self.writer.write(txt)


 s = TextScreen()
 s.writeAt(0, -200, Read me ...)
 s.turtles()
[turtle.Turtle object at 0x01490450, turtle.Turtle object at 0x014902B0]
 s.writer
turtle.Turtle object at 0x014902B0
 class RedScreen(Screen):
def __init__(self):
Screen .__init__(self)
self.bgcolor(1, 0.5, 0.5)


 u = RedScreen()
 u.writeAt(0,200, Read me too)# should fail!
Traceback (most recent call last):
  File pyshell#21, line 1, in module
u.writeAt(0,200, Read me too)
AttributeError: 'RedScreen' object has no attribute 'writeAt'
 u = TextScreen()
 u.writeAt(0,200, Read me too)
 u.turtles()  # at this point for the first time occurs an 
 # unfavorable consequence of what Martin called a
 # 'design bug', namely a turtle in the turtles() list 
 # which is not used any more.
[turtle.Turtle object at 0x01490450, turtle.Turtle object at
0x014902B0, turtle.Turtle object at 0x014C2D10]
 u.writer
turtle.Turtle object at 0x014C2D10
 s.writer
turtle.Turtle object at 0x014C2D10
#  We want a fresh screen ...
 s.clear()
 s.turtles()
[]

So there occurres this and possibly some more somewhat weird elements, 
presumably a result of using the Singleton pattern which is especially
controversial in combination with inheritance. Nevertheless I decisively
propose to accept this behaviour in order to be able do things like the
ones demonstrated above. Morover I also consider it to be a benefit to
use spezialized and/or reusable screens derived from the Screen() class
in scripts, what would not be possible with a Screen()-function
returning *the* single _Screen() object. (All this meant in the context
of teaching and learning OOP).

Now for the additional questions of Martin:

Yes, the second if statement is superfluous. It looks like to be a
remain from Pen.__init__ from the old turtle module, where - in contrast
- it was not superfluous. My fault. It could be removed, but it doesn't
do harm. (The overwhelming part of the module is *re*written but it
still contains (in this case regrettably) quite some traces of the old
module.) And also the assignement of self to Turtle._screen in the last
line could be put into the if-statement-body. But somehow I seem to have
felt that a conditionally empty body of __init__() looks dangerous - or
at least not nice. More seriously taken, the Borg idiom ensures the
creation of new instances (with different id), sharing state and
behaviour and I somehow felt it to be better to have the last created
instance in Turtle._screen (whereas in fact this is of no importance).

My preliminary conclusion: as I'm not a professional programmer but a
teacher I can't judge the importance of observing the design 
principle mentioned by Martin. (I know the principle, I normally observe
it and consider it's non observation in the Screen class to be well
founded) But if you think, that there is no way around and it has to be
observed strictly, one had to leave 

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-25 Thread Roumen Petrov

Roumen Petrov [EMAIL PROTECTED] added the comment:

Yes this extra define was the problem.
Instead hint /* Windows */ what about /* MSVC, GCC(with -mms-bitfields) */ ?

The option -mms-bitfields is available for GCC compiler on mingw and
cygwin targets.


About test_bitfields.py:
- comment in test_mixed_4: if GCC compiler has option -mms-bitfields it
will produce code compatible with MSVC. May be comment has to include
this information. 

- may be method test_mixed_1 need similar comment as test_mixed_4, but
even without comment is fine with me.

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



[issue3968] fill() and end_fill() do not work correctly

2008-09-25 Thread Gregor Lingl

New submission from Gregor Lingl [EMAIL PROTECTED]:

fill() and end_fill() do not work as expected. As a user 
on the tutor list wrote:

For a while now I've had trouble with end_fill(). Sometimes I can use
it to fill a figure such as a square, triangle or rectangle, but
sometimes not.

This is due to a missing update() call in the RawPen.fill() method

A patch is attached

Regards, Gregor

--
components: Tkinter
files: 2.5turtle_fillpatch.diff
keywords: patch
messages: 73825
nosy: gregorlingl
severity: normal
status: open
title: fill() and end_fill() do not work correctly
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file11604/2.5turtle_fillpatch.diff

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



[issue3969] turtle.py - setup() doesn't work correctly

2008-09-25 Thread Gregor Lingl

New submission from Gregor Lingl [EMAIL PROTECTED]:

setup() doesn't work correctly: startx argument is not recognized
This is due to a typo in the setup() function

A patch is attached.

Regards, Gregor

--
components: Tkinter
files: 2.5turtle_setup_patch.diff
keywords: patch
messages: 73826
nosy: gregorlingl
severity: normal
status: open
title: turtle.py - setup() doesn't work correctly
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file11605/2.5turtle_setup_patch.diff

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



[issue3968] turtle.py: fill() and end_fill() do not work correctly

2008-09-25 Thread Gregor Lingl

Changes by Gregor Lingl [EMAIL PROTECTED]:


--
title: fill() and end_fill() do not work correctly - turtle.py: fill() and 
end_fill() do not work correctly

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2008-09-25 Thread Matthew Barnett

Matthew Barnett [EMAIL PROTECTED] added the comment:

I've been completely unable to get Bazaar to work with Launchpad:
authentication errors and bzrlib.errors.TooManyConcurrentRequests.

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



[issue3967] bytearray().count()

2008-09-25 Thread Amaury Forgeot d'Arc

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

Ah, big numbers that overflow: even if 'start' is (silently) capped to  
sys.maxint-1,len(b)-start-len(xx)   will wrap and yield a positive 
number...

The find/rfind/index/rindex methods have the same problem.

Attached a patch and unit tests, needs review.

--
keywords: +needs review, patch
priority:  - release blocker
Added file: http://bugs.python.org/file11606/string_count.patch

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



[issue3967] bytearray().count()

2008-09-25 Thread Amaury Forgeot d'Arc

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

All versions are involved.

Even 2.4 has surprises:
 aa.count(, sys.maxint, 0)
-2147483646

--
versions: +Python 2.5, Python 3.0

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



[issue3970] Tix Tree widget no longer instantiable.

2008-09-25 Thread Ron Longo

New submission from Ron Longo [EMAIL PROTECTED]:

The following code works in Python 2.5 but not in Python 2.6:  I've 
tested on Windows XP and Windows Vista.

from Tix import *
root = Tk()
t = Tree( root )

In Python 2.6 the following exception is thrown while trying to execute 
the last statement above:

Traceback (most recent call last):
  File stdin, line 1, in module
  File C:\Python26\lib\lib-tk\Tix.py, line 1519, in __init__
['options'], cnf, kw)
  File C:\Python26\lib\lib-tk\Tix.py, line 307, in __init__
self.tk.call(widgetName, self._w, *extra)
_tkinter.TclError: unknown color name {#c3c3c3}

--
components: Tkinter
messages: 73830
nosy: ronLongo
severity: normal
status: open
title: Tix Tree widget no longer instantiable.
versions: Python 2.6

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



[issue3960] Section permalink html anchors are wrong

2008-09-25 Thread Ronny Haryanto

Ronny Haryanto [EMAIL PROTECTED] added the comment:

Sorry, Georg, I just realized what you meant. You're right. But would it 
be possible to add name *in addition to* href so that clicking on in-
document links (e.g. in Table of Contents) would still work? Thanks.

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



[issue3963] Problems when calling exec from a function

2008-09-25 Thread Erik Sandberg

Erik Sandberg [EMAIL PROTECTED] added the comment:

Thanks! Passing an explicit global namespace solves the problem and is
something I wanted to do anyways, when I think about it.

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



[issue3826] BaseHTTPRequestHandler depends on GC to close connections

2008-09-25 Thread Gregory P. Smith

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

The whole socket._io_refs thing looks like a real design flaw.  What is
its actual intended purpose?

When close is called on the socket object itself, the socket MSUT be
closed.  Why is our API otherwise?

Its up to the programming to ensure that no other references to that
socket wrapped in whatever layers will be used after that, if they are
they'll eventually get errors when an IO occurs.


I think this behavior started with this change:


r56714 | jeremy.hylton | 2007-08-03 13:40:09 -0700 (Fri, 03 Aug 2007) |
21 lines

Make sure socket.close() doesn't interfere with socket.makefile().

If a makefile()-generated object is open and its parent socket is
closed, the parent socket should remain open until the child is
closed, too.  The code to support this is moderately complex and
requires one extra slots in the socket object.

This change fixes httplib so that several urllib2net test cases pass
again.

Add SocketCloser class to socket.py, which encapsulates the
refcounting logic for sockets after makefile() has been called.

Move SocketIO class from io module to socket module.  It's only use is
to implement the raw I/O methods on top of a socket to support
makefile().

Add unittests to test_socket to cover various patterns of close and
makefile.

...
later modified by this (still the same effect):
...


r58970 | guido.van.rossum | 2007-11-14 14:32:02 -0800 (Wed, 14 Nov 2007)
| 6 lines

Patch 1439 by Bill Janssen.  I think this will work.
Tested on Windows by Christian Heimes.
I changed the code slightly, renaming decref_socketios() to
_decref_socketios(), and moving it closer to the close() method
that it calls.  Hopefully Bill can now submit his SSL port to 3.0.

--
nosy: +gvanrossum, jhylton

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