-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Deprecation warning in plugins.py #2826
Comments
Hi! That’s interesting—thanks for reporting. Do you know why you might be seeing this while other users (like myself) on 3.6 don’t? Is this a brand-new deprecation in a point release, or is this somehow a Debian-related thing? |
Earlier I was using beets from pip.. It was 1.4.5 I think, but then I saw that beets was available in dnf, I removed the one from pip and installed from DNF.. Since then I am seeing this.. If I remove the plugins in the config, I don't see any error. |
Thanks. Looks like we need an updated call akin to this change: https://github.com/praw-dev/praw/pull/551/files#diff-2a573d21bf9c7db67d16b42ba4e8193eR37 |
I can't remember exactly when it started, but I got this
|
Same here: Fedora 29, beets 1.4.7
Otherwise functions normally. Same behavior from repository package and pip install :-( |
Strange that this seems to occur on some distros but not others. The last one, at least, should be fairly straightforward to fix if anyone's interested in lending a hand! |
It must be that Fedora's Python build has some debug flags on that help catch stuff like this. Anyways a simple change of Edit: or, sth like this: diff --git a/beets/plugins.py b/beets/plugins.py
index 6dec7ef2..c26b1034 100644
--- a/beets/plugins.py
+++ b/beets/plugins.py
@@ -20,6 +20,7 @@ from __future__ import division, absolute_import, print_function
import inspect
import traceback
import re
+import sys
from collections import defaultdict
from functools import wraps
@@ -127,7 +128,10 @@ class BeetsPlugin(object):
value after the function returns). Also determines which params may not
be sent for backwards-compatibility.
"""
- argspec = inspect.getargspec(func)
+ if sys.version_info[0] < 3:
+ argspec = inspect.getargspec(func)
+ else:
+ argspec = inspect.getfullargspec(func)
@wraps(func)
def wrapper(*args, **kwargs): Still more stuff to clean afterwards on the way to PY3 only though... |
We also have six as a dependency, so |
Well, no need for superfluous imports then: diff --git a/beets/plugins.py b/beets/plugins.py
index 6dec7ef2..69784d26 100644
--- a/beets/plugins.py
+++ b/beets/plugins.py
@@ -127,7 +127,10 @@ class BeetsPlugin(object):
value after the function returns). Also determines which params may not
be sent for backwards-compatibility.
"""
- argspec = inspect.getargspec(func)
+ if six.PY2:
+ argspec = inspect.getargspec(func)
+ else:
+ argspec = inspect.getfullargspec(func)
@wraps(func)
def wrapper(*args, **kwargs): |
Awesome. Would you mind opening a pull request with that patch? |
Fixes the following warning from certain versions of Python 3.7: /home/sam/.local/lib/python3.7/site-packages/beets/plugins.py:130: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec() argspec = inspect.getargspec(func) Patch from beetbox#2826
I've been seeing several unrelated deprecation warnings from Beets since upgrading my laptop, and I tracked it down to the musicbrainzngs library. Version 0.5 of that library will turn on deprecation warnings process-wide in any program which imports it. The issue was fixed in musicbrainzngs 0.6, but Fedora only packages version 0.5 so anyone using that distro will be seeing some warnings. I've opened a bug in Fedora here: https://bugzilla.redhat.com/show_bug.cgi?id=1685216 You can work around this by installing a local copy of musicbrainzngs using |
That's really helpful to know; thanks, @ssssam! |
Thanks for the research you've done @ssssam! I can confirm that I got rid of the screenful of warnings I got with the packaged version in Fedora after installing a local copy of |
Problem
Installed beets from fedora repo and getting the following error every time I run any command
Running this command in verbose (
-vv
) mode:Led to this problem:
Here's a link to the music files that trigger the bug (if relevant):
Setup
My configuration (output of
beet config
) is:The text was updated successfully, but these errors were encountered: