Issue #25 open

Python 3 compatibilty

Moritz Kiefer
created an issue

It would be great if you could add compability with python 3. I can take a look at it myself next time I have time.

Comments (14)

  1. Travis Shirk repo owner

    It's on the radar for sure Moritz. The next release will have support for 2.6, so some of the foundations for a more portable lib are in place.. including tox tests.

  2. Travis Shirk repo owner

    You will need to check out the code and install/use thje py3 branch., This is still in testing and will not be generally available until eyeD3 0.8.

  3. flyingrub
    • i own a little script wich is written on python3 and is ready for your next release :)
    • Do you have a workaround to use your tool easily with mine for now ? (install it by hand is the easiest way ?)

    • i know it's not cool to ask for eta but : Do you know when it will approximately be ready ?

  4. flyingrub
    fly@Minotoor:~/Musique$ l
    Saje - Take Care Of You.mp3
    fly@Minotoor:~/Musique$ python3
    Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
    [GCC 4.8.2] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import eyed3
    >>> audiofile = eyed3.load('Saje - Take Care Of You.mp3')
    >>> audiofile.tag.artist = 'test'
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'NoneType' object has no attribute 'artist'
    
  5. Travis Shirk repo owner

    I assume the file has a tag. If not, tag is None (call audiofile.initTag). If there is a tag in the file I'd like have the file to test. Your use case works fine for me.

  6. flyingrub
    fly@Minotoor ~/Musique/test $ python3
    Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
    [GCC 4.8.2] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import eyed3
    >>> audiofile = eyed3.load('Saje - Take Care Of You.mp3')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python3.4/dist-packages/eyeD3-0.7.5-py3.4.egg/eyed3/core.py", line 90, in load
        return mp3.Mp3AudioFile(path, tag_version)
      File "/usr/local/lib/python3.4/dist-packages/eyeD3-0.7.5-py3.4.egg/eyed3/mp3/__init__.py", line 165, in __init__
        core.AudioFile.__init__(self, path)
      File "/usr/local/lib/python3.4/dist-packages/eyeD3-0.7.5-py3.4.egg/eyed3/core.py", line 245, in __init__
        self._read()
      File "/usr/local/lib/python3.4/dist-packages/eyeD3-0.7.5-py3.4.egg/eyed3/mp3/__init__.py", line 183, in _read
        self._info = Mp3AudioInfo(file_obj, mp3_offset, self._tag)
      File "/usr/local/lib/python3.4/dist-packages/eyeD3-0.7.5-py3.4.egg/eyed3/mp3/__init__.py", line 95, in __init__
        if not self.xing_header.decode(mp3_frame):
      File "/usr/local/lib/python3.4/dist-packages/eyeD3-0.7.5-py3.4.egg/eyed3/mp3/headers.py", line 312, in decode
        version = (ord(frame[1]) >> 3) & 0x1
    TypeError: ord() expected string of length 1, but int found
    

    now i have this and i didn't change anything ....?

  7. flyingrub

    ok, i removed the one i installed with pip and now it's good. :) thanks

    a last one question : how can we edit the mp3 artwork with your module ?

    EDIT : while it works fine one my mint laptop on my raspberry pi it fail here :

    fly@raspberry-pi:~/workspace/eyed3/nicfit-eyed3-a95f6ccd6388$ python3 setup.py install
    Traceback (most recent call last):
      File "setup.py", line 10, in <module>
        paver.tasks.main()
      File "paver-minilib.zip/paver/tasks.py", line 885, in main
      File "paver-minilib.zip/paver/tasks.py", line 853, in _launch_pavement
      File "pavement.py", line 35
        PROJECT = u"eyeD3"
                         ^
    SyntaxError: invalid syntax
    fly@raspberry-pi:~/workspace/eyed3/nicfit-eyed3-a95f6ccd6388$ python3
    Python 3.2.3 (default, Mar  1 2013, 11:53:50) 
    [GCC 4.6.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    

    the only difference i see is that i have Python 3.4.0 (default, Apr 11 2014, 13:05:11) on my laptop ...

  8. Log in to comment