[issue1741130] struct.pack("I", "foo"); struct.pack("L", "foo") should fail

2009-07-05 Thread Mark Dickinson
Mark Dickinson added the comment: Strange TypeError message fixed in r73858: those pack operations now raise struct.error, like they do for all other integer codes. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed __

[issue1741130] struct.pack("I", "foo"); struct.pack("L", "foo") should fail

2009-07-04 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch that does some general cleanup of the object->integer helper functions in the struct module; in the process, it fixes this bug. With this patch, all conversions from a PyObject to a C integer go through get_pylong, so they're all treated the

[issue1741130] struct.pack("I", "foo"); struct.pack("L", "foo") should fail

2009-07-04 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the patch, Daniel! It certainly fixes the problem. I was planning something a little more drastic, though---I think the struct module could do with a bit of a cleanup in this area. At the moment it's not clear exactly what types should be accepte

[issue1741130] struct.pack("I", "foo"); struct.pack("L", "foo") should fail

2009-05-11 Thread Daniel Diniz
Daniel Diniz added the comment: Mark, Virgil: Thanks for correcting my wrong assessment! The lucky TypeError comes from rev 68120. It looks like that error message in trunk is due to a "PyNumber_And(v, pylong_ulong_mask)" when v isn't a PyNumber. I've added a "get_pylong(v) == NULL" check in t

[issue1741130] struct.pack("I", "foo"); struct.pack("L", "foo") should fail

2009-04-19 Thread Mark Dickinson
Mark Dickinson added the comment: It looks as though this was sort-of fixed sometime between 2.6.1 and 2.6.2. In 2.6.2, I get the following (and results from trunk and 3.0.1 are similar): Python 2.6.2+ (release26-maint:71755, Apr 19 2009, 22:06:02) [GCC 4.0.1 (Apple Inc. build 5490)] on dar

[issue1741130] struct.pack("I", "foo"); struct.pack("L", "foo") should fail

2009-04-02 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> marketdickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1741130] struct.pack("I", "foo"); struct.pack("L", "foo") should fail

2009-04-01 Thread Virgil Dupras
Virgil Dupras added the comment: While the behavior cannot be reproduced in the trunk, in can be reproduced in the 2.6 release: $ python -W ignore Python 2.6.1 (r261:67515, Dec 6 2008, 16:42:21) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin Type "help", "copyright", "credits" or "l

[issue1741130] struct.pack("I", "foo"); struct.pack("L", "foo") should fail

2009-03-30 Thread Daniel Diniz
Daniel Diniz added the comment: Cannot confirm for trunk. -- components: +Extension Modules -None nosy: +ajaksu2, marketdickinson stage: -> test needed type: -> behavior versions: +Python 2.6 -Python 2.5 ___ Python tracker