firefly-cpp / AST-Monitor

AST-Monitor is a wearable Raspberry Pi computer for cyclists
MIT License
7 stars 6 forks source link

Path error #29

Closed firefly-cpp closed 2 years ago

firefly-cpp commented 2 years ago

FileNotFoundError: [Errno 2] No such file or directory: '../logs/../logs/../development/trainings/training0.json.log'

luckyLukac commented 2 years ago

@firefly-cpp can you please provide me with the file and the line where this error occurs?

firefly-cpp commented 2 years ago

Traceback (most recent call last): File "/usr/lib64/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib64/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/home/iztok/venvs/venv1/lib64/python3.10/site-packages/ast_monitor/model.py", line 245, in target=lambda: self.interval_training.start(write_log=True) File "/home/iztok/venvs/venv1/lib64/python3.10/site-packages/ast_monitor/interval_training.py", line 73, in start WriteLog.write_interval_training_header(self.log) File "/home/iztok/venvs/venv1/lib64/python3.10/site-packages/ast_monitor/write_log.py", line 19, in write_interval_training_header with open(path, 'a') as log: FileNotFoundError: [Errno 2] No such file or directory: '../logs/../logs/../development/trainings/training0.json.log'

luckyLukac commented 2 years ago

@firefly-cpp can you please try it now? It worked on my system all the time, though.

firefly-cpp commented 2 years ago

Fixed now. Logs folder was created.

luckyLukac commented 2 years ago

Does this represent a global issue or was it present only on your system?

firefly-cpp commented 2 years ago

It is specific issue for *nix systems.

luckyLukac commented 2 years ago

What exactly can we do to fix this issue? As far as I am aware, the folder should be downloaded to the system when cloning the repository.

firefly-cpp commented 2 years ago

FIxed in commit.

By the way, the application is now working correctly only when running from the examples folder. We should ensure that users can run applications from anywhere.

luckyLukac commented 2 years ago

Agreed. Maybe that is the matter of a new issue.