Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

copyartifacts stops copying when it throws exception #38

Open
jojojames opened this issue Nov 5, 2017 · 9 comments
Open

copyartifacts stops copying when it throws exception #38

jojojames opened this issue Nov 5, 2017 · 9 comments

Comments

@jojojames
Copy link

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\plugins.py", line 124, in wrapper
    return func(*args, **kwargs)
TypeError: process_events() got an unexpected keyword argument 'lib'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\Scripts\beet-script.py", line 11, in <module>
    load_entry_point('beets==1.4.5', 'console_scripts', 'beet')()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\ui\__init__.py", line 1256, in main
    _raw_main(args)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\ui\__init__.py", line 1245, in _raw_main
    plugins.send('cli_exit', lib=lib)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\plugins.py", line 452, in send
    result = handler(**arguments)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\plugins.py", line 130, in wrapper
    return func(*args, **kwargs)
  File "c:\program files (x86)\python36-32\lib\site-packages\beets_copyartifacts-0.1.2-py3.6.egg\beetsplug\copyartifacts.py", line 127, in process_events
  File "c:\program files (x86)\python36-32\lib\site-packages\beets_copyartifacts-0.1.2-py3.6.egg\beetsplug\copyartifacts.py", line 161, in process_artifacts
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\util\__init__.py", line 536, in unique_path
    match = re.search(br'\.(\d)+$', base)
  File "C:\Program Files (x86)\Python36-32\lib\re.py", line 182, in search
    return _compile(pattern, flags).search(string)
TypeError: cannot use a bytes pattern on a string-like object
PS C:\Users\james>
@thomwiggers
Copy link

Duplicate of #31

@jojojames
Copy link
Author

@thomwiggers Are you sure it's a dup? The last comment indicates the development version works.

I believe I cloned the repo to get copyartifacts.

@thomwiggers
Copy link

thomwiggers commented Nov 6, 2017

"TypeError: cannot use a bytes pattern on a string-like object" is a typical "trying to use python 2 code under python 3"-problem. Clearly Python 3 still isn't fully supported.

@sbarakat
Copy link
Owner

sbarakat commented Nov 6, 2017

This could be something missed in the test coverage in the development version.

@jojojames, could you paste your copyartifacts config?

@jojojames
Copy link
Author

copyartifacts:
extensions: .*
print_ignored: yes

https://github.com/jojojames/beets/blob/master/config.yaml

@Holzhaus
Copy link

The main problem is that the process_events method does not support the lib kwargs of cli_exit. That kwarg has been added in 2013 by this commit: beetbox/beets@2ad5b4c
A fix should be trivial.

Holzhaus added a commit to Holzhaus/beets-copyartifacts that referenced this issue Dec 25, 2018
Without this fix, the following exception is thrown:

    Traceback (most recent call last):
    File "/data/jan/Projects/beets/beets/plugins.py", line 140, in wrapper
        return func(*args, **kwargs)
    TypeError: process_events() got an unexpected keyword argument 'lib'

The lib kwarg has been introduced by this commit in beetbox/beets:

    commit 2ad5b4c665bd270243d7e31f77680e969d7cb315
    Author: Dang Mai <contact@dangmai.net>
    Date:   Thu Jan 31 16:33:53 2013 -0500

        Add lib parameter for cli_exit

This is a partial fix for issue sbarakat#38.
@Ruin0x11
Copy link

I just triggered this bug when updating a massive library. It was quite annoying since all the music files were moved but all the artifacts were left in the original folders, requiring manual movement. Maybe #43 could be merged easily, since it's a one-word fix.

@steelwolf
Copy link

I had the same issue with my recent massive library update.

@Ruin0x11
Copy link

Is this ever going to be fixed? I've had to deal with this problem numerous times because I've had to reinstall multiple versions of Python, and the buggy version is installed from pip every time. I would gladly volunteer to merge the patches if it were possible.

drizzt pushed a commit to drizzt/beets-copyartifacts that referenced this issue May 2, 2020
Without this fix, the following exception is thrown:

    Traceback (most recent call last):
    File "/data/jan/Projects/beets/beets/plugins.py", line 140, in wrapper
        return func(*args, **kwargs)
    TypeError: process_events() got an unexpected keyword argument 'lib'

The lib kwarg has been introduced by this commit in beetbox/beets:

    commit 2ad5b4c665bd270243d7e31f77680e969d7cb315
    Author: Dang Mai <contact@dangmai.net>
    Date:   Thu Jan 31 16:33:53 2013 -0500

        Add lib parameter for cli_exit

This is a partial fix for issue sbarakat#38.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants