Skip to content

Error caused by inconsistent bytes/str #13

@peastman

Description

@peastman

When I try to use pyAffy on Python 3.6, it fails with this error:

  File "/home/peastman/pyaffy/pyaffy/process.py", line 141, in rma
    y = parse_cel(cel_file)
  File "pyaffy/celparser.pyx", line 696, in pyaffy.celparser.parse_cel
  File "pyaffy/celparser.pyx", line 614, in pyaffy.celparser.parse_celfile_cc
  File "pyaffy/celparser.pyx", line 523, in pyaffy.celparser.parse_celfile_cc.read_data_header
  File "pyaffy/celparser.pyx", line 490, in pyaffy.celparser.parse_celfile_cc.read_header_param
TypeError: a bytes-like object is required, not 'str'

The error is caused by this line in read_header_param():

 v2 = decode_unicode(v2.rstrip('\x00'))

bytes.rstrip() requires its argument to be a bytes, not a str. The line should be changed to

 v2 = decode_unicode(v2.rstrip(b'\x00'))

and likewise in line 492.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions