[issue11133] inspect.getattr_static code execution

2011-02-21 Thread Andreas Stührk
Andreas Stührk added the comment: Updated patch. -- Added file: http://bugs.python.org/file20830/inspect_issue_11133_v2.patch ___ Python tracker <http://bugs.python.org/issue11

[issue11133] inspect.getattr_static code execution

2011-02-21 Thread Andreas Stührk
Andreas Stührk added the comment: > The patch is not sufficient - instances may have a class member "__dict__" > whilst still having an instance __dict__. Sure, but I don't think there is a way how you can access the instance __dict__ in that case inside Python code. At l

[issue11133] inspect.getattr_static code execution

2011-02-20 Thread Andreas Stührk
Andreas Stührk added the comment: Attached is a patch that fixes the issue: The dict methods are now used directly and before every access to an instance's "__dict__" attribute, it is checked that that attribute is really the instance's attribute and not a class attribu

[issue9756] Crash with custom __getattribute__

2011-02-04 Thread Andreas Stührk
Andreas Stührk added the comment: See also issue #10922. -- ___ Python tracker <http://bugs.python.org/issue9756> ___ ___ Python-bugs-list mailing list Unsub

[issue10922] Unexpected exception when calling function_proxy.__class__.__call__(function_proxy)

2011-01-16 Thread Andreas Stührk
Andreas Stührk added the comment: I think this is a duplicate of issue #9756: `methoddescr_call()` checks whether the given argument is acceptable as "self" argument and does so using `PyObject_IsInstance()`. As the class in the given code returns the type of the proxied obje

[issue10874] test_urllib2 shouldn't use is operator for comparing strings

2011-01-09 Thread Andreas Stührk
New submission from Andreas Stührk : See the attached patch (applies to 2.7 and 3.2). -- components: Tests files: test_urllib2.patch keywords: patch messages: 125846 nosy: Trundle, lukasz.langa priority: normal severity: normal status: open title: test_urllib2 shouldn't use is ope

[issue6284] C/API PyErr_AsUnicode()

2011-01-07 Thread Andreas Stührk
Andreas Stührk added the comment: There should also be a call to `PyErr_NormalizeException()`, as `PyErr_Fetch()` can return unnormalized exceptions (see e.g. issue #10756). -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue6

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-04 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue10827> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10756] Error in atexit._run_exitfuncs [...] Exception expected for value, str found

2011-01-03 Thread Andreas Stührk
Andreas Stührk added the comment: So I guess someone should feel responsible and commit that patch. For convenience, I updated the patch to inline the raise. -- Added file: http://bugs.python.org/file20246/issue10756_normalize_exceptions_v2.diff

[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue10814> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Andreas Stührk
Andreas Stührk added the comment: It's documented under "Year 2000 (Y2K) issues": http://docs.python.org/library/time.html#time-y2kissues -- ___ Python tracker <http://bugs.py

[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Andreas Stührk
Andreas Stührk added the comment: Sorry, I meant " years > " of course. -- ___ Python tracker <http://bugs.python.org/issue8013> ___ ___ Pytho

[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Andreas Stührk
Andreas Stührk added the comment: The real problem with years >= is that it is undefined behaviour anyway (see e.g. http://pubs.opengroup.org/onlinepubs/9699919799/functions/asctime.html: "the behavior is undefined if the above algorithm would attempt to generate more than 26

[issue8013] time.asctime segfaults when given a time in the far future

2011-01-01 Thread Andreas Stührk
Andreas Stührk added the comment: Updated patch against py3k branch. -- nosy: +Trundle Added file: http://bugs.python.org/file20213/issue8013_py3k.diff ___ Python tracker <http://bugs.python.org/issue8

[issue10756] Error in atexit._run_exitfuncs [...] Exception expected for value, str found

2010-12-25 Thread Andreas Stührk
Andreas Stührk added the comment: It's because `PyErr_Fetch()` which is used in `atexit_callfuncs()` can return an unnormalized exception (e.g. if the exception is set with `PyErr_SetString()`. "value" is then a string). A simple call to `PyErr_NormalizeException()` f

[issue9319] imp.find_module('test/badsyntax_pep3120') causes segfault

2010-12-15 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue9319> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10509] PyTokenizer_FindEncoding can lead to a segfault if bad characters are found

2010-12-15 Thread Andreas Stührk
Andreas Stührk added the comment: Yes, it is (at the latest since msg124018). -- resolution: -> duplicate status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue9232] Allow trailing comma in any function argument list.

2010-12-13 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue9232> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10509] PyTokenizer_FindEncoding can lead to a segfault if bad characters are found

2010-11-22 Thread Andreas Stührk
Changes by Andreas Stührk : -- keywords: +patch Added file: http://bugs.python.org/file19775/PyTokenizer_FindEncoding_fix.patch ___ Python tracker <http://bugs.python.org/issue10

[issue10509] PyTokenizer_FindEncoding can lead to a segfault if bad characters are found

2010-11-22 Thread Andreas Stührk
New submission from Andreas Stührk : If a non-ascii character is found and there isn't an encoding cookie, a SyntaxError is raised (in `decoding_fgets`) that includes the path of the file (using ``tok->filename``), but that path is never set. You can easily reproduce the crash by

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

2010-11-17 Thread Andreas Stührk
Andreas Stührk added the comment: Note that getkey() is broken, too. I attached a simple script to demonstrate that. If you run it and enter some non-ascii input, you can see that getkey() returns an utf-8 encoded str (in my utf-8 environment at least, I haven't check if it's alway

[issue10351] Add autocompletion for keys in dictionaries

2010-11-09 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue10351> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10378] Typo in results of help(divmod)

2010-11-09 Thread Andreas Stührk
Andreas Stührk added the comment: __builtin__ is the correct name for the module (see http://docs.python.org/library/__builtin__.html, especially the note at the end which is the cause of the confusion), hence this is not a bug. -- nosy: +Trundle

[issue1542677] IDLE shell gives different len() of unicode strings compared to Python shell

2010-10-25 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue1542677> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10174] multiprocessing expects sys.stdout to have a fileno/close method.

2010-10-22 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue10174> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5017] import suds help( suds ) fails

2010-10-21 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue5017> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10159] rlcompleter's tests depend on dict order

2010-10-20 Thread Andreas Stührk
New submission from Andreas Stührk : Some tests in test_rlcompleter make assumptions about the order of the list of names that the completion methods of a Completer object return. That order is not guaranteed and will break when running the tests under e.g. PyPy. The attached patch against

[issue10144] Buffering bug after calling curses function

2010-10-19 Thread Andreas Stührk
Andreas Stührk added the comment: That behaviour is indeed caused by ncurses as it changes the buffer size of stdio. The rationale behind that is explained in a comment in ncurses/tinfo/setbuf.c (http://codesearch.google.com/codesearch/p?hl=en#5KTrgOW2hXs/pub/nslu2/sources/ncurses-5.4.tar.gz

[issue10065] future_builtins' docstring lacks some functions

2010-10-10 Thread Andreas Stührk
New submission from Andreas Stührk : Title says all, attached is a patch against release27-maint that adds them. -- assignee: d...@python components: Documentation files: future_builtins_docstring.patch keywords: patch messages: 118343 nosy: Trundle, d...@python priority: normal

[issue9369] const char* for PyObject_CallMethod and PyObject_CallFunction

2010-10-02 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue9369> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue10006> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9956] memoryview type documentation lacks versionadded

2010-09-26 Thread Andreas Stührk
New submission from Andreas Stührk : Title says all, attached is a patch against trunk (2.7). I'm not familiar with what version is correct for the Python 3 documentation. -- assignee: d...@python components: Documentation files: stdtypes-memoryview-2.7.patch keywords: patch mes

[issue9683] Dead code in py3k inspect module

2010-09-16 Thread Andreas Stührk
Andreas Stührk added the comment: The documentation about `getargvalues()` and the docstrings of `getargspec()` and friends still mention nested lists for args. Should I update the patch or should I create a new issue? -- ___ Python tracker <h

[issue9867] Interrupted system calls are not retried

2010-09-16 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue9867> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9732] Addition of getattr_static for inspect module

2010-09-04 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker <http://bugs.python.org/issue9732> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9756] Crash with custom __getattribute__

2010-09-03 Thread Andreas Stührk
Andreas Stührk added the comment: At least two tests in `test.test_descr` consider that behaviour as a feature: "test_isinst_isclass" and "test_proxy_super". -- ___ Python tracker <http://bu

[issue9756] Crash with custom __getattribute__

2010-09-03 Thread Andreas Stührk
Andreas Stührk added the comment: It's because you can fool `PyObject_IsInstance()` that way: >>> class Spam(object): ... def __getattribute__(self, name): ... if name == '__class__': ... return str ... raise AttributeError ... >>

[issue9744] calling __getattribute__ with wrong instance causes hang up

2010-09-03 Thread Andreas Stührk
Andreas Stührk added the comment: Actually, Python behaves the way you expect it. The problem is that when that exception is created, Python tries to look up the involved class names. To do that, it tries to get the "__class__" attribute (hapens in `getinstclassname()`, which will

[issue9683] Dead code in py3k inspect module

2010-08-26 Thread Andreas Stührk
Andreas Stührk added the comment: The correct call is more something like ``inspect.formatargspec(*inspect.getargspec(f))``, which should work for all (Python) functions in Python 3. In Python 2, tuple unpacking was represented using a nested list for the arguments: >>> def f

[issue9683] Dead code in py3k inspect module

2010-08-25 Thread Andreas Stührk
Changes by Andreas Stührk : -- title: Dead code in pyk inspect module -> Dead code in py3k inspect module ___ Python tracker <http://bugs.python.org/iss

[issue9683] Dead code in pyk inspect module

2010-08-25 Thread Andreas Stührk
New submission from Andreas Stührk : There is some code in the inspect module that is now with the removal of tuple unpacking in arguments in Python 3 no longer needed. The mentioned code does not even work with Python 3 (because ``len(map(...))`` will raise a TypeError). The attached patch

<    1   2