bitarray python 3 port

Roland Puntaier roland.puntaier at chello.at
Sat Jul 23 12:30:41 EDT 2011


Hi Ilan,

I've ported your bitarray package to python 3.
Your thorough test script helped a lot. It does run through with python 
 > 2.6 and python 3.x for Linux and Windows. Python 2.5 I didn't try.
The mandel.py sample does not work with python3, because scipy weave is 
not yet supported

Changes:
- I've added frombytes() and tobytes(). fromstring() and tostring() do 
encode() and forward to them.
- fromfile() does not use PyObject_AsFileDescripter and read directly 
into buffer, because of problems to sync file position with python's 
f.read().
   A temporary buffer is created then copied into the bitarray buffer.

Setup.py copies the _bitarray.so (Linux) or _bitarray.pyd (Windows) into 
site-packages (3.2) or dist-packages (<3.2), but not into 
/usr[/local]/lib/python3.x/lib-dynload
or Python3.x/DLLs. As a result you might get "no module named _bitarray".
Setting PYTHONPATH to where bitarray is or adding that path to sys.path 
helps. Else a symbolic link or copy in lib-dynload (Linux) or 
Python3.x/DLLs could be created.

If you could add this to pypi, it would be great.

Regards,
Roland
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bitarray-0.3.6.tar.gz
Type: application/x-gzip
Size: 50150 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20110723/2589e1e0/attachment.bin>


More information about the Python-list mailing list