[issue4358] Segfault in stringobject.c

2008-11-19 Thread Farshad Khoshkhui

Farshad Khoshkhui <[EMAIL PROTECTED]> added the comment:

No, there isn't any custom made C extension, nor I'm using ctypes. (It
was a mistake selecting ctypes).
The application is a web service with postgresql backend, so it heavily
uses pyexpat and pygresql in a threaded environment. 
I'll recompile python with pydebug and get back with results.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3947] configure --with-threads on cygwin => crash on thread related tests

2008-11-19 Thread Hirokazu Yamamoto

Hirokazu Yamamoto <[EMAIL PROTECTED]> added the comment:

OK, I'll close this entry, and I'll post message to cygwin ml about this
issue.
# I already posted it to openssl-dev, but there was no response.
http://www.nabble.com/Bug%3A-crash-on-cygwin-if-uses-CRYPTO_set_locking_callback-and-shared-library-to19699111.html#a19712690

--
keywords:  -needs review
priority: critical -> 
resolution:  -> wont fix
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4353] Move description what a trace should should return to settrace from pdb section into sys.settrace section

2008-11-19 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

Thanks for the suggestion! Done in r67205.

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

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4309] ctypes documentation

2008-11-19 Thread David W. Lambert

David W. Lambert <[EMAIL PROTECTED]> added the comment:

When patching py3k/Doc/library/ctypes.rst or ctypes module tree please 
consider

  u"World!" produces a syntax error.

  These wide character formats produce unintelligible output:

for n in range(3,6):
code = 'utf_%s'%2**n
print(code)
printf(b"Hello, %S\n", 'world'.encode(code))

  http://mail.python.org/pipermail/python-3000/2008-November/015315.html

  And that early in the doc this is probably meant to be a simple, 
somewhat complete example.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4117] missing update() in _Screen.setup() of Lib/turtle.py

2008-11-19 Thread Gregor Lingl

Gregor Lingl <[EMAIL PROTECTED]> added the comment:

> Most definitely. The module went into Python without any review
> whatsoever. Nobody (but you) has ever looked at the code in detail.

That's not True! Brad Miller, for example, who also had submitted
patches to the pythontracker, coauthor of "Python Programming in
Context",  has used a predecessor of turtle.py as a main tool (swiss
army knife, as he says) in his book. He has contributed a few patches
(via private communication, before the module went into the Python
trunk), one of them directly concerning the update method. He had also
suggested some of the features, which I have added towards the end of
the development.

> You might argue that with due process, review should have taken
> place before the code was integrated. You might be right, but then
> the new turtle module wouldn't have been part of Python 2.6.

Rigth, more or less. At least I had expected, that someone reads the
doc-strings of the approx. 15 classes in the module. The one of
TurtleScreenBase reads like this:

"""Provide the basic graphics functionality.
Interface between Tkinter and turtle.py.

To port turtle.py to some different graphics toolkit
a corresponding TurtleScreenBase class has to be implemented.
"""

Gregor

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3947] configure --with-threads on cygwin => crash on thread related tests

2008-11-19 Thread Amaury Forgeot d'Arc

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

With cygwin, calling sem_wait() in the DLL_THREAD_DETACH section of a DllMain 
function 
can crash the program. 
See attached zip file, it contains two C files which only include pthread.h and 
semaphore.h (no python, no openssl). The resulting program crashes ~30% of the 
time.

If this pattern (in dll.c) is not allowed, it's a problem in the openssl code.
If it is allowed, it's a bug in cygwin's threads implementation.

We should really move this discussion to cygwin. This is no more a python issue.

Added file: http://bugs.python.org/file12068/cygwin_crash.zip

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-19 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

I have attached a file that does everything internally as UTF-8 but
reads and writes to disk as Latin-1. I added some unit tests to verify
that taking a character encoded in UTF-8 or as a string still works
properly regardless of whether one uses the string or bytes version of
the key.

Added file: http://bugs.python.org/file12067/dumb_to_utf8.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4356] Add "key" argument to "bisect" module functions

2008-11-19 Thread Raymond Hettinger

Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

Miki, the issue is that bisect calls tend to be made repeatedly, so the
key function can be called over and over again for the same argument. 
It is almost always a better design to simply decorate the list so the
key function never gets called more than once per element in the list. 
If we added key= to bisect, it would encourage bad design and steer
people after from better solutions.

--
nosy: +rhettinger

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4359] at runtime, distutils uses buildtime files

2008-11-19 Thread Toshio Kuratomi

New submission from Toshio Kuratomi <[EMAIL PROTECTED]>:

When using some distutils functions, distutils attempts to use buildtime
files like Makefile and pyconfig*.h as data sources.  For instance, this
snippet::

  from distutils.command.install import install
  from distutils.core import Distribution
  dist = Distribution({"name": "foopkg"})
  cmd = install(dist)
  cmd.ensure_finalized()

There's two reasons this should change.

1) Some Linux distributions separate the python runtime and buildtime
files and put the buildtime files in a -devel package.  Depending on
these buildtime files means that the -devel package can be needed for
running python scripts.  For instance, here's the traceback that occurs
when the previous commands are run without python-devel on Fedora Linux::

  Traceback (most recent call last):
File "", line 1, in 
File "/usr/lib/python2.5/distutils/cmd.py", line 117, in
ensure_finalized
  self.finalize_options()
File "/usr/lib/python2.5/distutils/command/install.py", line 273, in
finalize_options
  (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
File "/usr/lib/python2.5/distutils/sysconfig.py", line 493, in
get_config_vars
  func()
File "/usr/lib/python2.5/distutils/sysconfig.py", line 352, in
_init_posix
  raise DistutilsPlatformError(my_msg)
  distutils.errors.DistutilsPlatformError: invalid Python installation:
unable to open /usr/lib/python2.5/config/Makefile (No such file or
directory)

2) keeping the information in a Makefile and *.h files and then having
regular expressions pull the information out is fragile and not what the
tools were meant for.  Using a defined data format is much better.

The variables necessary for building extensions should be placed in a
data file of some sort.  This can be built by the configure script at
the same time as it's substituting variables into the Makefile and
pyconfig files.

xml is good for interoperability and we have good modules in the std
library for that now.  .ini is less verbose and we have modules to deal
with that as well.

--
components: Distutils
messages: 76083
nosy: a.badger
severity: normal
status: open
title: at runtime, distutils uses buildtime files
type: behavior
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-19 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

OK, now I see why it is called 'dumb'; the thing literally just dumps
out the repr of two strings on each line for key/value pairs. To read it
just evals each line in the string. And whichdb detects this format by
looking for ' or " as the first character since that is what the repr
for str is. And that is why the Latin-1 decoding was used; it has the
proper repr for write-out.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4117] missing update() in _Screen.setup() of Lib/turtle.py

2008-11-19 Thread Martin v. Löwis

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

> 2. Is it really fruitful to discuss  general design issues along with
> (comparatively) small problems like this one - in the sense of
> alternative ways to fix that problem?

Most definitely. The module went into Python without any review
whatsoever. Nobody (but you) has ever looked at the code in detail.
Only now that I look at it I wonder whether the design of the code
is appropriate.

In this specific case, gpolo suggested a reasonable change to the
proposed patch. You opposed this change, pointing out that this
change contradicts the design behind it. As I think the change gpolo
requested is desirable, it *must* be the design that is wrong (as
it restricts us from doing what I think should be done).

So: if you bring up "the design" as a reason for doing things the
way they are done, expect the design to be challenged.

You might argue that with due process, review should have taken
place before the code was integrated. You might be right, but then
the new turtle module wouldn't have been part of Python 2.6.

Wrt. the specific design issue: I believe that attempts to provide
cross-platform GUI in a simple fashion are doomed to fail. Java
AWT is an extraordinary example of it, but many more libraries
exist that essentially prove that cross-platform GUI is a bad idea;
one may argue that Tk itself is also proof of that (although
it is fairly sophisticated, and not at all simple). The fact that
I have not objected to it earlier is simply because I must have
ignored any claims about cross-platform GUIs.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-19 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

If you look at the 2.7 code all it requires of keys and values in
__setitem__ is that they are strings; there is nothing about Latin-1 in
terms of specific encoding (must be a 3.0 addition to make the
str/unicode transition the easiest). That would suggest to me that
assuming that previous DBs were written in Latin-1 is somewhat bogus as
people could have passed in any str encoded in any format as a DB key or
value.

Thus I think going down the UTF-8 route is the right thing to do for
string arguments. A quick look at _gdbmmodule.c supports this as it just
converts its arguments through PyArg_Parse("s#") to get its keys and
thus uses UTF-8 as the default encoding.

--
nosy: +brett.cannon

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3947] configure --with-threads on cygwin => crash on thread related tests

2008-11-19 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

I'm not sure that reported issue is openssl bug.
Just tested a GCC(mingw) build of test case reproduce.zip with
openssl(0.9.8i) and "pthreads-w32". The test run without problems on
nt5.1(xp).

--
nosy: +rpetrov

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4358] Segfault in stringobject.c

2008-11-19 Thread Amaury Forgeot d'Arc

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

This is difficult: the backtrace only show plain python operations.
Some hints though:

One backtrace shows a memory corruption in the obmalloc data. This may come 
from a 
buffer overrun.

You initially selected ctypes in "Components", does this mean that your program 
also use ctypes?
With ctypes it is easy to be caught with a python string converted to a 
(mutable) 
char* pointer.

For example, on Windows:
>>> import ctypes
>>> c = ctypes.CDLL('msvcrt')
>>> a = ""
>>> c.strcpy(a, "X" * 50)
50
>>> a
''
... and the crash is not far.

Another case of corruption in obmalloc is to try to allocate python objects 
while 
the GIL is not held. This may happen if you wrote a C function that uses the 
Python API, and call this with ctypes.

In any case, I suggest that you build and a use a debug-enabled version of 
python 
(configure with --with-pydebug). It catches some errors earlier and sometimes 
more 
reliably.

--
nosy: +amaury.forgeotdarc

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4117] missing update() in _Screen.setup() of Lib/turtle.py

2008-11-19 Thread Gregor Lingl

Gregor Lingl <[EMAIL PROTECTED]> added the comment:

> > I find that desire misguided; this is (IMO) a case of false abstraction.
> > Is there any kind of proof that this design actually
> > works, i.e. can be ported to a different GUI library (like, say,
> > PythonWin? or AWT, when run in Jython?)
   
Yes there is. I have a (nearly complete) port to Pygame. (The only 
exception is the ondrag method, which I will incorporate if I have time
for it.) It runs all of the turtle graphics example scripts (except
colormixer which uses ondrag) without problems.

> > Unless such proof can be provided (and then integrated into the code),
> > I recommend to give up that objective, and start merging the base class
> > code into the subclasses where reasonable.

Sorry, but I definitely shall not follow your recommendation.  I have
presented the architecture of the turtle module at Europython 2006  in a
talk which was visited also by Guido v. Rossum and later in Leipzig at a
workshop where you yourself, Martin, was present. On both of these
occasions I showed working prototypes of this port (along with another
one to VPython) and nobody had any objections nor were there any
objections by other useres who have used it up to now against this
design. You can find this also in the "Tagungsband" to the Leipzig
Python workshop together with some screenshots.

I'm very confident that this is a good design and I know (form the 
experience mentioned above) that it works. So instead I'll proceed with 
porting it to Jython and I for my part would consider it as an advantage
to have the same turtle module in both of these flavours of Python.

Two more remarks on this discussion, a specific one and a general one.

1. The bug I submitted a patch for is in the method setup() and in the 
__init__ method of _Screen, both of which usually will be called only 
once in a program.So in *this* case it cannot cause any performance 
problems. The bug  has annoying consequences and I found a simple 
remedy, which I consider appropriate for a bug-fix-release like 2.6.1. I
don't see any reason why to keep a known bug like this one in the code.
Acceptance of the patch will certainly not affect any more fundamental
amendments to follow (possibly). Moreover up to now I didn't hear of a
single complaint about the performance of the turtle module. I think
this is (i) because for beginning programmers this is no issue and (ii)
there are means (to call tracer() and also to call update() directly) to
control performance to a considerable extent. Shortly, my opinion is
that there are *good reasons* why the implementation is done like this,
seen from the educator's point of view.

2. Is it really fruitful to discuss  general design issues along with
(comparatively) small problems like this one - in the sense of
alternative ways to fix that problem? Implementations of redesigns like
the one you recommended wouldn't be accepted anyway for bug fix releases 
or releases in rc phase. I'm open to fundamental criticism also, but I 
think that should be led in Python-Dev or possibly comp.lang.python. And 
working out an amended concept would take some time and also it's 
implementation and it's testing. Moreover, to find co-workers to work on 
this would be an advantage.

Regards,
Gregor

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-19 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

I don't think there is anything to fix here beyond the docs for __del__.
You should never expect anything to be working in __del__, and that
includes the import machinery. It should be bare-bones, not trying to
pull in new code!

I have attached a patch which tries to clarify this fact in the language
docs for __del__.

Added file: http://bugs.python.org/file12066/clarify___del__.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-19 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

So if you look at Python/pythonrun.c, there is a comment from Tim Peters
(from r34776) where he explicitly points out that this is possibility
but that it has never been reported before. Oops. =)

--
nosy: +brett.cannon

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4348] bytearray methods returning self

2008-11-19 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

Fixed in r67291.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4356] Add "key" argument to "bisect" module functions

2008-11-19 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

This request has come up repeatedly (and been rejected) in the past.  See 
issues 2954, 3374, 1185383, 1462228, 1451588, 1619060.

Could you perhaps explain your particular use case for this?  A few truly 
convincing use-cases might increase the chances of this getting accepted.

--
nosy: +marketdickinson

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4348] bytearray methods returning self

2008-11-19 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

And it turns out I should have looked at the other patch instead. =)

The missing comment from the test still holds. I also think you did not
need to cut out the fast path from translate as much as you did when
there is no deletion. It's still legitimate to goto 'done' if you put
back the work being done in the 'if' statement. You can see my attached
patch to see what I mean.

Otherwise it looks good.

Added file: http://bugs.python.org/file12065/issue4348.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4348] bytearray methods returning self

2008-11-19 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file12047/make_sure_to_copy.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4117] missing update() in _Screen.setup() of Lib/turtle.py

2008-11-19 Thread Martin v. Löwis

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

> I cannot call the Canvas method _update_idletasks() from within
> _Screen.setup() becaus this would contradict to the architecture of the
> module which isolates all direct references to Tkinter to
> TurtleScreenBase. (The idea behind this is to make the module easily
> portable, by porting only this class).

I find that desire misguided; this is (IMO) a case of false abstraction.
Is there any kind of proof that this design actually
works, i.e. can be ported to a different GUI library (like, say,
PythonWin? or AWT, when run in Jython?)

Unless such proof can be provided (and then integrated into the code),
I recommend to give up that objective, and start merging the base class
code into the subclasses where reasonable.

> Did you experience any problems or undesired behaviour
> because of using unly cv.update?

I agree with with gpolo: it's a general Tk programming principle to
defer updates whenever possible. This allows the event handler to return
more quickly, making the system more responsive. Each individual update
call will only contribute a small amount of time to the response time.
It's many of these which eventually make the entire system sluggish.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4348] bytearray methods returning self

2008-11-19 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

make_sure_to_copy.patch seems fine short of adding a comment to the test
referencing this issue.

--
assignee:  -> benjamin.peterson
nosy: +brett.cannon

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4358] Segfault in stringobject.c

2008-11-19 Thread Thomas Heller

Changes by Thomas Heller <[EMAIL PROTECTED]>:


--
assignee: theller -> 
nosy:  -theller

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2306] Update What's new in 3.0

2008-11-19 Thread Brett Cannon

Changes by Brett Cannon <[EMAIL PROTECTED]>:


--
versions: +Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4354] distutils.command.register is broken

2008-11-19 Thread Martin v. Löwis

Changes by Martin v. Löwis <[EMAIL PROTECTED]>:


--
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4358] Segfault in stringobject.c

2008-11-19 Thread Thomas Heller

Thomas Heller <[EMAIL PROTECTED]> added the comment:

Has nothing to do with ctypes (the package), unassigning.

--
components:  -ctypes

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4357] frozen?set operations create incorrectly initialized instances of subclasses

2008-11-19 Thread Amaury Forgeot d'Arc

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

Well, this was changed only three days ago.
Please wait for the next 3.0rc3...

--
nosy: +amaury.forgeotdarc

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4358] Segfault in stringobject.c

2008-11-19 Thread Farshad Khoshkhui

Farshad Khoshkhui <[EMAIL PROTECTED]> added the comment:

Another Backtrace. I have three other core dumps with exact same
backtrace on two different machines.

Added file: http://bugs.python.org/file12064/backtrace2

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4358] Segfault in stringobject.c

