Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unorderable types in python3 #2

Closed
leviaking opened this issue Jul 17, 2015 · 6 comments
Closed

unorderable types in python3 #2

leviaking opened this issue Jul 17, 2015 · 6 comments
Assignees

Comments

@leviaking
Copy link

Everything has worked fine for me in python 2.7, and I certainly owe you a beer if we every cross paths!
However, I've been working with some unicode annotation lately so I thought it would be better to use python3. In python3, I've been unable to get things working, because I get a TypeError when I try to load my .eaf file. It seems python 2 allows for comparison of int & NoneType, but python3 does not.
I'm trying to poke around in your code and get it working in python3. If I come up with a decent solution, I'll pass it along.
Here is the error:

myeaf = pympi.Elan.Eaf('120604_00.eaf', 'LK')
Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pympi/Elan.py", line 117, in __init__
        parse_eaf(file_path, self)
    File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pympi/Elan.py", line 1322, in parse_eaf
        if int(elem1.attrib['TIME_SLOT_ID'][2:]) > eaf_obj.maxts:
TypeError: unorderable types: int() > NoneType()```
@dopefishh dopefishh self-assigned this Jul 17, 2015
@dopefishh
Copy link
Owner

Thanks for the feedback, I'll look into it as soon as possible(probably monday). Python3 is not as thorougly tested as 2.7.x. if the unit tests passes I'll take the chance. I'll get back to you asap

@dopefishh
Copy link
Owner

Can you test if version 1.49b solves it? It's the master branch on github but you can also just upgrade with pip.

@leviaking
Copy link
Author

Thanks for your quick response. It seems there's still a problem. Here's what I'm getting:

someeaf = pympi.Elan.Eaf('120604_00.eaf', 'LK')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pympi/Elan.py", line 117, in __init__
    parse_eaf(file_path, self)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pympi/Elan.py", line 1323, in parse_eaf
    tsnum = int(filter(str.isdigit, tsid))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'filter'

@dopefishh
Copy link
Owner

Now it should be fixed, sorry for the hassle.

@leviaking
Copy link
Author

It's working for me now. Thanks again!

@dopefishh
Copy link
Owner

Great, I'll close this then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants