Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71739 > unrolled thread

bz2.decompress as file handle

Started byVincent Davis <vincent@vincentdavis.net>
First post2014-05-18 19:53 -0600
Last post2014-05-18 19:53 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  bz2.decompress as file handle Vincent Davis <vincent@vincentdavis.net> - 2014-05-18 19:53 -0600

#71739 — bz2.decompress as file handle

FromVincent Davis <vincent@vincentdavis.net>
Date2014-05-18 19:53 -0600
Subjectbz2.decompress as file handle
Message-ID<mailman.10118.1400464410.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

I have a file compressed with bz2 and a function that expects a file handle.
When I decompress the bz2 file I get a string (binary) not a file handle.

Here is what I have that does not work. There is no error (thats a seperate
issue) CelFile.read just fails to read the data(string).

from Bio.Affy import CelFile
from bz2 import decompress,

with open('Tests/Affy/affy_v3_ex.CEL.bz2', 'rb') as handle:
    cel_data = decompress(handle.read())

c = CelFile.read(cel_data)



​​
​Thanks​
Vincent Davis

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web