swar / Swar-Chia-Plot-Manager

This is a Cross-Platform Plot Manager for Chia Plotting that is simple, easy-to-use, and reliable.
GNU General Public License v3.0
1.25k stars 388 forks source link

AttributeError: 'NoneType' object has no attribute 'date' #731

Open VictorVolpe opened 3 years ago

VictorVolpe commented 3 years ago

Recurrent issue on Debian 10...

# python3.7 manager.py start
Plot Manager has started...
# python3.7 manager.py view
Traceback (most recent call last):
  File "manager.py", line 37, in <module>
    view()
  File "/usr/lib/Swar-Chia-Plot-Manager/plotmanager/library/utilities/commands.py", line 160, in view
    analysis = analyze_log_dates(log_directory=log_directory, analysis=analysis)
  File "/usr/lib/Swar-Chia-Plot-Manager/plotmanager/library/utilities/log.py", line 77, in analyze_log_dates
    analysis = _get_date_summary(analysis)
  File "/usr/lib/Swar-Chia-Plot-Manager/plotmanager/library/utilities/log.py", line 36, in _get_date_summary
    end_date = analysis['files'][file_path]['data']['date'].date()
AttributeError: 'NoneType' object has no attribute 'date'
# locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
# date
Sat 22 May 2021 03:01:04 AM -03
limebinary commented 3 years ago

I have the same problem, need to fix.

winkee01 commented 3 years ago

I had the same issue, this is because dateparser() does not correctly parse the date

VictorVolpe commented 3 years ago

I had the same issue, this is because dateparser() does not correctly parse the date

Nice, but how did you fix it?

MartinGao commented 3 years ago

I fixed this problem by using another lib moment instead of dateparser

here is what I did in case you are interested https://github.com/MartinGao/Swar-Chia-Plot-Manager/commit/b99039b4700fb88936ff623cb8438f74fedfaca2

but I have to say that I am not familiar with python at all. I picked moment simply because I happened to find this lib and it happened to fix this problem. Using another lib might not be the best way to fix this problem and I think with correct usage dateparser should be able to do the job but I did not dig into it since python is not my first-choice programming language.

laozhang713 commented 3 years ago

I fixed this problem by using another lib moment instead of dateparser

here is what I did in case you are interested MartinGao@b99039b

but I have to say that I am not familiar with python at all. I picked moment simply because I happened to find this lib and it happened to fix this problem. Using another lib might not be the best way to fix this problem and I think with correct usage dateparser should be able to do the job but I did not dig into it since python is not my first-choice programming language.

I fixed ! tks