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

Using beets in a bash script results in error #2041

Closed
nomadturk opened this issue Jun 8, 2016 · 8 comments
Closed

Using beets in a bash script results in error #2041

nomadturk opened this issue Jun 8, 2016 · 8 comments

Comments

@nomadturk
Copy link

Problem

I was trying to get rid of around 1700 directories/subdirectories with only 1 or 2 mp3 files in it due to importing a lot of various artist albums in a bad way. I didn't go delete all && beet update way and wanted to use it in a bash script.

Turns out 1.3.18 has a bug for that matter.

Since beets doesn't have a --quiet or --force parameter for beet remove command, I had to manually pass the stdin to beet when it was asked.

Running the example command below

echo 'y'|beet remove -d "/Depo/Beets/Anberlin/New Surrender"
results with error message:

/Depo/Beets/Anberlin/New Surrender/00 - Feel Good Drag.mp3 - Feel Good Drag
Really DELETE 1 file (y/n)? Traceback (most recent call last):
  File "/usr/local/bin/beet", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 1250, in main
    _raw_main(args)
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 1240, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/commands.py", line 1230, in remove_func
    remove_items(lib, decargs(args), opts.album, opts.delete)
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/commands.py", line 1220, in remove_items
    if not ui.input_yn(prompt, True):
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 375, in input_yn
    ('y', 'n'), require, prompt, u'Enter Y or N:'
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 339, in input_options
    resp = input_(prompt)
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 207, in input_
    return resp.decode(_in_encoding(), 'ignore')
TypeError: decode() argument 1 must be string, not None

Same goes for other methods. When I wanted to pass Y to beets, none of them were accepted. Only after @DjSlash said he had success with the command that we were able to identify the problem. Turns out 1.3.17 doesn't have such problems and after a downgrade I managed to do what I wanted as well.

Setup

  • OS: Debian 8
  • Python version: 2.7.9
  • beets version: 1.3.18
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:

@nomadturk
Copy link
Author

Headsup: #1997 Also mentions the same error. But I've tried running beets without any plugins and the result was the same.

sampsyo added a commit that referenced this issue Jun 8, 2016
@sampsyo sampsyo closed this as completed in 27bd4c5 Jun 8, 2016
@sampsyo
Copy link
Member

sampsyo commented Jun 8, 2016

Thanks for documenting the problem! This was indeed a regression in the previous version. I've committed a fix with tests.

@sampsyo
Copy link
Member

sampsyo commented Jun 8, 2016

For posterity, the bug was introduced in #1964.

Also, #1997 looks like a different error to me---maybe they just look similar enough because they both mention None?

@nomadturk
Copy link
Author

My bad... #1997 indeed is different. I don't remember which one I was trying to link ^^

Thanks for the fix.

@petwri
Copy link

petwri commented Jun 27, 2016

When will the fix for this be available?

@ghost
Copy link

ghost commented Jun 27, 2016

it should be available now in 1.3.19

@petwri
Copy link

petwri commented Jun 27, 2016

And is 1.3.19 available via pip?
On Jun 27, 2016 8:00 AM, "Johnny Robeson" notifications@github.com wrote:

it should be available now in 1.3.19


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#2041 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AHa0XFgbmIiLstx-CErKjNR9o4_lVxg6ks5qP2cHgaJpZM4Iw5nI
.

@ghost
Copy link

ghost commented Jun 27, 2016

should be

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

3 participants