[issue12881] ctypes: segfault with large structure field names

2011-09-02 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: On Fri, Sep 2, 2011 at 4:26 PM, Amaury Forgeot d'Arc rep...@bugs.python.org wrote: Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Certainly the effect of some alloca call with a large value, then the stack overflows. Yeah, I

[issue12764] segfault in ctypes.Struct with bad _fields_

2011-09-02 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: This has been fixed. I verified tip and 2.7. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue5149] syntactic sugar: type coercion on pointer assignment

2011-09-02 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: This is busted for plain old assignment too: Python 3.3.0a0 (default:6374b4ffe00c, Sep 2 2011, 23:50:39) [GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux Type help, copyright, credits or license for more information. from ctypes import * buff

[issue6069] casting error from ctypes array to structure

2011-09-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: On Thu, Sep 1, 2011 at 9:45 AM, Vlad Riscutia rep...@bugs.python.org wrote: Vlad Riscutia riscutiav...@gmail.com added the comment: Meador, I believe this was the first issue on the tracker that got me looking into bitfield allocation. I

[issue12528] Implement configurable bitfield allocation strategy

2011-09-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: As stated, how a particular compiler allocates bitfields is *extremely* implementation specific. There can be differences in implementations between different compilers, different *versions* of the same compiler, and different invocations

[issue12528] Implement configurable bitfield allocation strategy

2011-09-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Hi Vlad, On Thu, Sep 1, 2011 at 1:30 PM, Vlad Riscutia rep...@bugs.python.org wrote: Vlad Riscutia riscutiav...@gmail.com added the comment: Well currently we pack bitfields with an algorithm that uses #ifdefs for GCC and MSVC builds

[issue12880] ctypes: clearly document how structure bit fields are allocated

2011-09-01 Thread Meador Inge
New submission from Meador Inge mead...@gmail.com: As issues like issue6069 and issue11920 allude to, figuring out how 'ctypes' allocates bit-fields is not very clear. The documentation should be enhanced to flesh this out in more detail. As an example, Microsoft documents the VC

[issue6069] casting error from ctypes array to structure

2011-09-01 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- stage: test needed - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6069

[issue6069] casting error from ctypes array to structure

2011-09-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: I opened issue12880 for the doc bug. Closing this one out ... -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6069

[issue11920] ctypes: Strange bitfield structure sizing issue

2011-09-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Hi Steve, There is currently no way to deal with this situation. Vlad has opened issue12528 with a proposal to make the allocation strategy configurable from the 'ctypes' API. Please follow that issue if you are still interested. I am

[issue9030] ctypes variable limits

2011-09-01 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: -theller stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9030

[issue9175] ctypes doesn't build on hp-ux

2011-09-01 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- assignee: theller - nosy: -theller priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9175

[issue6980] fix ctypes build failure on armel-linux-gnueabi with -mfloat-abi=softfp

2011-09-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: This was, in fact, committed already. -- assignee: theller - nosy: +meadori -theller resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue6980] fix ctypes build failure on armel-linux-gnueabi with -mfloat-abi=softfp

2011-09-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Whoops. I meant to post a link to the commit before. It is here: http://hg.python.org/cpython/rev/584db03e5248. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6980

[issue5718] Problem compiling ffi part of build on AIX 5.3.

2011-09-01 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- assignee: theller - nosy: -theller priority: normal - low stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5718

[issue6006] ffi.c compile failures on AIX 5.3 with xlc

2011-09-01 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- assignee: theller - nosy: -theller priority: normal - low stage: - patch review type: - compile error ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6006

[issue12764] segfault in ctypes.Struct with bad _fields_

2011-09-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Vlad, Thanks for the patch. A few nits: 1. The test case is in 'test_bitfields.py'. I think it should go in 'test_structures.py'. 2. The test case would probably be cleaner using a 'with' context manager

[issue12881] ctypes: segfault with large structure field names

