[issue2542] PyErr_ExceptionMatches must not fail

2008-04-04 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Daniel, IMO you've found a separate bug. I added it as issue #2548. __ Tracker <[EMAIL PROTECTED]> <http://bugs.

[issue2543] Make ctypes compatible with Python 2.3, 2.4, and 2.5, as per PEP291

2008-04-04 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Committed as rev 62143. -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs

[issue2544] link with "gcc -shared" on HP systems

2008-04-04 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Committed as rev 62145. -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs

[issue2551] Python 2.6a2 on Solaris 10 built with SUN C

2008-04-04 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: On *nix-like systems, ctypes will most likely only compile with gcc. Since I do not have access to such systems, neither the expertise for them, this will not change unless someone provides patches. -- nosy: +t

[issue2552] test_ctypes failed Python 2.6a2 Solaris 10 SUN C

2008-04-05 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: I'm curious: Why do you insist on using the sun compiler? Are there political or technical reasons? Another thing: in principle it should be possible to build a libffi shared library with gcc, and use it in a sun-c compiled p

[issue2292] Missing *-unpacking generalizations

2008-04-05 Thread Thomas Wouters
Thomas Wouters <[EMAIL PROTECTED]> added the comment: Updated patch: reworked some internals, and added generalization of functioncalls after talking with Guido. *args is now considered just another positional argument, and can occur anywhere in the positional argument section. It can also

[issue2292] Missing *-unpacking generalizations

2008-04-05 Thread Thomas Wouters
Changes by Thomas Wouters <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9673/morestar.diff __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2292> __

[issue2292] Missing *-unpacking generalizations

2008-04-05 Thread Thomas Wouters
Thomas Wouters <[EMAIL PROTECTED]> added the comment: No, it's what you asked for in msg63551: > How about dicts? > kwds = {'z': 0, 'w': 12} > {'x': 1, 'y': 2, **kwds} # {'x': 1, 'y': 2, 'z': 0, &#

[issue2292] Missing *-unpacking generalizations

2008-04-07 Thread Thomas Wouters
Thomas Wouters <[EMAIL PROTECTED]> added the comment: Agreed. A PEP was already on my TODO list (although I don't mind if someone else picks it up :-) I implemented the dict-unpacking-in-dict-literal syntax in the mean time; it's pushed to the starunpack bzr branch, but I&#x

[issue2292] Missing *-unpacking generalizations

2008-04-07 Thread Thomas Wouters
Thomas Wouters <[EMAIL PROTECTED]> added the comment: On Mon, Apr 7, 2008 at 9:00 PM, Alexander Belopolsky <[EMAIL PROTECTED]> wrote: > > Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: > > Thomas, > > Could you add BUILD_*_UNPACK opcodes document

[issue2292] Missing *-unpacking generalizations

2008-04-07 Thread Thomas Wouters
Changes by Thomas Wouters <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9970/unnamed __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2292> __ _

[issue2292] Missing *-unpacking generalizations

2008-04-07 Thread Thomas Wouters
Thomas Wouters <[EMAIL PROTECTED]> added the comment: I'm not sure how this matters. The order of evaluation is the same, the BUILD_SET implementation just hashes the evaluated items in a different order. You can't really rely on that particular order as it's tied

[issue2292] Missing *-unpacking generalizations

2008-04-07 Thread Thomas Wouters
Thomas Wouters <[EMAIL PROTECTED]> added the comment: I don't think the order in which the items are hashed is really what Raymond was worried about. Rather, the size of the stack was, and the effect of having all the items on the stack at the same time. I think Raymond is wrong i

[issue2616] ctypes.pointer(), ctypes.POINTER() speedup

2008-04-11 Thread Thomas Heller
New submission from Thomas Heller <[EMAIL PROTECTED]>: This patch implements the POINTER() and the pointer() function in C; giving a speedup of roughly a factor of 2. -- assignee: theller components: ctypes files: ctypes-pointer.diff keywords: patch, patch messages: 65356 nosy: t

[issue2559] atom sorting error when building ctypes

2008-04-11 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: I see this also, on Leopard x86. The linker error is not printed on Tiger PPC. At least, the ctypes test suite does work ok so it may be that it can be ignored. Googling for this error, I find that it may be related to linker change

[issue2559] atom sorting error when building ctypes

2008-04-14 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: So closing this as won't fix. -- resolution: -> wont fix status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http:/

[issue1797] ctypes function pointer enhancements

2008-04-14 Thread Thomas Heller
Changes by Thomas Heller <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9129/ctypes-funcptr.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue1797] ctypes function pointer enhancements

