beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.91k stars 1.82k forks source link

Impossible cancel "beet embedart" #1283

Closed simonbcn closed 8 years ago

simonbcn commented 9 years ago

When I press CTRL+C after execute "beet embedart", the execution isn't interrupted.

sampsyo commented 9 years ago

Hi there—I can't reproduce that here (control-C works fine). Can you provide details about your setup?

simonbcn commented 9 years ago

I execute beet embedart and I press CTRL+C several times but the execution continues:

Screenshot of my terminal

sampsyo commented 9 years ago

It's not that I didn't believe you :smiley:; I just need more details about your system.

Also, does this go away if you disable resizing?

simonbcn commented 9 years ago

beet git version Python 2.7.8 Ubuntu Trusty 64 bits

Config file:

directory: "/home/simon/M\xFAsica/"
library: /home/simon/.beets/musiclibrary.blb
#threaded: no
color: yes
plugins: convert chroma replaygain fetchart lastgenre scrub embedart discogs web duplicates info
#art_filename: cover

fetchart:
   maxwidth: 300
   cover_names: front folder cover 

embedart:
   maxwidth: 300

match:
    strong_rec_thresh: 0.30
    max_rec:
        missing_tracks: strong

import:
   art: yes
   languages: es en

paths:
   default: $albumartist/$album/$track - $title
   singleton: $artist - $title
   comp: Varios/$album/$track - $title

replaygain:
   backend: gstreamer
   auto: yes
#   backend: command
   overwrite: yes
#   apply: yes

lastgenre:
   canonical: ''
   fallback: ''
   multiple: yes
   force: no

convert:
   auto: yes
   command: ffmpeg -i $source -y -codec:a libmp3lame -vn -qscale:a 1 $dest
   extension: mp3
   max_bitrate: 250
   embed: yes
   quiet: yes

duplicates:
   path: yes
#   checksum: yes

The imaging backend? I don't know.

Kraymer commented 9 years ago

The backend is ImageMagick (IM convert failed...)

sampsyo commented 9 years ago

Thanks (and thanks to @Kraymer for pointing this out).

How about this question:

Also, does this go away if you disable resizing?

(That is, remove maxwidth and see if anything changes.)

simonbcn commented 9 years ago

Without maxwidth same problem.

sampsyo commented 9 years ago

Very strange. I have now tried to do this on both my Mac (Yosemite) and Arch Linux. I can't reproduce this and I have no clues currently about what would be going on.

If you find any additional evidence, please do comment again.

k-f- commented 9 years ago

I've experienced this. I initially thought it was the threaded option finishing up other things, but that option is documented for effecting the importer.

Control-C then Return seemed to work more reliably/immediately in terms of killing both fetchart and embedart

sampsyo commented 9 years ago

Weird. Yes, only the importer is multithreaded.

@k-f-, does your system have anything in common with @simonbcn that might point to a culprit?

k-f- commented 9 years ago

Hard to say,

osx10.10.2, beets via pip-git, homebrew installed zsh/imagemagick

can't think of anything else that would be of interest...

sampsyo commented 9 years ago

Weird. You two are on completely different platforms, and I have an almost identical setup to @k-f-. I don't know why I don't have the same problem.

andremiller commented 9 years ago

I don't know if it's related, but when I try to stop the web server (beet web) with CTRL-C while a song is busy playing, it also ignores the CTRL-C.

To reproduce:

Run 'beet web' Open browser to 'http://localhost:8337/' Search for any song, start playing it, and then pause the song.

In the terminal where beet web is running, pressing CTRL-C does nothing.

Back in the browser, if I close the tab, then I get this error on the terminal, after which beet web terminates:

Exception KeyboardInterrupt in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored

I'm using Ubuntu 12.04.5 LTS, Python 2.7, a recent-ish git clone version of beets (will need to go check the exact version)

brunal commented 9 years ago

The most obvious culprit I can find would be try/except statements without any exception specified: those catch BaseException while in most cases we only want instances of Exception (see the hierarchy). I'll push a branch with those fixed.

brunal commented 9 years ago

Here it is: @k-f- @simonbcn could check out branch no-raw-except and try again?

I could not reproduce it either. Maybe it's python 2.7.8? (I use 2.7.9) It might also be an external dependency, in which case a pip freeze would be warranted.

simonbcn commented 9 years ago

It doesn't work. I've tested with beet upd and it doesn't stop.

$ pip freeze
Flask==0.10.1
Jinja2==2.7.3
MarkupSafe==0.23
PAM==0.4.2
Pillow==2.3.0
PyYAML==3.11
Pygments==1.6
SQLAlchemy==0.8.4
SecretStorage==2.0.0
Sphinx==1.2.2
Twisted-Core==13.2.0
Twisted-Web==13.2.0
Unidecode==0.04.17
Werkzeug==0.10.1
adium-theme-ubuntu==0.3.4
apt-xapian-index==0.45
argparse==1.2.1
audioread==1.2.1
beets==1.3.11
bzr==2.7.0dev1
ccsm==0.9.11.3
chardet==2.2.1
command-not-found==0.3
compizconfig-python==0.9.11.3
configobj==4.7.2
debtagshw==0.1
defer==1.0.6
dirspec==13.10
discogs==0.2.1
discogs-client==2.0.2
docopt==0.6.2
docutils==0.11
duplicity==0.6.23
enum34==1.0.4
freeze==0.8.0
gdata==2.0.18
gevent==1.0.1
gevent-socketio==0.3.6
gevent-websocket==0.9.3
greenlet==0.4.5
httplib2==0.9
itsdangerous==0.24
keyring==3.5
launchpadlib==1.10.2
lazr.restfulclient==0.13.3
lazr.uri==1.0.3
lockfile==0.8
lxml==3.3.3
matplotlib==1.3.1
mercurial==3.0.1
munkres==1.0.7
musicbrainzngs==0.5
mutagen==1.27
nautilus-pushbullet==0.2.0
numpy==1.8.2
oauth==1.0.1
oauth2==1.5.211
oauthlib==0.6.1
oneconf==0.3.7
pexpect==3.1
piston-mini-client==0.7.5
pondus==0.8.0
pushbullet-commons==0.2.0
pushbullet-indicator==0.5.0
pyOpenSSL==0.13
pyacoustid==1.1.0
pycrypto==2.6.1
pycups==1.9.66
pycurl==7.19.3
pyechonest==8.0.2
pygobject==3.12.0
pygpgme==0.3
pylast==1.1.0
pymad==0.7
pyparsing==2.0.1
pyserial==2.6
pysmbc==1.0.14.1
pysqlite==2.6.3
python-apt==0.9.3.5ubuntu1
python-dateutil==1.5
python-debian==0.1.21-nmu2ubuntu2
pytz==2012c
pyudev==0.16.1
pyxdg==0.25
reportlab==3.0
requests==2.5.1
roman==2.0.0
sessioninstaller==0.0.0
simplejson==3.3.1
six==1.9.0
software-center-aptd-plugins==0.0.0
system-service==0.1.6
trash-cli==0.12.7
unittest2==0.5.1
unity-lens-photos==1.0
urllib3==1.7.1
vboxapi==1.0
wadllib==1.3.2
wsgiref==0.1.2
xdiagnose==3.6.3build2
zope.interface==4.0.5
sampsyo commented 8 years ago

It's weird that this seems so system-specific. Since we're not making any progress on nailing down the problem, I need to close this issue for now. Please do reopen if you find any more details that can help reproduce it.