2011-09-01 Thread Meador Inge
New submission from Meador Inge mead...@gmail.com: Reproduced on Fedora 15 with tip Python: [meadori@motherbrain cpython]$ ./python Python 3.3.0a0 (default:3102951cc1ce+, Sep 1 2011, 22:19:06) [GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux Type help, copyright, credits or license for more

[issue6069] casting error from ctypes array to structure

2011-08-31 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Hmmm ... Assuming a native VC++ compiler on an x86 machine running Windows, then it doesn't make sense to validate these test cases in such an environment. All the tests are all big-endian. 'ctypes' can't be expected to behave the same

[issue9041] raised exception is misleading

2011-08-30 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: That is a good question. While it is true that errors other than 'PyExc_OverflowError', will be mapped onto a 'TypeError' I don't think that is a bad thing. Any errors that come out of 'PyFloat_AsDouble' should be handled on a case-by-case

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-08-30 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Thanks a lot for committing this for me Amaury. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11241

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-08-25 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: This patch was marked as accepted, but it doesn't seem to be committed. Will someone commit it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11241

[issue8743] set() operators don't work with collections.Set instances

2011-08-18 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- resolution: accepted - stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8743

[issue2651] Strings passed to KeyError do not round trip

2011-08-18 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2651 ___ ___ Python

[issue7433] MemoryView memory_getbuf causes segfaults, double call to tp_releasebuffer

2011-08-18 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7433 ___ ___ Python-bugs-list

[issue10320] printf %qd is nonstandard

2011-08-17 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: I agree that this violates C99, but is this actually causing any real world problems with the platforms Python supports? If so, then we need a test case. This seems low priority -- assignee: theller - nosy: +amaury.forgeotdarc

[issue9651] ctypes crash when writing zerolength string buffer to file

2011-08-17 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Ping. I think this one is OK to commit. -- nosy: +belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9651

[issue12740] Add struct.Struct.nmemb

2011-08-16 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Stefan, it is a constructed failure (I hacked the unit test to break it). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12740

[issue12740] Add struct.Struct.nmemb

2011-08-15 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: On Sun, Aug 14, 2011 at 1:03 PM, Stefan Krah rep...@bugs.python.org wrote: Stefan Krah stefan-use...@bytereef.org added the comment: I like random tests in the stdlib, otherwise the same thing gets tested over and over again. `make

[issue12740] Add struct.Struct.nmemb

2011-08-13 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: The functionality part of the patch looks reasonable. However, the pseudo-randomization in the unit tests seems like a bad idea. Say someone is adding a new feature X. Runs the unit tests to find one of them failing. Then runs them again

[issue12744] inefficient pickling of long integers on 64-bit builds

2011-08-12 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12744 ___ ___ Python-bugs-list

[issue12744] inefficient pickling of long integers on 64-bit builds

2011-08-12 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12744 ___ ___ Python-bugs-list

[issue12738] Bug in multiprocessing.JoinableQueue() implementation on Ubuntu 11.04

2011-08-12 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Michael, It is hard to tell from your description alone where the bug is. Could you provide more detailed reproduction steps with a test case that exhibits the issue? -- nosy: +jnoller, meador.inge stage: - test needed

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-08-12 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Amaury, how about this patch? I got rid of querying the type dictionary and hoisted the creation of the type instance earlier. Then 'PyObject_GetAttrString' can be used to lookup '_length_' and '_type_' by the regular Python attribute lookup

[issue11105] Compiling evil ast crashes interpreter

2011-08-11 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11105 ___ ___ Python-bugs-list

[issue12608] crash in PyAST_Compile when running Python code

2011-08-10 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: I have verified that the code checked in for issue12575 keep the test case from this issue from crashing the interpreter: [meadori@motherbrain cpython]$ ./python test.py Traceback (most recent call last): File test.py, line 14, in module

[issue12608] crash in PyAST_Compile when running Python code

2011-08-10 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: OK, I am marking this as fixed then. If someone decides to fix this in 3.2 or 3.7, then they can reopen the issue. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed

[issue4841] io's close() not handling errors correctly

2011-08-10 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4841 ___ ___ Python

[issue12613] itertools fixer fails

2011-08-10 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12613 ___ ___ Python-bugs-list

[issue12613] itertools fixer fails

2011-08-10 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: I see two problems that cause the posted test cases to fail: 1. The 'next' fixer runs before the 'itertools' fixer and strips out a 'power' node. This keeps the 'itertools' fixer from matching. 2. The 'itertools' fixer does

[issue12608] crash in PyAST_Compile when running Python code

2011-08-06 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Thanks for the test case Albert. The attached patch adds a unit test based off of the given repro case and fixes the bug in the FunctionDef compiler. The compiler was hitting a NULL pointer deref on FunctionDefs with empty list bodies

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-04-18 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: But what happens with a third level? That doesn't work. I have a test case for that, but the test case has a typo that caused it to pass. I will fix the test case and the code. Thanks

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-04-17 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Verified that this is still broken in the main development branch. The base type should be checked for '_type_' or '_length_' before throwing an error. Attached is a patch that fixes the problem and adds covering tests. The full test suite

[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-04-17 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: This doesn't look like it has anything to to with the 'ctypes' library component (http://docs.python.org/library/ctypes). So I am removing 'ctypes' from the 'Components' selection. Please correct me if I am wrong ... -- components

[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-04-17 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- components: +Macintosh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10910 ___ ___ Python-bugs-list

[issue9041] raised exception is misleading

2011-04-16 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: This problem still occurs in the main development branch. I think the 'PyErr_ExceptionMatches' check that Pauli suggested will work. The same problem exist for 'c_float', 'c_double', and 'c_longdouble'. Attached is a patch that fixes

[issue9651] ctypes crash when writing zerolength string buffer to file

2011-04-16 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: This crash still occurs in the main development branch and Amaury's patch still fixes the problem. I verified that all tests pass on OS X 10.6.5. It should be OK to commit. -- assignee: theller - nosy: +meador.inge -theller versions

[issue11477] Bug in code dispatching based on internal slots

2011-03-13 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11477 ___ ___ Python-bugs-list

[issue3132] implement PEP 3118 struct changes

2011-03-12 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Is there still any interest in this work? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3132

[issue3132] implement PEP 3118 struct changes

2011-01-06 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Attached is the latest version of the struct string patch. I tested on OS X 10.6.5 (64-bit) and Ubuntu 10.04 (32-bit). I also scanned for memory problems with Valgrind. There is one test failing on 32-bit systems ('test_crasher

[issue10044] small int optimization

2011-01-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: How is the compiler supposed to know whether a and b belong to the same array when compiling ptr_compare? I agree with Mark, it doesn't need to know. However, many compilers [1,2] support whole program optimization and could in theory figure

[issue9969] tokenize: add support for tokenizing 'str' objects

2010-09-28 Thread Meador Inge
New submission from Meador Inge mead...@gmail.com: Currently with 'py3k' only 'bytes' objects are accepted for tokenization: import io import tokenize tokenize.tokenize(io.StringIO(1+1).readline) Traceback (most recent call last): File stdin, line 1, in module File /Users/minge/Code

[issue9969] tokenize: add support for tokenizing 'str' objects

2010-09-28 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- components: +Library (Lib) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9969 ___ ___ Python-bugs

[issue2180] tokenize: mishandles line joining

2010-09-26 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2180 ___ ___ Python-bugs-list

[issue9788] atexit and execution order

2010-09-12 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: I agree with Antoine's LIFO comment. Also, FWIW, the C standard library behaves in a LIFO manner as well (C99 spec - 7.20.4.3 clause 3): First, all functions registered by the atexit function are called, in the reverse order

[issue9756] Crash with custom __getattribute__

2010-09-05 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: To fix the segfault, I suppose that we use a more strict validation on the input type. Eg. Use PyUnicode_Check() instead of PyObject_IsInstance()? Where would the more strict validation take place? This problem is not unique to Unicode

[issue5109] array.array constructor very slow when passed an array object.

2010-09-02 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Overall, this patch look reasonable. I tested on py3k and the the tests pass. I also did a few micro-benchmarks to verify the speedup. One question I do have, though, is whether the 'len' calculation modifications are necessary? This looks

[issue9633] pdb go stack up/down

2010-09-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: I believe this is slightly tricky because 'bdb.format_stack_entry' makes references to '.f_locals' and 'bdb.format_stack_entry' is invoked in several places in 'pdb'. One option would be to add a extra parameter to 'bdb.format_stack_entry

[issue9633] pdb go stack up/down

2010-08-30 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9633 ___ ___ Python-bugs-list

[issue1172711] long long support for array module

2010-08-24 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Overall the patch looks good. I don't think it is an extremely important feature, but similar support is already available in other places (e.g. 'struct', 'ctypes'). Here is a patch updated for py3k with some minor additions: (1) Fixed

[issue3132] implement PEP 3118 struct changes

2010-08-14 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- assignee: teoliphant - meador.inge priority: critical - high stage: unit test needed - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3132

[issue4188] Lib/threading.py causes infinite recursion when running as verbose

2010-08-03 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +minge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4188 ___ ___ Python-bugs-list mailing list

[issue5248] Adding T_SIZET to structmember.h

2010-08-03 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +minge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5248 ___ ___ Python-bugs-list mailing list

[issue1172711] long long support for array module

2010-08-03 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +minge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1172711 ___ ___ Python-bugs-list mailing

[issue5077] 2to3 fixer for the removal of operator functions

2010-08-01 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Sure. I take it you meant http://svn.python.org/projects/sandbox/trunk/2to3, though. Is this the location that all patches for 2to3 should be produced against? I dropped the documentation changes b/c I did not see any docs in the 2to3 trunk

[issue9249] struct.pack and Long Integer datatype should be 4, but is 8 bytes

2010-08-01 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +minge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9249 ___ ___ Python-bugs-list mailing list

[issue9011] ast_for_factor unary minus optimization changes AST

2010-06-21 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +minge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9011 ___ ___ Python-bugs-list mailing list

[issue8748] integer-to-complex comparisons give incorrect results

2010-05-30 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: [Mark] Can you think of any reason that we shouldn't just copy the py3k implementation ... Not that I can think of. Like you pointed out, we should have removed the coercion from the rich comparison when fixing issue 5211. Thanks for all

[issue8748] integer-to-complex comparisons give incorrect results

2010-05-29 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: I'm not sure that's a good idea: mightn't this change behaviour for user-defined classes with a __coerce__ method? Maybe it would be better to just special-case ints and longs at the start of complex_richcompare, and then leave everything

[issue8748] integer-to-complex comparisons give incorrect results

2010-05-29 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8748 ___ ___ Python-bugs-list

[issue2470] Need fixer for dl (removed) - ctypes module

2010-05-29 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- stage: - needs patch type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2470

[issue8748] integer-to-complex comparisons give incorrect results

2010-05-21 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Hmm. The current Python 2.7 behaviour really is a mess. No doubt! Your patch removes the coercion entirely; Yeah, I know. The funny thing about this is that according to the documentation [1]: Arguments to rich comparison methods

[issue3132] implement PEP 3118 struct changes

2010-05-20 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: is that correct, or should the production list be something like: Yup, you are right. I will change the grammar. Whether these cases are valid or not (personally, I think they should be), we should add some tests for them

[issue8748] integer-to-complex comparisons give incorrect results

2010-05-20 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Thanks for the review. I incorporated the check re-orderings. I am also writing more tests. Which already exposed a subtly that I was not expecting: Python 3.2a0 (py3k:81284M, May 20 2010, 09:08:20) [GCC 4.2.1 (Apple Inc. build 5646

[issue3132] implement PEP 3118 struct changes

2010-05-20 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: As a separate issue, I notice that the new 'T{}' code doesn't respect multiplicities, e.g., as in 'H3T{HHL}'. Is that intentional/desirable? That could have been an oversight on my part. I don't see any immediate reason why we wouldn't

[issue8748] integer-to-complex comparisons give incorrect results

2010-05-20 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Thanks for the updated patch; I'll take a closer look tonight, and apply it if all looks good. I incorporated the changes locally and have not updated the patch yet. I will update it later today

[issue3132] implement PEP 3118 struct changes

2010-05-20 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Granted, yes. But I wouldn't expect the same padding for 'BT{BI}' and 'BBI'. 'BT{BI}' should match a C struct which itself has an embedded struct. For C, I get the following results on my machine: I wasn't sure. The C99 standard does

[issue8748] integer-to-complex comparisons give incorrect results

2010-05-20 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: No problem! I have attached the updated patch. I am starting on the 2.7 patch now. -- Added file: http://bugs.python.org/file17424/issue-8748.2.patch ___ Python tracker rep...@bugs.python.org http

[issue8748] integer-to-complex comparisons give incorrect results

2010-05-20 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: 2.7 patch attached. The implementation is mostly the same as the 3.2 one, but there is one quirk. Namely, 2.7 (and other 2.x's) has the following odd behavior: 1j None False 1j 1 Traceback (most recent call last): File

[issue8748] integer-to-complex comparisons give incorrect results

2010-05-19 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: For a complex number z and an integer i, 'z == i' should be exactly equivalent to 'z.real == i and z.imag == 0.0'. Like you mentioned before a lot of care is taken in 'floatobject.c' to ensure that the comparison is robust. Would

[issue7902] relative import broken

2010-05-19 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Does this patch seem reasonable? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7902

[issue3132] implement PEP 3118 struct changes

2010-05-18 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Sure - http://codereview.appspot.com/1258041 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3132

[issue3132] implement PEP 3118 struct changes

2010-05-17 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Attached is a patch that implements part of the additions. More specifically, the 'T{}' syntax and the ability to place byte-order specifiers ('', '', '@', '^', '!, '=') anywhere in the struct string. The changes dictated by the PEP are so

[issue7355] Struct incorrectly compiles format strings

2010-04-12 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: wonder whether they should be converted to little-endian I thought about that as well. It sure would make creating new examples easier :) I had to construct the new examples by hand. I can regenerate the examples for little-endian if you

[issue7355] Struct incorrectly compiles format strings

2010-04-12 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Sure, if you want to. [Then I won't be able to reproduce what's in the docs on either of my machines. :) One's 32-bit big-endian; the other's 64-bit little-endian.] I guess it's painful either way. I think the only fair thing to do

[issue7355] Struct incorrectly compiles format strings

2010-04-12 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Those last two sentences where meant to be in response to your Merged your changes and subsequent tweaks to py3k in r80016. comment. I tried to reply to the tracker from my mail client and things got reformatted

[issue7433] MemoryView memory_getbuf causes segfaults, double call to tp_releasebuffer

2010-04-11 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +minge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7433 ___ ___ Python-bugs-list mailing list

[issue7355] Struct incorrectly compiles format strings

2010-04-10 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +minge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7355 ___ ___ Python-bugs-list mailing list

[issue7355] Struct incorrectly compiles format strings

2010-04-10 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: I'm half-convinced that struct.pack *should* ideally add trailing padding in the same situation that C does, for consistency with C. Then calcsize would match C's sizeof. Maybe... AFAIK, the C language does not mandate structure padding

[issue7355] Struct incorrectly compiles format strings

2010-04-10 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: would be to add enough padding so that the alignment of the struct matches the largest alignment of any member of the struct. That might work. I will have to think about it a bit. On the subject of documentation Attached a doc patch which

[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-04 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Looks good to me. -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8300

[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-03 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: I may be missing something subtle, but how can 'PyNumber_Index(v) != NULL' *and* '!PyInt_Check(v) !PyLong_Check(v)' both be satisfied in the 'get_pylong' mods? It seems to me that 'PyNumber_Index' only returns non-NULL when the object being

[issue7994] object.__format__ should reject format strings

2010-03-30 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Hi Eric, (-2) and (-3) are different. The changes that I made, however, are pretty minor. Also, they are all in 'test_builtin.py'. -- ___ Python tracker rep...@bugs.python.org http

[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-08 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: (2) For 2.x, I'm a bit uncomfortable with introducing the extra Python layer on top of the C layer. Partly I'm worried about accidentally breaking something (it's not 100% clear to me whether there might be hidden side-effects

[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-06 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: If anyone's interested in submitting a patch, it would be welcome. Sure. I saw where this was partly addressed in r78690. The attached patch adds support for the '__index__' conversion that Mark suggested. At first glance, the patch may

[issue8039] precedence rules for ternary operator

2010-03-06 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: It seems to me from the grammar (http://docs.python.org/reference/expressions.html#grammar-token-conditional_expression) that the precedence for conditional expressions fall in between that of 'lambda' and 'or' expressions. -- keywords

[issue7232] Support of 'with' statement fo TarFile class

2010-02-28 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: This is common practice in the standard library. This doesn't necessarily mean it is a correct practice :-). All kidding aside, I think the assumption that the standard documentation on '__enter__' and '__exit__' is sufficient is a bad one

[issue7232] Support of 'with' statement fo TarFile class

2010-02-27 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: What about changing the exception test to something like what I did in issue7232.4.diff? That is definitely more succinct, but Lars' solution provides more information about _why_ the test fails. IMHO, the descriptiveness is more important

[issue7994] object.__format__ should reject format strings

2010-02-25 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: The patch looks reasonable. I built on it with the following changes: 1. Added some extra test cases to cover Unicode format strings, since the code was changed to handle these as well. 2. Changed test_builtin.py by s/m[0

[issue7232] Support of 'with' statement fo TarFile class

2010-02-24 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Built on Brian's patch by adding the following items: * Added a unit test case to cover exceptional conditions. * Added doc strings on __enter__ and __exit__ (more consistent with the surrounding code). * Spelling error in doc

<    1   2   3   4   5   6   7   >