pytr-org / pytr

Use TradeRepublic in terminal and mass download all documents
https://pypi.org/project/pytr/
MIT License
407 stars 72 forks source link

UnboundLocalError: cannot access local variable 'subscription' where it is not associated with a value #124

Open psysxet opened 3 weeks ago

psysxet commented 3 weeks ago

Description of the bug UnboundLocalError: cannot access local variable 'subscription' where it is not associated with a value

To Reproduce Steps to reproduce the behavior:

$pytr dl_docs c:/steuer2023

Expected behavior not showing a bug, but downloading the files

Error log

Received error message: '1 E {"errors":[{"errorCode":"UNKNOWN_ERROR","errorField":null,"errorMessage":"Unknown error","meta":{"source":"PLATFORM"}}]}' 10:20:24 ('1', {'type': 'timeline', 'after': None}, {'errors': [{'errorCode': 'UNKNOWN_ERROR', 'errorField': None, 'errorMessage': 'Unknown error', 'meta': {'source': 'PLATFORM'}}]}) Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "c:\users\psys\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\scripts\pytr.exe__main.py", line 7, in File "C:\Users\psys\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pytr\main.py", line 208, in main asyncio.get_event_loop().run_until_complete(dl.dl_loop()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 654, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\psys\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pytr\dl.py", line 77, in dl_loop if subscription['type'] == 'timeline': ^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'subscription' where it is not associated with a value

Environment

Katzmann1983 commented 5 days ago

Sorry, this bug is not easily reproducible. I modified the code, so that in case it happens again, the error should be more helpful. Please download the latest release 0.3.0 and test again.