Skip to content

AttributeError: TypeVar object attribute __doc__ is read-only #427

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

Closed
sschuberth opened this issue Oct 18, 2021 · 5 comments
Closed

AttributeError: TypeVar object attribute __doc__ is read-only #427

sschuberth opened this issue Oct 18, 2021 · 5 comments
Labels
bug Something isn't working upstream It's someone else's problem

Comments

@sschuberth
Copy link

Out of a sudden we start getting error with Python 3.6.15, running reuse in a GitHub action:

Collecting reuse
  Downloading reuse-0.13.0-py3-none-any.whl (140 kB)
Collecting binaryornot
  Downloading binaryornot-0.4.4-py2.py3-none-any.whl (9.0 kB)
Collecting license-expression
  Downloading license_expression-21.6.14-py3-none-any.whl (86 kB)
Collecting requests
  Downloading requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting boolean.py
  Downloading boolean.py-3.8-py2.py3-none-any.whl (23 kB)
Collecting python-debian
  Downloading python_debian-0.1.42-py3-none-any.whl (118 kB)
Collecting Jinja2
  Downloading Jinja2-3.0.2-py3-none-any.whl (133 kB)
Collecting chardet>=3.0.2
  Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.7-py2.py3-none-any.whl (138 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.3-py3-none-any.whl (61 kB)
Collecting charset-normalizer~=2.0.0
  Downloading charset_normalizer-2.0.7-py3-none-any.whl (38 kB)
Installing collected packages: urllib3, MarkupSafe, idna, charset-normalizer, chardet, certifi, boolean.py, requests, python-debian, license-expression, Jinja2, binaryornot, reuse
Successfully installed Jinja2-3.0.2 MarkupSafe-2.0.1 binaryornot-0.4.4 boolean.py-3.8 certifi-2021.10.8 chardet-4.0.0 charset-normalizer-2.0.7 idna-3.3 license-expression-21.6.14 python-debian-0.1.42 requests-2.26.0 reuse-0.13.0 urllib3-1.26.7
WARNING: You are using pip version 21.2.4; however, version 21.3 is available.
You should consider upgrading via the '/opt/hostedtoolcache/Python/3.6.15/x64/bin/python -m pip install --upgrade pip' command.
Traceback (most recent call last):
  File "/home/runner/.local/bin/reuse", line 5, in <module>
    from reuse._main import main
  File "/home/runner/.local/lib/python3.6/site-packages/reuse/_main.py", line 14, in <module>
    from . import (
  File "/home/runner/.local/lib/python3.6/site-packages/reuse/download.py", line 18, in <module>
    from ._util import (
  File "/home/runner/.local/lib/python3.6/site-packages/reuse/_util.py", line 26, in <module>
    from debian.copyright import Copyright
  File "/home/runner/.local/lib/python3.6/site-packages/debian/copyright.py", line 57, in <module>
    from debian import deb822
  File "/home/runner/.local/lib/python3.6/site-packages/debian/deb822.py", line 309, in <module>
    from debian._util import (
  File "/home/runner/.local/lib/python3.6/site-packages/debian/_util.py", line 15, in <module>
    """
AttributeError: 'TypeVar' object attribute '__doc__' is read-only
Error: Process completed with exit code 1.

Any idea what might cause this?

@pietroalbini
Copy link
Contributor

Downgrading the python-debian dependency to 0.1.40 instead of 0.1.42 seems to fix the issue.

fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a wrokaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
sschuberth pushed a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
fviernau added a commit to oss-review-toolkit/ort that referenced this issue Oct 19, 2021
This is a workaround for [1], see also [2].

[1] AttributeError: 'TypeVar' object attribute '__doc__' is read-only
    Error: Process completed with exit code 1.
[2] fsfe/reuse-tool#427

Signed-off-by: Frank Viernau <[email protected]>
@seabass-labrax
Copy link
Contributor

@mxmehl - yikes; two python-debian errors in one day!

This is likely a result of the recent (last week) commit to python-debian which moved various functions nearer to the project root and adds a 'docstring' directly (something which isn't allowed in various cases):

T = TypeVar('T')
T.__doc__ = """
Generic type
"""

Since this an upstream error, I'll look into fixing it in the python-debian repository :)

@mxmehl mxmehl added bug Something isn't working upstream It's someone else's problem labels Oct 19, 2021
priv-kweihmann added a commit to priv-kweihmann/flict that referenced this issue Oct 20, 2021
to reenable reuse integration.
See fsfe/reuse-tool#427 for details

Signed-off-by: Konrad Weihmann <[email protected]>
jens-erdmann pushed a commit to vinland-technology/flict that referenced this issue Oct 20, 2021
to reenable reuse integration.
See fsfe/reuse-tool#427 for details

Signed-off-by: Konrad Weihmann <[email protected]>
@sschuberth
Copy link
Author

Since this an upstream error, I'll look into fixing it in the python-debian repository :)

Any update on this @seabass-labrax? Or is the situation any better with Ubuntu 22.04?

@sschuberth
Copy link
Author

Or is the situation any better with Ubuntu 22.04?

Yes it is: This issue does not occur anymore with Ubuntu 22.04 and Python 3.10.

@mxmehl
Copy link
Member

mxmehl commented Aug 15, 2022

Great. I will close this issue and hope that the improvements tickle down on more recent platforms.

@mxmehl mxmehl closed this as completed Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream It's someone else's problem
Projects
None yet
Development

No branches or pull requests

4 participants