Skip to content

car_id 'int' object has no attribute 'isdigit' #33

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
freinbichler opened this issue Mar 21, 2024 · 5 comments
Closed

car_id 'int' object has no attribute 'isdigit' #33

freinbichler opened this issue Mar 21, 2024 · 5 comments

Comments

@freinbichler
Copy link

freinbichler commented Mar 21, 2024

After upgrading to v0.7.2 I am getting the following error (with and without setting the CAR_ID env variable):

teslamate-teslamatetelegrambot-1  | Traceback (most recent call last):
teslamate-teslamatetelegrambot-1  |   File "/app/./src/teslamte_telegram_bot.py", line 64, in <module>
teslamate-teslamatetelegrambot-1  |     if not car_id.isdigit() or int(car_id) < 1:
teslamate-teslamatetelegrambot-1  |            ^^^^^^^^^^^^^^
teslamate-teslamatetelegrambot-1  | AttributeError: 'int' object has no attribute 'isdigit'
teslamate-teslamatetelegrambot-1  | Traceback (most recent call last):
teslamate-teslamatetelegrambot-1  |   File "/app/./src/teslamte_telegram_bot.py", line 64, in <module>
teslamate-teslamatetelegrambot-1  |     if not car_id.isdigit() or int(car_id) < 1:
teslamate-teslamatetelegrambot-1  |            ^^^^^^^^^^^^^^
teslamate-teslamatetelegrambot-1  | AttributeError: 'int' object has no attribute 'isdigit'
teslamate-teslamatetelegrambot-1  | Traceback (most recent call last):
teslamate-teslamatetelegrambot-1  |   File "/app/./src/teslamte_telegram_bot.py", line 64, in <module>
teslamate-teslamatetelegrambot-1  |     if not car_id.isdigit() or int(car_id) < 1:
teslamate-teslamatetelegrambot-1  |            ^^^^^^^^^^^^^^
teslamate-teslamatetelegrambot-1  | AttributeError: 'int' object has no attribute 'isdigit'
teslamate-teslamatetelegrambot-1  | Traceback (most recent call last):
teslamate-teslamatetelegrambot-1  |   File "/app/./src/teslamte_telegram_bot.py", line 64, in <module>
teslamate-teslamatetelegrambot-1  |     if not car_id.isdigit() or int(car_id) < 1:
teslamate-teslamatetelegrambot-1  |            ^^^^^^^^^^^^^^
teslamate-teslamatetelegrambot-1  | AttributeError: 'int' object has no attribute 'isdigit'
teslamate-teslamatetelegrambot-1  | Traceback (most recent call last):
teslamate-teslamatetelegrambot-1  |   File "/app/./src/teslamte_telegram_bot.py", line 64, in <module>
teslamate-teslamatetelegrambot-1  |     if not car_id.isdigit() or int(car_id) < 1:
teslamate-teslamatetelegrambot-1  |            ^^^^^^^^^^^^^^
teslamate-teslamatetelegrambot-1  | AttributeError: 'int' object has no attribute 'isdigit'
teslamate-teslamatetelegrambot-1  | Traceback (most recent call last):
teslamate-teslamatetelegrambot-1  |   File "/app/./src/teslamte_telegram_bot.py", line 64, in <module>
teslamate-teslamatetelegrambot-1  |     if not car_id.isdigit() or int(car_id) < 1:
teslamate-teslamatetelegrambot-1  |            ^^^^^^^^^^^^^^
teslamate-teslamatetelegrambot-1  | AttributeError: 'int' object has no attribute 'isdigit'

Btw: there is a typo in the filename teslamte_telegram_bot.py

@JakobLichterfeld
Copy link
Owner

Thanks for reporting, will try to reproduce and fix accordingly

@freinbichler
Copy link
Author

The reason should be that .isdigit() is a String method, however car_id is of type int.
However, if I set the environment variable as a string, I get the following error:
ERROR - Error: Please set the environment variable CAR_ID to a valid number and try again.

@JakobLichterfeld
Copy link
Owner

Sorry again, was doing too much in parallel and found an issue in my test system. Will fix and release new version by today

@JakobLichterfeld
Copy link
Owner

Btw: there is a typo in the filename teslamte_telegram_bot.py

Good catch!

@JakobLichterfeld
Copy link
Owner

Will release after lunch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants