Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Syntax Error at indexer #27

Closed
JeanetteMueller opened this Issue · 5 comments

4 participants

@JeanetteMueller

the readme says shiva/indexer.py but it is at root

python indexer.py bring me this message

Traceback (most recent call last):
File "indexer.py", line 194, in
lola.run()
File "indexer.py", line 179, in run
self.walk(mdir)
File "indexer.py", line 165, in walk
self.walk(self.file_path)
File "indexer.py", line 165, in walk
self.walk(self.file_path)
File "indexer.py", line 167, in walk
if self.is_track():
File "indexer.py", line 152, in is_track
if not self.get_id3_reader().is_valid():
File "indexer.py", line 135, in get_id3_reader
self.id3r = ID3Manager(self.file_path)
File "/root/shiva-server/shiva/utils.py", line 53, in init
self.reader = eyed3.load(mp3_path)
File "/usr/local/lib/python2.6/dist-packages/eyed3/core.py", line 50, in load
from . import mp3, id3
File "/usr/local/lib/python2.6/dist-packages/eyed3/mp3/init.py", line 22, in
from .. import id3
File "/usr/local/lib/python2.6/dist-packages/eyed3/id3/init.py", line 487, in
from .tag import Tag, FileInfo, TagException, TagTemplate
File "/usr/local/lib/python2.6/dist-packages/eyed3/id3/tag.py", line 932
date_frames = {f.id: f for f in flist if f.id in DEPRECATED_DATE_FIDS}\
^
SyntaxError: invalid syntax
(The Arrow points to the "r" of the first "for")

Any Ideas? Sorry, i'm new with python

@khoffrath

I think it's because you are running Python 2.6. The line which throws the error contains a dict comprehension which was introduced in Python 2.7.

@JeanetteMueller

Yes i got it.
On debian with python 2.7 test it works (a little bit buggy)

@dbrgn
Collaborator

Are you planning on supporting Python 2.6 or not? If not, you should clearly state in your README.

As 2.6 is still used widely on different stable distributions (e.g. Debian Squeeze http://packages.debian.org/squeeze/python), I think you should support 2.6 as well. It can be tested by using Tox with different Python version configurations. The difference between 2.6 and 2.7 isn't too much of a problem.

@dbrgn
Collaborator

Ah, I just realized that the issue comes from eyed3, and not from shiva-server directly. Eyed3 state that it requires Py2.7.

As I already stated, I think we should support Python 2.6, therefore eyed3 would have to be fixed or replaced.

It appears that you're using eyed3 only for reading tag info. In that case, you could easily replace it with hsaudiotag (very easy to handle with auto-detection of file format) or mutagen (probably more mature but larger). Both libraries support additional file formats like OGG, FLAC and more.

If you're interested I could look into this issue and provide a pull request to replace eyed3.

@tooxie
Owner

#47 was just merged. Marking this as fixed.

@tooxie tooxie reopened this
@tooxie tooxie closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.