2008-04-14 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Remove useless file (doesn't contain a patch). __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1797> __

[issue2616] ctypes.pointer(), ctypes.POINTER() speedup

2008-04-14 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Committed a slightly modified patch as rev 62338; will also be merged into py3k. -- resolution: -> accepted status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs

[issue2655] Create ctypes instances from buffer interface

2008-04-18 Thread Thomas Heller
New submission from Thomas Heller <[EMAIL PROTECTED]>: This patch implements a .from_buffer(source, offset=0) class method from ctypes types. 'source' must expose a writeable buffer interface; the created ctypes instance will share the internal buffer of the source object;

[issue2655] Create ctypes instances from buffer interface

2008-04-18 Thread Thomas Heller
Changes by Thomas Heller <[EMAIL PROTECTED]>: -- type: -> behavior __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2655> __ ___ Python-b

[issue2680] gotcha: _fields_ is final but accepts lists

2008-04-24 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: > The __slots__ member of a class object has the same behavior. > You may mutate it (even replace it) but this has no effect: only the > value available when the "class" statement was executed is relevant. The rules i

[issue2655] Create ctypes instances from buffer interface

2008-04-24 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: The suggestion by Lenard Lindstrom was an additional method named 'from_buffer_copy'. __ Tracker <[EMAIL PROTECTED]> <http://

[issue2682] cyclic reference in ctypes CFunctionType objects

2008-04-24 Thread Thomas Heller
New submission from Thomas Heller <[EMAIL PROTECTED]>: Zachary Pincus posted a message about this cyclic reference in ctypes CFunctionType objects. The reference has the problem that these objects are cleaned up later than expected. The attached patch fixes this problem by removing the

[issue2680] gotcha: _fields_ is final but accepts lists

2008-04-24 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Closing as won't fix. -- resolution: -> wont fix status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http:/

[issue2682] cyclic reference in ctypes CFunctionType objects

2008-04-24 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: > Can you please elaborate your (apparent) concerns about this patch? IOW, > why did you not check it in? I have no concerns about the patch, and I am currently committing it. I'm uploading so that I can points others to i

[issue2682] cyclic reference in ctypes CFunctionType objects

2008-04-24 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Fixed in trunk and py3k, committed as rev 62481 (trunk), rev 62484 (py3k). I'll leave this open until the decision about backporting to release25-maint is made. -- resolution: -> accepted

[issue2682] cyclic reference in ctypes CFunctionType objects

2008-04-25 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: >> Can you please elaborate your (apparent) concerns about this patch? IOW, >> why did you not check it in? > > I have no concerns about the patch, and I am currently committing it. > I'm uploading so tha

[issue2655] Create ctypes instances from buffer interface

2008-04-25 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Implemented from_buffer() and from_buffer_copy() as rev 62497 to SVN trunk. -- resolution: -> accepted status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs

[issue2655] Create ctypes instances from buffer interface

2008-04-25 Thread Thomas Heller
Changes by Thomas Heller <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10057/from_buffer.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue2692] bytes object wrongly exposes writeable buffer interface

2008-04-25 Thread Thomas Heller
New submission from Thomas Heller <[EMAIL PROTECTED]>: IIUC, the bytes object should be immutable (in contrast to bytearray). But PyObject_FromWriteBuffer() does not fail. It seems that the attached patch fixes it; however there are lots of failures in the testsuite with the patch

[issue2682] cyclic reference in ctypes CFunctionType objects

2008-04-25 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Also fixed in release25-maint, rev 62504. -- resolution: accepted -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs

[issue2725] Handle ASDLSyntaxErrors gracefully

2008-04-30 Thread Thomas Lee
New submission from Thomas Lee <[EMAIL PROTECTED]>: The current code in Parser/asdl.py doesn't handle syntax errors very well. A minor problem to be sure, since the net result is the same (i.e. build fails), but the error message being displayed is entirely unhelpful to the deve

[issue1971] ctypes exposing the pep 3118 buffer interface

2008-04-30 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Instead of waiting for review I've committed this as rev 62597. -- assignee: -> theller resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> <htt

[issue2692] bytes object wrongly exposes writeable buffer interface

2008-04-30 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Duplicate of issue #2538. -- resolution: -> duplicate status: open -> closed __ Tracker <[EMAIL PROTECTED]> <http://bugs

[issue2538] memoryview of bytes is not readonly

2008-04-30 Thread Thomas Heller
Changes by Thomas Heller <[EMAIL PROTECTED]>: -- nosy: +theller __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2538> __ ___ Python-bugs-list mailin

[issue2760] Recent change in socket.py breaks urllib2

2008-05-04 Thread Thomas Herve
New submission from Thomas Herve <[EMAIL PROTECTED]>: The problematic change is here: http://svn.python.org/view/python/trunk/Lib/socket.py?rev=62627&r1=61008&r2=62627 The following script shows the problem: Python 2.6a2+ (trunk:62707, May 4 2008, 19:13:44) [GCC 4.2.3 (Ubuntu

[issue2764] c_char doesn't implement py3k buffer interface

2008-05-04 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Thanks for your efforts, Christian. This test needs an object which implements the readonly buffer interface. Unfortunately the bytes object that I would like to use is broken: http://bugs.python.org/iss

[issue1346238] A constant folding optimization pass for the AST

2008-05-07 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: I'm working on the AST optimization code for 2.7 (?) in the tlee-ast-optimize branch. I've since adopted some of the ideas from this patch, but I'll take another look when I get a chance. The folding operation is al

[issue4113] functools.partial(), no __name__; wrong __doc__

2008-10-19 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: Here's a patch against the 2.x trunk. Basically just dispatches reads of a partial's __name__ and __doc__ attributes to the underlying function object. -- keywords: +patch nosy: +thomas.lee Added file: http://bugs.pyth

[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

2008-10-19 Thread Thomas Lee
New submission from Thomas Lee <[EMAIL PROTECTED]>: For XML elements containing only text data, it would be nice if toprettyxml could omit the whitespace it normally injects before & after the text, e.g. Bob Becomes: Bob >From what I understand th

[issue4113] functools.partial(), no __name__; wrong __doc__

2008-10-19 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: I actually agree with the sentiment Georg. Would it instead be useful to maybe provide a __repr__ implementation that describes the state of the partially applied function? I guess this is an entirely different issue, maybe one for python

[issue4260] ctypes.xFUNCTYPE are decorators.

2008-11-06 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: [David Lambert] > > @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int)) > > def py_cmp_func(*args): > > (a,b,) = (t[0] for t in args) > > print("py_cmp_func", a, b) > > return a-b >

[issue4264] Patch: optimize code to use LIST_APPEND instead of calling list.append

2008-11-06 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: Neal said: > I was surprised to see the change to the AST, but I understand why you did it. The problems David ran into here sound like an argument for arbitrary AST annotations -- an idea that I was toying with around the time &q

[issue887237] Machine integers

2008-11-15 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: I wonder if a patch for ctypes like this (which is not yet complete) could be used to implement this, or MUST it be implemented in C? The patch contains a mixin class that implements the numeric methods. However, the actual operation

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

2008-11-18 Thread Thomas Lee
New submission from Thomas Lee <[EMAIL PROTECTED]>: It's important that dependencies of grammar.h get rebuilt if graminit.h is regenerated (e.g. the Grammar is modified). If these dependencies do not get rebuilt, the constants associated with each type of parse node will have inconsis

[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]> <http://bugs.pytho

[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]> <http://bugs.pytho

[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]> <http://bugs.py

[issue4427] Docs for 'y' Py_BuildValue tag are wrong

2008-11-25 Thread Thomas Heller
Changes by Thomas Heller <[EMAIL PROTECTED]>: -- assignee: georg.brandl components: Documentation files: doc.patch keywords: patch, patch nosy: georg.brandl, theller severity: normal stage: patch review status: open title: Docs for 'y' Py_BuildValue tag are wrong vers