2008-11-19 Thread Farshad Khoshkhui

New submission from Farshad Khoshkhui <[EMAIL PROTECTED]>:

I'm encountering random segfaults on multiple machines. By examining
core dumps, it's all happening  in stringobject.c (_PyString_Resize or
string_join). 
By using pyframev I figured out it's always happening inside
xmlrpclib.py (/usr/lib/python2.5/xmlrpclib.py (716): dump_struct or
/usr/lib/python2.5/xmlrpclib.py (627): dumps)

I'm using Python 2.5.2 on debian in a threaded environment with heavy
use of xmlrpc.

--
assignee: theller
components: XML, ctypes
files: backtrace1
messages: 76066
nosy: farshad, theller
severity: normal
status: open
title: Segfault in stringobject.c
type: crash
versions: Python 2.5
Added file: http://bugs.python.org/file12063/backtrace1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4332] asyncore.file_dispatcher does not use dup()'ed fd

2008-11-19 Thread Josiah Carlson

Josiah Carlson <[EMAIL PROTECTED]> added the comment:

Oy.  You are right.  Fixed in Py3k in r67286, in trunk (2.7) in r67287, 
and 2.6-maintenance in r67288.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4357] frozen?set operations create incorrectly initialized instances of subclasses

2008-11-19 Thread Alex Samuel

Alex Samuel <[EMAIL PROTECTED]> added the comment:

In the sample code I attached, z is an instance of MySet under 3.0rc2.  Is 
that expected?

Thanks,
Alex

Mark Dickinson wrote:
> Mark Dickinson <[EMAIL PROTECTED]> added the comment:
> 
> The bug is that the set operations return instances of the subclass,
> rather than instances of set.
> 
> This is already fixed for 3.0: see issue 1721812.  It was deemed too risky 
> to backport the change to 2.x.
> 
> --
> assignee: theller -> 
> components: +Interpreter Core -ctypes
> nosy: +marketdickinson
> resolution:  -> duplicate
> status: open -> closed
> 
> ___
> Python tracker <[EMAIL PROTECTED]>
> 
> ___

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4357] frozen?set operations create incorrectly initialized instances of subclasses

2008-11-19 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

The bug is that the set operations return instances of the subclass,
rather than instances of set.

This is already fixed for 3.0: see issue 1721812.  It was deemed too risky 
to backport the change to 2.x.

--
assignee: theller -> 
components: +Interpreter Core -ctypes
nosy: +marketdickinson
resolution:  -> duplicate
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4357] frozen?set operations create incorrectly initialized instances of subclasses

2008-11-19 Thread Alex Samuel

New submission from Alex Samuel <[EMAIL PROTECTED]>:

Methods of set and frozenset that return new set or frozenset instances
return instances of subclasses, but these instances are not initialized
correctly.  In the attached code sample, z is an instance of MySet but
MySet.__new__ and MySet.__init__ are never called on it.  

It seems to me that such a method should return a fully-initialized
instance of the subclass.  Barring that, it should just return a set or
frozenset instance, not an instance of the subclass.

--
assignee: theller
components: ctypes
files: fs.py
messages: 76062
nosy: alexhsamuel, theller
severity: normal
status: open
title: frozen?set operations create incorrectly initialized instances of 
subclasses
type: behavior
versions: Python 2.5, Python 3.0
Added file: http://bugs.python.org/file12062/fs.py

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4354] distutils.command.register is broken

2008-11-19 Thread Hagen Fürstenau

Hagen Fürstenau <[EMAIL PROTECTED]> added the comment:

Attached new patch without "sys".

Added file: http://bugs.python.org/file12061/distutils_register_2.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4356] Add "key" argument to "bisect" module functions

2008-11-19 Thread Miki Tebeka

Changes by Miki Tebeka <[EMAIL PROTECTED]>:


--
components: +Library (Lib)
type:  -> feature request
versions: +Python 2.7, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4356] Add "key" argument to "bisect" module functions

2008-11-19 Thread Miki Tebeka

New submission from Miki Tebeka <[EMAIL PROTECTED]>:

It'd be helpful of the functions in the "bisect" modules will have a
"key" argument just like "sort".

--
messages: 76060
nosy: tebeka
severity: normal
status: open
title: Add "key" argument to "bisect" module functions

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4340] xmlrpc.client - default 'SlowParser' not defined

2008-11-19 Thread Mike Watkins

Mike Watkins <[EMAIL PROTECTED]> added the comment:

Running the same code today passes, despite the fact I'm still running 
the same svn version. Bizarre. 

However the core reported issue - SlowParser being undefined in the 
module, remains.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4354] distutils.command.register is broken

2008-11-19 Thread Amaury Forgeot d'Arc

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

The patch looks good to me.
You can however remove the "import sys": it is not needed.

--
nosy: +amaury.forgeotdarc

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4323] Wrong encoding in files saved from IDLE (3.0rc2 on Windows)

2008-11-19 Thread Martin v. Löwis

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

Here is a patch that removes the entire IDLE coding option machinery,
thus implementing PEP 3120.

--
keywords: +needs review
Added file: http://bugs.python.org/file12060/remove_coding_option.py

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4355] Error in docs of urllib.request and urllib.parse

2008-11-19 Thread Hagen Fürstenau

New submission from Hagen Fürstenau <[EMAIL PROTECTED]>:

The docs refer to urllib.urlencode instead of urllib.parse.urlencode. A
patch is attached.

--
assignee: georg.brandl
components: Documentation
files: doc_urlencode.patch
keywords: patch
messages: 76056
nosy: georg.brandl, hagen
severity: normal
status: open
title: Error in docs of urllib.request and urllib.parse
versions: Python 3.0
Added file: http://bugs.python.org/file12059/doc_urlencode.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4354] distutils.command.register is broken

2008-11-19 Thread Hagen Fürstenau

New submission from Hagen Fürstenau <[EMAIL PROTECTED]>:

The distutils command "register" has two problems with Python 3.0:

1. The authentication dialog crashes because of a problem with the
functiopn raw_input defined there.

2. Uploading the data fails because of str/bytes confusion.

The attached patch addresses both problems.

--
components: Distutils
files: distutils_register.patch
keywords: patch
messages: 76055
nosy: hagen
severity: normal
status: open
title: distutils.command.register is broken
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file12058/distutils_register.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4338] TypeError (bytes/str) in distutils command "upload"

2008-11-19 Thread Hagen Fürstenau

Hagen Fürstenau <[EMAIL PROTECTED]> added the comment:

I just tested Amaury's patch and it seems to work fine.

There's a similar str/bytes issue with the "register" command, but I'll
open another issue for that.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4309] ctypes documentation

2008-11-19 Thread David W. Lambert

David W. Lambert <[EMAIL PROTECTED]> added the comment:

Changing the string to type byte

'Works'
from ctypes import *
libc = CDLL('libc.so.6')
libc.printf(b'hello')

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4008] IDLE: checksyntax() doesn't support Unicode?

2008-11-19 Thread Martin v. Löwis

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

This patch has two problems:
1. saving files fails, since there is still a call left to the function
coding_spec, but that function is removed.
2. if saving would work: it doesn't preserve the line endings of the
original file when writing it back. If you open files with DOS line
endings on Unix, upon saving, they should still have DOS line endings.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4353] Move description what a trace should should return to settrace from pdb section into sys.settrace section

2008-11-19 Thread rocky bernstein

New submission from rocky bernstein <[EMAIL PROTECTED]>:

This sentence:

  The local trace function should return a reference to itself (or to
another function for further tracing in that scope), or None to turn off
tracing in that scope. 

which appears under "How it [the debugger] Works" (http://docs.python.org
http://docs.python.org/library/pdb.html#debugger-hooks) should appear
under the description of (sys.settrace
http://docs.python.org/library/sys.html) since this really part of the
settrace interface and is not limited to the python debugger, pdb, or
debuggers in general.

--
assignee: georg.brandl
components: Documentation
messages: 76051
nosy: georg.brandl, rocky
severity: normal
status: open
title: Move description what a trace should should return to settrace from pdb 
section into sys.settrace section
type: crash
versions: Python 2.1.1, Python 2.1.2, Python 2.2, Python 2.2.1, Python 2.2.2, 
Python 2.2.3, Python 2.3, Python 2.4, Python 2.5, Python 2.5.3, Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4347] Dependencies of graminit.h are not rebuilt when the file is regenerated

2008-11-19 Thread Thomas Lee

Thomas Lee <[EMAIL PROTECTED]> added the comment:

Updating affected versions. Probably affects 3.x too.

--
versions: +Python 2.7

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4289] Python 2.6 installer crashes when selecting 'advanced' and cancelling it

2008-11-19 Thread Martin v. Löwis

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

Thanks for the report. Fixed in r67283, r67284, and r67285.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4352] imp.find_module() fails with a UnicodeDecodeError when called with non-ASCII search paths

2008-11-19 Thread Amaury Forgeot d'Arc

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

Indeed. It happens when the filesystem encoding is not utf-8.

I have several changes in my local workspace about this, which also deal
with zipimport and other places that import modules.
I suggest to let 3.0 go out and correct all this for 3.1.

--
nosy: +amaury.forgeotdarc

___
Python tracker <[EMAIL PROTECTED]>

___
___
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-11-19 Thread TJ Usiyan

TJ Usiyan <[EMAIL PROTECTED]> added the comment:

same here

--
nosy: +TJ

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4117] missing update() in _Screen.setup() of Lib/turtle.py

2008-11-19 Thread Gregor Lingl

Gregor Lingl <[EMAIL PROTECTED]> added the comment:

I cannot call the Canvas method _update_idletasks() from within
_Screen.setup() becaus this would contradict to the architecture of the
module which isolates all direct references to Tkinter to
TurtleScreenBase. (The idea behind this is to make the module easily
portable, by porting only this class).

So if one followed your proposition one had to change TurtleScreenBase
which would result in a different (additional) patch.

For now I'd like to stick with the one proposed here - I worked a lot
with it, it works and I didn't experience unwanted side effects.

My question: I suppose to change the call self.cv.update() to
self.cv.update_idletasks() in TurtleScreenBase._update wouldn't work
properly so one had to add a new method to TurtleScreenBase - something
like TurtleScreenBase._update_idletasks. Originally I had the intention
to keep this interface as small as possible and use only things that are
really needed. Did you experience any problems or undesired behaviour
because of using unly cv.update? If so, please report it. Perhaps you
could also provide an example.

Regards,
Gregor

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4352] imp.find_module() fails with a UnicodeDecodeError when called with non-ASCII search paths

2008-11-19 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

The example works correctly on Linux (py3k trunk). The problem is maybe 
specific to Windows?

--
nosy: +haypo

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4338] TypeError (bytes/str) in distutils command "upload"

2008-11-19 Thread Amaury Forgeot d'Arc

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


Added file: http://bugs.python.org/file12057/distutils_upload_2.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4338] TypeError (bytes/str) in distutils command "upload"

2008-11-19 Thread Amaury Forgeot d'Arc

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


Removed file: http://bugs.python.org/file12056/distutils_upload_2.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4338] TypeError (bytes/str) in distutils command "upload"

2008-11-19 Thread Amaury Forgeot d'Arc

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

To correct the reported problem, 3 lines are indeed enough.

I just wanted to test my changes, so I ran "setup.py bdist upload" on my
favourite package, even if I expect it to fail at the end because I
don't have a valid PyPI account.

Here are the problems I encountered:
- io.StringIO is used but "import io" is missing
- http = http.client.HTTPConnection() fails because the local variable
has the same name as the imported module
- the http body must be a bytes string

I agree that the change around http.request() is not needed.
Here is another patch with less changes.
It is also more correct that the previous one, now I receive a http 401
error which means that the request was at least understood by the server.

Added file: http://bugs.python.org/file12056/distutils_upload_2.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2008-11-19 Thread Guilherme Polo

Guilherme Polo <[EMAIL PROTECTED]> added the comment:

tk 8.4.19 here, but windows and linux almost surely uses different
window managers (you could run gnome and others under windows, but I'm
betting it is not the case).

Now, it is very hard to say that we shouldn't care about this bug here.
Tcl has it documented that its string arguments to Tcl_CmdProc are
encoded in normalized utf-8 since tcl 8.1 which was released almost 10
years ago. I guess we are just luck that this was the first time the bug
was noticed.

It also says that Tcl_CreateCommand shouldn't be used anymore, instead
Tcl_CreateObjCommand should be used like I said in the previous comment.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4116] name conflict in ScrolledCanvas.__init__() in Lib/turtle.py

2008-11-19 Thread Martin v. Löwis

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

Thanks for the patch. Committed as r67279, r67280, and r67281.

--
resolution:  -> accepted
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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