Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue1023290] Conversion of longs to bytes and vice-versa.

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 14, 2009, 12:38 PM

Post #1 of 4 (263 views)
Permalink
[issue1023290] Conversion of longs to bytes and vice-versa.

Alexandre Vassalotti <alexandre [at] peadrop> added the comment:

Here's an updated patch.

- Renamed tobytes() to to_bytes() and frombytes() to from_bytes().
- Moved the changes to pickle to a different patch.
- Made the NULL-checks more consistent with the rest of long's code.
- Fixed the type check of the `length' parameter of to_bytes() to use
PyIndex_Check() instead of PyLong_Check().

----------
dependencies: +Move the special-case for integer objects out of PyBytes_FromObject.
Added file: http://bugs.python.org/file15333/long_and_bytes_conversion-3.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1023290>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 25, 2009, 3:58 PM

Post #2 of 4 (210 views)
Permalink
[issue1023290] Conversion of longs to bytes and vice-versa. [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

The following example is strange:

+ >>> int.from_bytes([255, 0, 0], byteorder='big')
+ -65536

Isn't `signed` supposed to be False by default?
The rest looks ok.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1023290>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 26, 2009, 1:38 AM

Post #3 of 4 (206 views)
Permalink
[issue1023290] Conversion of longs to bytes and vice-versa. [In reply to]

Mark Dickinson <dickinsm [at] gmail> added the comment:

Looks good to me, too.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1023290>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 26, 2009, 1:41 AM

Post #4 of 4 (203 views)
Permalink
[issue1023290] Conversion of longs to bytes and vice-versa. [In reply to]

Mark Dickinson <dickinsm [at] gmail> added the comment:

All tests pass on OS X 10.5/Intel, except that I'm still getting the issue
6687 test failure. This needs to be resolved somehow before committing.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1023290>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.