[issue2889] curses for windows (alternative patch)

2010-08-23 Thread Trundle

Changes by Trundle andy-pyt...@hammerhartes.de:


--
nosy: +Trundle

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



[issue1748064] inspect.getargspec fails on built-in or slot wrapper methods

2010-08-03 Thread Trundle

Changes by Trundle andy-pyt...@hammerhartes.de:


--
nosy: +Trundle

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



[issue8828] Atomic function to rename a file

2010-05-27 Thread Trundle

Changes by Trundle andy-pyt...@hammerhartes.de:


--
nosy: +Trundle

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



[issue8720] undo findsource regression/change

2010-05-14 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

This was changed due to issue #4050.

--
nosy: +Trundle

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2010-01-28 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

Note that the fp gets set with `fill_file_fields()` and that is called after 
the error return of `PyString_FromString()`. Hence, the fp is left open if 
`PyString_FromString()` returns NULL.

--

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2010-01-28 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

`fill_file_fields()` does not open the fp, the caller of `PyFile_FromFile()` 
opens the fp.

I don't have a better idea, that's why I don't have provided a patch.

--

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



[issue7732] imp.find_module crashes Python if there exists a directory named __init__.py

2010-01-18 Thread Trundle

New submission from Trundle andy-pyt...@hammerhartes.de:

Create a directory __init__.py and execute

 import imp
 imp.find_module('__init__', ['.'])

to reproduce that issue. It will crash because Python tries to double-close a 
file pointer: `call_find_module` will call `PyFile_FromFile`, but 
`PyFile_FromFile` closes the file pointer if it's a directory (by decrefing the 
created file object) and ` call_find_module` then closes the already closed 
file.

--
components: Library (Lib)
messages: 98007
nosy: Trundle
severity: normal
status: open
title: imp.find_module crashes Python if there exists a directory named 
__init__.py
type: crash
versions: Python 2.6

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



[issue7006] The replacement suggested for callable(x) in py3k is not equivalent

2009-12-25 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

What Joe Amenta stumbled across is that ABCMeta caches its subclass 
checks. If you call ``isinstance(spam, Callable)`` and after that delete 
`type(spam).__call__`, every other call of ``isinstance(spam, Callable)`` 
will still return True.

--

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



[issue5911] built-in compile() should take encoding option.

2009-11-24 Thread Trundle

Changes by Trundle andy-pyt...@hammerhartes.de:


--
nosy: +Trundle

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

Crashes reliable with a segfault in Python 3.1.1.

Fixing the setter so that one can only set strings and not arbitrary 
objects is possibly the best solution.

--
nosy: +Trundle
versions: +Python 3.1

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



[issue7160] Crash when returning a 64-bit char pointer in Python 2.6.3 ctypes

2009-10-17 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

You are using `CFUNCTYPE` wrong. `CFUNCTYPE` returns a type which will 
take a *Python function* (or an address of a function as integer). You 
provide `lib.get_message` as Python function, which is a wrapper object 
for the C function. By default, ctypes assumes an int as return type for 
C functions. On your platform, the size of an int is not the same as the 
size of a pointer. Therefore, the return value is truncated. You call 
the CFUNCTION which then calls `lib.get_message` which returns the 
truncated pointer as integer and then ctypes tries to make a `c_char_p` 
out of the integer which segfaults because it's truncated.

I think what you are really looking for is ``lib.get_message.restype = 
c_char_p``.

--
nosy: +Trundle

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



[issue7161] raise of SyntaxError in codeop was ported incorrectly to Py3

2009-10-17 Thread Trundle

New submission from Trundle andy-pyt...@hammerhartes.de:

The original lines in Lib/codeop.py under Python 2.6:

raise SyntaxError, err1

Those lines were ported to Python 3 as:

raise SyntaxError(err1)

Which is wrong because `err1` is in both cases an instance of 
`SyntaxError`. Quote from the language reference: If the first object 
is a class, it becomes the type of the exception. The second object is 
used to determine the exception value: If it is an instance of the 
class, the instance becomes the exception value. Therefore, the correct 
translation of that code is: raise err1.

The attached patch fixes the issue.

--
components: Library (Lib)
files: codeop_raise_syntaxerror.patch
keywords: patch
messages: 94185
nosy: Trundle
severity: normal
status: open
title: raise of SyntaxError in codeop was ported incorrectly to Py3
type: behavior
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file15157/codeop_raise_syntaxerror.patch

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



[issue7006] The replacement suggested for callable(x) in py3k is not equivalent

2009-10-03 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

As every type is an instance of `type`, every type also has a
`__call__` attribute which means ``hasattr(type(x), '__call__')`` is
always true. `callable()` checks whether `tp_call` is set on the type,
which cannot be done in Python directly.

--
nosy: +Trundle

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



[issue6952] deprecated conversion from string constant to char *

2009-09-21 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

See also issue #1699259.

--
nosy: +Trundle

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



[issue6745] (curses) addstr() takes str in Python 3

2009-08-27 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

Yes, it uses a version of ncurses which supports wide characters, I
checked that.

I agree that using bytes instead may not be the preferred solution in
Python 3. The point is, currently, it is broken if the user does not
use an utf-8 environment.