[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-25 Thread Thomas Heller
New submission from Thomas Heller <[EMAIL PROTECTED]>: ctypes raises UnicodeDecodeError in german windows (it should print 'Unzulässige Funktion'): >>> from ctypes import FormatError [46681 refs] >>> FormatError(1) Traceback (most recent call last): File

[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-25 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: The simple patch (ctypes-simple.patch) uses the 'y' format tag for PyBuild_Value to build a bytes object as error message. -- keywords: +patch Added file: http://bugs.python.org/file12129/cty

[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-25 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: The 'better' patch changes the internal FormatError function to return a wide string; so conversion from ascii to unicode by Python functions is not needed and it returns strings to the caller: >>> from ctypes impor

[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-25 Thread Thomas Heller
Changes by Thomas Heller <[EMAIL PROTECTED]>: -- keywords: +needs review ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4429> ___ _

[issue4433] _ctypes.COMError crash

2008-11-26 Thread Thomas Heller
New submission from Thomas Heller <[EMAIL PROTECTED]>: The following code, which only works on Windows, crashes with an access violation somewhere in the garbage collector in a debug build: >>> import _ctypes [43470 refs] >>> _ctypes.COMError(1, 2, 3) The problem is th

[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-26 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Thanks for the review. I commited the 'better' patch plus a NEWS entry as svn rev. 67391. -- resolution: -> fixed status: open -> closed type: -> crash ___ Python

[issue4433] _ctypes.COMError crash

2008-11-26 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Thanks for the review; committed as svn rev. 67402. -- resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> <http://bugs

[issue4376] Nested ctypes 'BigEndianStructure' fails

2008-11-27 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Currently, the _fields_ of ctypes Structures with non-native byte order can only contain simple types (like int, char, but not pointers), and arrays of those. Since this is all Python code (in Lib/ctypes/endian.py) it should be possi

[issue4376] Nested ctypes 'BigEndianStructure' fails

2008-11-27 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Correction: >> Since this is all Python code (in Lib/ctypes/_endian.py) it should be ___ Python tracker <[EMAIL PROTECTED]> <http://bugs

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

2008-12-01 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: A deeper issue here is that Parser/parsetok.c has a dependency on graminit.h. The problem is that Parser/parsetok.c is a part of the Parser/pgen program which is actually being used to *generate* graminit.h in the first place. This breaks

[issue4347] Circular dependency causes SystemError when adding new syntax

2008-12-01 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: I mean pgen's dependency on graminit.h, not the parser's. :) ___ Python tracker <[EMAIL PROTECTED]> <http://

[issue4347] Circular dependency causes SystemError when adding new syntax

2008-12-01 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: okay, so it turns out that putting rules in Grammar/Grammar before the top-level non-terminals breaks things in a different way. Attached is another (hopefully final and working) patch. Added file: http://bugs.python.org/file12185

[issue4347] Circular dependency causes SystemError when adding new syntax

2008-12-01 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: Here's a new patch that I believe should fix this issue. It modifies Makefile.pre.in to include a few additional dependency declarations for source files that depend on Include/graminit.h and Include/Python-ast.h, as well as moving en

[issue4347] Circular dependency causes SystemError when adding new syntax

2008-12-02 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: Thanks for the review Brett, apologies for the mess. I'm attaching two new patches -- one for review, the other containing the generated files. These differ very slightly from the original patch -- mainly just removing some stuff I

[issue4347] Circular dependency causes SystemError when adding new syntax

2008-12-02 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: And here's the patch for review. Added file: http://bugs.python.org/file12209/build-evilness-fix-03-review.patch ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.

[issue1615] descriptor protocol bug

2008-12-09 Thread Thomas Lee
Thomas Lee <[EMAIL PROTECTED]> added the comment: Related reading from a few years back: http://coding.derkeiler.com/Archive/Python/comp.lang.python/2005-05/msg03829.html -- nosy: +thomas.lee ___ Python tracker <[EMAIL PROTECTE

[issue4303] [2.5 regression] ctypes fails to build on arm-linux-gnu

2008-12-10 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: Is this really a regression? I do not think so; the libffi library included with the Python 2.5 ctypes does not support closures on the arm. See file Modules/_ctypes/libffi/src/arm/ffitarget.h, it contains '#define FFI

[issue4303] [2.5 regression] ctypes fails to build on arm-linux-gnu

2008-12-10 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: > It seems that ffi_info moved into ctypes.h: could that have caused the > breakage? Not sure what you mean exactly (there is no ffi_info in ctypes.h), but I assume you are referring to sv

[issue887237] Machine integers

2008-12-10 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> added the comment: >> One difficulty with the patch is that the original ctypes code >> contained a tp_as_number ... >This can be solved by changing the order of bases for c_ classes. >See attached. Cool! Why didn&

[issue4632] Wrong fix for range(42)[::-1]

2008-12-11 Thread Thomas Heller
New submission from Thomas Heller <[EMAIL PROTECTED]>: The 2to3 fixer translates this code: range(42)[::-1] into this one: list(range(42)[::-1] which throws an error when run with Python 3: Traceback (most recent call last): File "test.py", line 1, in print(lis

[issue4636] bdist_wininst installer with install script raises exception

2008-12-11 Thread Thomas Heller
New submission from Thomas Heller : Running a bdist_wininst installer that contains a install script, with python 3, raises an exception. This is displayed in the gui: ImportError: No module named __builtin__ *** run_installscript: internal error 0x *** This is probably because the

[issue4646] distutils chokes on empty options arg in the setup function

2008-12-12 Thread Thomas Heller
New submission from Thomas Heller : Distutils setup function accepts an 'options' named argument which allows to pass options to subcommands in a dictionary (At the moment I cannot find where this is documented). When an empty dictionary is passed, distutils spits out a warning: C:\s

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-03 Thread Thomas Finley
New submission from Thomas Finley : This is a patch for the Python 3.1 build checked out from http://svn.python.org/projects/python/branches/py3k The current behavior of itertools.combinations(iterable,r) and itertools.permutations(iterable,r) is to throw a ValueError if iterable yields fewer

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Thomas Finley
Thomas Finley added the comment: Hi Raymond, thanks for your well reasoned and thorough reply. Just a couple small thoughts... I'll borrow your numbers if you don't mind. 1. I'd ask you to discount this argument. There are many situations in the Python library where em

[issue4861] fix problems with ctypes.util.find_library

2009-01-07 Thread Thomas Heller
Thomas Heller added the comment: Matthias Klose schrieb: > there are some problems with ctypes.util.find_library(), which I would > like to see fixed on active branches. > > - find_library is not robust, if either objdump or gcc are not >installed. fixed by raising an e

[issue4867] crash in ctypes when passing a string to a function without defining argtypes

2009-01-08 Thread Thomas Heller
Thomas Heller added the comment: The patch is fine, no need for another diff. -- resolution: -> accepted versions: +Python 3.1 ___ Python tracker <http://bugs.python.org/iss

[issue4867] crash in ctypes when passing a string to a function without defining argtypes

2009-01-08 Thread Thomas Heller
Thomas Heller added the comment: Fixed in release30-maint, rev. 68402 and py3k, rev. 68401. Thanks for the patch. -- resolution: accepted -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue2396] Backport memoryview object to Python 2.7

2009-01-10 Thread Thomas Heller
Changes by Thomas Heller : -- nosy: +theller ___ Python tracker <http://bugs.python.org/issue2396> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4347] Circular dependency causes SystemError when adding new syntax

2009-01-17 Thread Thomas Lee
Thomas Lee added the comment: Brett, any feedback on this one? ___ Python tracker <http://bugs.python.org/issue4347> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1835] Update version number in __init__.py

2009-02-05 Thread Thomas Heller
Thomas Heller added the comment: > The distutils version number is now updated automatically by the Python > release process, so the comment in that file can be removed. How does this mechanism work? I'm wondering if I should use a similar mechanism for the ctypes ver

[issue4347] Circular dependency causes SystemError when adding new syntax

2009-02-09 Thread Thomas Lee
Thomas Lee added the comment: This would appear to be another build quirk: Lib/symbol.py needs to be regenerated if Grammar/Grammar changes. Brett, do you think it would be okay for this file to be generated automatically as part of the build process? I can't think of any good reason why

[issue5203] ctypes segfaults when passing a unicode string to a function without argtypes

2009-02-10 Thread Thomas Heller
Thomas Heller added the comment: Fixed in trunk (rev 69505) and release26-maint (rev 69506). The bug was already fixed in a different way in py3k and release30-maint although in a different way, I merged this exact fix anyway (rev 69507 and rev 69508). Thanks. -- resolution: -> fi

[issue1552880] Unicode Imports

2009-02-11 Thread Thomas Heller
Changes by Thomas Heller : -- nosy: +theller ___ Python tracker <http://bugs.python.org/issue1552880> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue850997] mbcs encoding ignores errors

2009-02-14 Thread Thomas Heller
Changes by Thomas Heller : -- nosy: -theller ___ Python tracker <http://bugs.python.org/issue850997> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46960] Docs: Link from settrace to frame

2022-03-08 Thread Thomas Guettler
New submission from Thomas Guettler : https://docs.python.org/3.10/library/sys.html#sys.settrace > Trace functions should have three arguments: frame, event, and arg. frame is > the current stack frame. It would be super cool, if "current stack frame" could be a hyperlink to

[issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are.

2022-03-10 Thread Thomas Fischbacher
New submission from Thomas Fischbacher : The Python reference says: (1) https://docs.python.org/3/library/exceptions.html#concrete-exceptions exception AssertionError Raised when an assert statement fails. (2) https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement

[issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are.

2022-03-10 Thread Thomas Fischbacher
Thomas Fischbacher added the comment: The documentation of exceptions in the reference is one of the places that makes the life of users substantially harder than it ought to be, since the documentation appears to not have been written with the intent to give guarantees that users can

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
New submission from Thomas Grainger : importing a module with bytes in `sys.path` fails with: File "", line 182, in _path_isabs TypeError: startswith first arg must be bytes or a tuple of bytes, not str (see reproducer in attached demo.py) however `sys.path` is documented as

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Change by Thomas Grainger : -- components: +Library (Lib) versions: +Python 3.10, Python 3.11, Python 3.9 ___ Python tracker <https://bugs.python.org/issue47

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +29993 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31897 ___ Python tracker <https://bugs.python.org/issu

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: this is a regression from 3.2: ``` Python 3.2.6 (default, Jan 18 2016, 19:21:14) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tempfile >>>

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: https://docs.python.org/3/reference/import.html#path-entry-finders says "The encoding of bytes entries is determined by the individual path entry finders." see https://github.com/python/cpython/commit/82c1c781c7ee6496bd4c404b7ba972

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: interestingly bytes filenames pointing to zip files on sys.path do support bytes (see zipfile_demo.py) -- Added file: https://bugs.python.org/file50679/zipfile_demo.py ___ Python tracker <https://bugs.python.

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: zipimporter.zipimporter handles non-bytes paths here: https://github.com/python/cpython/blob/2cf7f865f099db11cc6903b334d9c376610313e8/Lib/zipimport.py#L65-L67 I think FileFinder should do the same -- ___ Python

[issue47026] BytesWarning in zipimport paths on sys.path

2022-03-15 Thread Thomas Grainger
New submission from Thomas Grainger : importing from a bytes zipimport path on sys.path results in a BytesWarning: Comparison between bytes and string running the reproducer with `python -b` shows: python -b zipfile_demo.py :1345: BytesWarning: Comparison between bytes and string see also

[issue47025] bytes do not work on sys.path

2022-03-16 Thread Thomas Grainger
Thomas Grainger added the comment: > I'd advocate for not supporting bytes paths and instead updating the > documentation to require strings. I've got PR GH-31934 started to do this -- message_count: 8.0 -> 9.0 pull_requests: +30026 pull_request: https://github

[issue47085] missing frame.f_lineno on JUMP_ABSOLUTE

2022-03-21 Thread Thomas Grainger
New submission from Thomas Grainger : the following code prints: import sys import dis import pprint def demo(): for i in range(1): if i >= 0: pass class Tracer: def __init__(self): self.events = [] def trace(self, frame, event,

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2022-03-22 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch nosy: +graingert nosy_count: 4.0 -> 5.0 pull_requests: +30134 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/32044 ___ Python tracker <https://bugs.p

[issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are.

2022-03-24 Thread Thomas Fischbacher
Thomas Fischbacher added the comment: Addendum Serhiy, I agree that my assessment was incorrect. It actually is unittest/mock.py that has quite a few 'raise AssertionError' that are not coming from an 'assert' keyword statement. At a deeper level, the problem here i

[issue47121] math.isfinite() can raise exception when called on a number

2022-03-25 Thread Thomas Fischbacher
New submission from Thomas Fischbacher : >>> help(math.isfinite) isfinite(x, /) Return True if x is neither an infinity nor a NaN, and False otherwise. So, one would expect the following expression to return `True` or `False`. We instead observe: >>> math.isfinite(1

<    1   2   3   4   5   6   7   8   9   10   >