Author christian.heimes
Recipients christian.heimes, meador.inge, ncoghlan, pitrou, python-dev, skrah, vstinner
Date 2012-07-19.09:47:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1342691278.63.0.096138139117.issue12834@psf.upfronthosting.co.za>
In-reply-to
Content
It looks like Stefan has fixed the issue in Python 3.3 a while ago. tobytes() returns the correct values with a fresh build of Python 3.3. 

$ PYTHONPATH="." /home/heimes/dev/python/py3k/python smc/freeimage/tests/test_image.py
test_newbuffer (__main__.TestImageNewBuffer) ... 

  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
 80  80  80 112 112 112 160 160 160 192 192 192 240 240 240
  0   0 255   0 255   0 255   0   0   0   0 255   0 255   0
255   0   0   0   0 255   0 255   0 255   0   0   0   0 255
  0 255   0 255   0   0   0   0 255   0 255   0 255   0   0
255 255   0 255   0 255   0 255 255 255 255   0 255   0 255

However it's still broken in 3.2 (also up to date hg pull).

$ PYTHONPATH="." /home/heimes/dev/python/3.2/python smc/freeimage/tests/test_image.py
test_newbuffer (__main__.TestImageNewBuffer) ... 

  0   0   0   0   0   0   0   0   0   0   0   0   0   0 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255  80
 80  80 112 112 112 160 160 160 192 192 192 240 240 240   0
  0 255   0 255   0 255   0   0   0   0 255   0 255   0 255
  0   0   0   0 255   0 255   0 255   0   0   0   0 255   0
255   0 255   0   0   0   0 255   0 255   0 255   0   0 255
255   0 255   0 255   0 255 255 255 255   0 255   0 255   0


Stefan, could you please port your fix to Python 3.2 and 3.3? Thanks!
History
Date User Action Args
2012-07-19 09:47:59christian.heimessetrecipients: + christian.heimes, ncoghlan, pitrou, vstinner, skrah, meador.inge, python-dev
2012-07-19 09:47:58christian.heimessetmessageid: <1342691278.63.0.096138139117.issue12834@psf.upfronthosting.co.za>
2012-07-19 09:47:57christian.heimeslinkissue12834 messages
2012-07-19 09:47:56christian.heimescreate