--

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



[issue6745] (curses) addstr() takes str in Python 3

2009-08-27 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

Of course it works for you. As you stated in issue #4787, your locale
is 'fr_FR.UTF-8'.

And I don't want Python to guess my terminal's encoding. I want Python
to respect my locale. Which is 'de...@euro', and not utf-8.

--

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



[issue6745] (curses) addstr() takes str in Python 3

2009-08-20 Thread Trundle

New submission from Trundle andy-pyt...@hammerhartes.de:

In Python 3, curses requires a str for addstr() where I think it should
take bytes instead. Otherwise it is impossible to output anything other
than ASCII (which is even more or less stated on top of curses'
documentation).

See the attached script umlaut2x.py for Python 2.6: Outputting
umlauts works fine, both in single-byte and multi-byte environments.

The attached script umlaut3x.py is the same script translated to
Python 3. Note that the output here always seems to be utf-8, which is
plain wrong.

A quick test where I changed addstr() to take bytes instead of str
confirmed that outputting other characters than ASCII would work then
in Python 3, too. There are perhaps more places where the types are
wrong. If someone confirms this issue and it is desired, I could
provide a patch.

--
components: Library (Lib)
files: umlaut2x.py
messages: 91786
nosy: Trundle
severity: normal
status: open
title: (curses) addstr() takes str in Python 3
type: behavior
versions: Python 3.1
Added file: http://bugs.python.org/file14750/umlaut2x.py

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



[issue6745] (curses) addstr() takes str in Python 3

2009-08-20 Thread Trundle

Changes by Trundle andy-pyt...@hammerhartes.de:


Added file: http://bugs.python.org/file14751/umlaut3x.py

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



[issue6243] getkey() can segfault in combination with curses.ungetch()

2009-06-08 Thread Trundle

New submission from Trundle andy-pyt...@hammerhartes.de:

Snippet to reproduce:

import curses

scr = curses.initscr()
curses.ungetch(1025)
scr.getkey()

This is because `keyname()` in `PyCursesWindow_GetKey()` returns NULL
which is passed to `PyString_FromString()` then.

The attached patch fixes the segfault.

--
components: Library (Lib)
files: python_curses_ungetch_getkey.patch
keywords: patch
messages: 89111
nosy: Trundle
severity: normal
status: open
title: getkey() can segfault in combination with curses.ungetch()
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file14234/python_curses_ungetch_getkey.patch

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



[issue6146] markup error in Doc/library/rlcompleter.rst

2009-05-29 Thread Trundle

New submission from Trundle andy-pyt...@hammerhartes.de:

There is a small markup error in the description of Completer objects.
The attached patch fixes this.

--
assignee: georg.brandl
components: Documentation
files: rlcompleter_doc_markup.patch
keywords: patch
messages: 88551
nosy: Trundle, georg.brandl
severity: normal
status: open
title: markup error in Doc/library/rlcompleter.rst
versions: Python 2.7
Added file: http://bugs.python.org/file14118/rlcompleter_doc_markup.patch

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-04-27 Thread Trundle

Trundle andy-pyt...@hammerhartes.de added the comment:

See also issue #1694663.

--

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-04-26 Thread Trundle

Changes by Trundle andy-pyt...@hammerhartes.de:


--
nosy: +gvanrossum

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-04-18 Thread Trundle

Trundle andysmu...@hammerhartes.de added the comment:

The problem is that `type_setattro()` sets the new __new__ attribute
in the type's dict (through `PyObject_GenericSetAttr()`), but the
corresponding slot will never be updated if the new __new__ is a
PyCFunction.

The affected code in `update_one_slot()` was added by Guido van Rossum
in r28090, so maybe he would like to comment on that.

--

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-03-24 Thread Trundle

Trundle andysmu...@hammerhartes.de added the comment:

I think the real problem here is `update_one_slot` and not `object_new`. It
is impossible to set __new__ to a PyCFunction inside Python code, which
may be a feature, but is in fact very irritating.

For example the following snippet:

 class Dict(dict): __new__ = object.__new__
...
 Dict.__new__ is object.__new__
True
 Dict()
{}

I would rather expect this behaviour (or at least that Dict.__new__ is not
object.__new__):

 Dict.__new__ is object.__new__
True
 Dict()
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: object.__new__(Dict) is not safe, use dict.__new__()

The attached patch leads to that behaviour, which also fixes the argument
calling autodetection of `object.__new__`.

--
keywords: +patch
nosy: +Trundle
Added file: http://bugs.python.org/file13408/update_one_slot.patch

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



[issue5543] sys.last_type missing

2009-03-23 Thread Trundle

Trundle andysmu...@hammerhartes.de added the comment:

Is the fix really correct? The documentation clearly states about
`sys.last_type`: These three variables are not always defined; they are set
when an exception is not handled and the interpreter prints an error
message and a stack traceback. And there is already
`traceback.print_exc()`, which is a shorthand for
print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback, limit,
file). So, in my opinion, the previous behaviour was intended behaviour,
and the OP needs to use `traceback.print_exc()`.

--
nosy: +Trundle

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