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

Why is it optional to save credentials when pytr crashes as soon as you refuse to save? #14

Closed
C0D3D3V opened this issue Nov 26, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@C0D3D3V
Copy link

C0D3D3V commented Nov 26, 2021

Description of the bug
Why is it optional to save credentials when pytr crashes as soon as you refuse to save?

To Reproduce
Steps to reproduce the behavior:

  1. Run pytr login
  2. Refuse to save the credentials
  3. See error

Expected behavior
Would be great if the program works without me saving the credentials

Error log

C:\Users\Virtual>pytr login
13:07:02 Credentials file not found
Please enter your TradeRepbulic phone number in the format +4912345678:
+4912345678
Please enter your TradeRepbulic pin:
0000
Save credentials? Type "y" to save credentials:
n
13:07:24 Credentials not saved
Traceback (most recent call last):
  File "c:\users\virtual\appdata\local\programs\python\python38-32\lib\site-packages\pytr\api.py", line 89, in __init__
    with open(CREDENTIALS_FILE, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Virtual\\.pytr\\credentials'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\virtual\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\virtual\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Virtual\AppData\Local\Programs\Python\Python38-32\Scripts\pytr.exe\__main__.py", line 7, in <module>
  File "c:\users\virtual\appdata\local\programs\python\python38-32\lib\site-packages\pytr\main.py", line 143, in main
    login(phone_no=args.phone_no, pin=args.pin, web=weblogin)
  File "c:\users\virtual\appdata\local\programs\python\python38-32\lib\site-packages\pytr\account.py", line 61, in login
    tr = TradeRepublicApi()
  File "c:\users\virtual\appdata\local\programs\python\python38-32\lib\site-packages\pytr\api.py", line 94, in __init__
    raise ValueError(f'phone_no and pin must be specified explicitly or via {CREDENTIALS_FILE}')
ValueError: phone_no and pin must be specified explicitly or via C:\Users\Virtual\.pytr\credentials

Environment

  • OS: Windows
  • Version: pytr-0.0.9
@C0D3D3V C0D3D3V added the bug Something isn't working label Nov 26, 2021
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

1 participant