Skip to content
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

TorrentDictionary.properties raises AttributeError #406

Open
jcassette opened this issue Jan 27, 2024 · 1 comment
Open

TorrentDictionary.properties raises AttributeError #406

jcassette opened this issue Jan 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jcassette
Copy link

jcassette commented Jan 27, 2024

Describe the bug

See below

Steps to reproduce

>>> qbittorrent = qbittorrentapi.Client(host=QB_HOST, port=QB_PORT, username=QB_USERNAME, password=QB_PASSWORD)
>>> qbittorrent.auth_log_in()
>>> torrents = qbittorrent.torrents_info()
>>> print(torrents[0].properties)
TorrentPropertiesDictionary(...)
>>> torrents = qbittorrent.torrents_info()[0:1]
>>> print(torrents[0].properties)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/julien/qbittorrent/lib64/python3.12/site-packages/qbittorrentapi/_attrdict.py", line 146, in __getattr__
    raise AttributeError(
AttributeError: 'TorrentDictionary' instance has no attribute 'properties'

Expected behavior

>>> qbittorrent = qbittorrentapi.Client(host=QB_HOST, port=QB_PORT, username=QB_USERNAME, password=QB_PASSWORD)
>>> qbittorrent.auth_log_in()
>>> torrents = qbittorrent.torrents_info()
>>> print(torrents[0].properties)
TorrentPropertiesDictionary(...)
>>> torrents = qbittorrent.torrents_info()[0:1]
>>> print(torrents[0].properties)
TorrentPropertiesDictionary(...)

Screenshots

No response

Environment

  • Operating System: Fedora Linux 39
  • Python version: 3.12.1
  • Software versions:
    • qBittorrent: 4.5.4
    • qbittorrent-api: 2024.1.58

Additional context

No response

@jcassette jcassette added the bug Something isn't working label Jan 27, 2024
@rmartin16
Copy link
Owner

I can replicate this behavior and it is almost certainly related to the list slicing. Unfortunately, slicing can create wholly new objects and has had unfortunate side effects before in this library.

I haven't determined the root causes specifically here yet...but slicing, in general, seems to be problematic for this implementation...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants