Message5041

Author pjdm
Recipients pjdm
Date 2009-08-16.10:02:02
SpamBayes Score 3.1973868e-11
Marked as misclassified No
Message-id <1250416923.21.0.442051584005.issue1439@psf.upfronthosting.co.za>
In-reply-to
Content
This program writes an array.array to a file.

import array
import sys

a = array.array('c', 'thebishop\n')
f = open('/tmp/out.txt', 'wb')
f.write(a)
f.close()

This works using CPython 2.5.4. Jython 2.5.0 results in

Traceback (most recent call last):
  File "writearray.py", line 7, in <module>
    f.write(a)
TypeError: write requires a string as its argument
History
Date User Action Args
2009-08-16 10:02:03pjdmsetrecipients: + pjdm
2009-08-16 10:02:03pjdmsetmessageid: <1250416923.21.0.442051584005.issue1439@psf.upfronthosting.co.za>
2009-08-16 10:02:03pjdmlinkissue1439 messages
2009-08-16 10:02:02pjdmcreate