beets-copyartifacts icon indicating copy to clipboard operation
beets-copyartifacts copied to clipboard

Doesn't work with beets under python 3.

Open ghost opened this issue 8 years ago • 15 comments

beets 1.4.1 has beta Python 3 support, and will switch completely to Python 3 in the next months.

We use the six package for the basics.

ghost avatar Dec 31 '16 12:12 ghost

I'm encountering this error when attempting to use the plugin

** error loading plugin copyartifacts:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/beets/plugins.py", line 254, in load_plugins
    namespace = __import__(modname, None, None)
  File "/usr/local/lib/python3.6/site-packages/beetsplug/copyartifacts.py", line 141
    print 'Ignored files:'
                         ^
SyntaxError: Missing parentheses in call to 'print'

claman avatar Feb 25 '17 20:02 claman

There's a script that ships with Python 3 called 2to3.py. I used it on the script and everything seems to work.

RollingStar avatar Feb 25 '17 20:02 RollingStar

or just edit copyartifacts.py manually, there are 4 print functions starting at line 141. just put the calls in parentheses like so: print 'Ignored files:' ==> print ('Ignored files:')

avma avatar Apr 16 '17 12:04 avma

Actually, the print issue was fixed in 2015 in https://github.com/sbarakat/beets-copyartifacts/commit/ddf747240697af393f68b7200b8793e409ccce3d : You're apparently running a rather ancient version of copyartifacts. There're possibly additional issues with python 3, see also #32 (although I haven't checked whether the problem from that issue even applies for very old versions of the plugin).

wisp3rwind avatar Apr 16 '17 18:04 wisp3rwind

Although the Python 3 issues have been fixed the version available on PyPi dates back to April 2015, and I suspect this is how most people are obtaining the plugin. Would it be possible to add a new release to PyPi? (@sbarakat)

KingJ avatar Apr 17 '17 10:04 KingJ

true, i ran sudo pip3.6 install beets-copyartifacts and am getting this old version... how do i get the newer version for python 3.6.1?

avma avatar Apr 17 '17 14:04 avma

Same problem here. Using Python 3.6, installed copyartifacts as per this repo's readme, and I get the same error.

acastaner avatar Jun 13 '17 07:06 acastaner

Hi. I had the same problem so I fixed the script to work with the python 3 version of beets. You can replace C:\Python36\Lib\site-packages\beetsplug\copyartifacts.py (or similar) with the one found here:

https://github.com/mverbowski/beets-copyartifacts/blob/master/beetsplug/copyartifacts.py

Just some simple print statement fixes and the reading encoding.

mverbowski avatar Oct 18 '17 04:10 mverbowski

Sorry for the late response here, other life priorities turned up!

I've recently pushed some changes for better Python 3 support and tests are passing. I've got a few minor changes I would like to get in before updating the version on PyPi. However if you'd like to try out the development version, it's available by following these steps.

@mverbowski thank you for your effort with this! It appears you've taken the plugin version v0.1.2 from PyPi and swapped the print statements. This won't include any of the fixes since then or have support for beets move.

sbarakat avatar Oct 25 '17 17:10 sbarakat

@sbarakat Any word on when the python3 support will be merged in and pushed to PyPi? I've tried the development version but beets throws an exception that it can't find the module.

cacack avatar Mar 03 '18 02:03 cacack

@cacack as you've noticed there's still some py3 issues to fix which is why it's not been pushed to PyPi. I'm lacking the time to fix these at the moment as I'm busy with life things, so can't say for certain. Always happy to accept PRs from the community

sbarakat avatar Mar 07 '18 14:03 sbarakat

A year has passed, any chance for a fix?

JohanSF avatar Mar 10 '19 16:03 JohanSF

I went ahead and created a new package in PyPI with what is currently in master. You can install it with pip install beets-copyartifacts3.

Fork: https://github.com/adammillerio/beets-copyartifacts PyPI: https://pypi.org/project/beets-copyartifacts3/

So far it has been working for my imports with no issues, and the existing tests are passing, but your mileage may vary.

adammillerio avatar Feb 15 '20 20:02 adammillerio

Thank you. Personally I use the extrafiles plugin with no issues now though.

JohanSF avatar Feb 15 '20 22:02 JohanSF

Unfortunately, as has shown over the past years, I simply don't have the time to maintain this plugin as my priorities are elsewhere.

Thank you all for your comments and for creating beets-copyartifacts3 and beets-extrafiles. I have put pointers to these in the README and will be archiving this project.

sbarakat avatar May 31 '20 11:05 sbarakat