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

cli --print / --to-csv breaks when year malformed #19

Open
parisni opened this issue Aug 17, 2021 · 0 comments · May be fixed by #22
Open

cli --print / --to-csv breaks when year malformed #19

parisni opened this issue Aug 17, 2021 · 0 comments · May be fixed by #22

Comments

@parisni
Copy link

parisni commented Aug 17, 2021

What about using file.raw to let print / export to csv badformed metadata ?

00:40 $ python3 -m music_tag --to-csv  tags.csv sample
Traceback (most recent call last):
  File "/home/natus/git/music/.direnv/python-3.9.6/lib/python3.9/site-packages/music_tag/util.py", line 26, in sanitize_year
    year = int(year)
ValueError: invalid literal for int() with base 10: '2019-09-26 10'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/natus/.pyenv/versions/3.9.6/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/natus/.pyenv/versions/3.9.6/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/natus/git/music/.direnv/python-3.9.6/lib/python3.9/site-packages/music_tag/__main__.py", line 175, in <module>
    sys.exit(_main())
  File "/home/natus/git/music/.direnv/python-3.9.6/lib/python3.9/site-packages/music_tag/__main__.py", line 134, in _main
    row = [mt_f[k] for k in tags] + [fname]
  File "/home/natus/git/music/.direnv/python-3.9.6/lib/python3.9/site-packages/music_tag/__main__.py", line 134, in <listcomp>
    row = [mt_f[k] for k in tags] + [fname]
  File "/home/natus/git/music/.direnv/python-3.9.6/lib/python3.9/site-packages/music_tag/file.py", line 600, in __getitem__
    return self.get(norm_key, default=None)
  File "/home/natus/git/music/.direnv/python-3.9.6/lib/python3.9/site-packages/music_tag/file.py", line 443, in get
    ret = None if val is None else MetadataItem(md_type, md_sanitizer,
  File "/home/natus/git/music/.direnv/python-3.9.6/lib/python3.9/site-packages/music_tag/file.py", line 67, in __init__
    self.values = val
  File "/home/natus/git/music/.direnv/python-3.9.6/lib/python3.9/site-packages/music_tag/file.py", line 90, in values
    v = self.sanitizer(v)
  File "/home/natus/git/music/.direnv/python-3.9.6/lib/python3.9/site-packages/music_tag/util.py", line 33, in sanitize_year
    raise ValueError("Could not extract year from: {0}".format(year))
ValueError: Could not extract year from: 2019-09-26 10
@parisni parisni linked a pull request Sep 2, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant