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

v0.8.3 over Python3: 'OSError' object has no attribute 'message': trying to rename a file #114

Closed
marcelpaulo opened this issue Nov 3, 2017 · 6 comments

Comments

@marcelpaulo
Copy link

I'm trying to rename these files:

paulo@monk:~/tmp/Atrium Musicæ de Madrid/Monodia Cortesana Medieval • Música Arábigo-Andaluza$ ls -1
01 Marcabru: Pax in nomine Domini.mp3
02 Palou: De la iensor.mp3
03 Palou: Dona, la ienser.mp3
04 Montaudo: Fort m'enoia.mp3
05 Borneil: Reis glorios.mp3
06 Cardenal: Un sirventés.mp3
07.mp3
08.mp3
09.mp3
10.mp3
11.mp3
12.mp3
13.mp3
14.mp3
15.mp3
16.mp3
17.mp3
18.mp3
19.mp3
20.mp3

using:

eyeD3 --rename '$track:num $title' .

and I'm getting this error:

/home/paulo/tmp/Atrium Musicæ de Madrid/Monodia Cortesana Medieval • Música Arábigo-Andaluza/01 Marcabru: Pax in nomine Domini.mp3                                                    [ 2.50 MB ]
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Time: 01:51	MPEG1, Layer III	[ ~188 kb/s @ 44100 Hz - Joint stereo ]
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ID3 v2.3:
title: Marcabru: Pax in nomine Domini
artist: Atrium Musicæ de Madrid
album: Monodia Cortesana Medieval • Música Arábigo-Andaluza
album artist: José Luis Ochoa de Olza, Orchesta Marroquí de Tetuán (Abdessadak Chkara)
recording date: 1969
eyed3.id3:WARNING: Non standard genre name: Medieval
track: 1		genre: Medieval (id None)
Comment: [Description: ] [Lang: XXX]
Trovadores catalanes y provenzales
Uncaught exception: 'OSError' object has no attribute 'message'

eyed3:ERROR: 'OSError' object has no attribute 'message'
Traceback (most recent call last):
  File "/home/paulo/.local/lib/python3.6/site-packages/eyed3/plugins/classic.py", line 520, in handleFile
    self.audio_file.rename(name)
  File "/home/paulo/.local/lib/python3.6/site-packages/eyed3/core.py", line 207, in rename
    raise IOError(u"File '%s' exists, will not overwrite" % new_path)
OSError: File '/home/paulo/tmp/Atrium Musicæ de Madrid/Monodia Cortesana Medieval • Música Arábigo-Andaluza/01 Marcabru: Pax in nomine Domini.mp3' exists, will not overwrite

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/paulo/.local/lib/python3.6/site-packages/eyed3/main.py", line 279, in _main
    retval = mainFunc(args, config)
  File "/home/paulo/.local/lib/python3.6/site-packages/eyed3/main.py", line 50, in main
    fs_encoding=args.fs_encoding)
  File "/home/paulo/.local/lib/python3.6/site-packages/eyed3/utils/__init__.py", line 103, in walk
    handler.handleFile(f)
  File "/home/paulo/.local/lib/python3.6/site-packages/eyed3/plugins/classic.py", line 524, in handleFile
    printError(ex.message)
AttributeError: 'OSError' object has no attribute 'message'

Here's my version, encoding and Python version:

paulo@monk:~/tmp$ eyeD3 --version
0.8.3
paulo@monk:~/tmp$ python3 --version
Python 3.6.3
paulo@monk:~/tmp$ python3 -c 'import sys; print(sys.getfilesystemencoding())'
utf-8

Let me know how I can help debug this further.

@nicfit
Copy link
Owner

nicfit commented Nov 4, 2017

54b4735 fixes this traceback, but not the actual rename error. Should be more info if you can run on HEAD.

@marcelpaulo
Copy link
Author

if you can run on HEAD.

Apologies if perhaps I'm asking a dummy question, @nicfit: what do you mean by that ?

@nicfit
Copy link
Owner

nicfit commented Nov 4, 2017

I mean, run/test off the latest git ... rather than waiting for a release that includes 54b4735

@marcelpaulo
Copy link
Author

Oh, I understand now, thanks. Will do it right way and post back the results.

@marcelpaulo
Copy link
Author

Perfect: no traceback, and if I try to rename it to the same name, the message makes sense:

File '/home/paulo/tmp/01 Marcabru: Pax in nomine Domini.mp3' exists, will not overwrite

It might have seemed a bit daft trying to rename it to the same name, but the case was: I had a CD where some of the tracks were named to my standard and some weren't, so when I run eyeD3 --rename on the directory, some files needed renaming and some didn't.

Should I close the issue or you ? Not sure about the protocol here.

Thank you so much, @nicfit, for the swift resolution !

@nicfit
Copy link
Owner

nicfit commented Nov 4, 2017

And thanks for reporting @marcelpaulo and helping make eyeD3 more solid!
FWIW, it's cool to close your own bug reports, unless the author reopens.

@nicfit nicfit closed this as completed Nov 4, 2017
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