Comments (7)
Seems ok in Linux in 3.5-3.9, fwiw.
Linux 3.5-3.9
$ python3.5 -c 'import time; f = "%a %b %d %H:%M:%S %Y"; d = "Fri Feb 12 16:02:56 2021"; r = time.strptime(d, f); print(r)'
time.struct_time(tm_year=2021, tm_mon=2, tm_mday=12, tm_hour=16, tm_min=2, tm_sec=56, tm_wday=4, tm_yday=43, tm_isdst=-1)
$ python3.6 -c 'import time; f = "%a %b %d %H:%M:%S %Y"; d = "Fri Feb 12 16:02:56 2021"; r = time.strptime(d, f); print(r)'
time.struct_time(tm_year=2021, tm_mon=2, tm_mday=12, tm_hour=16, tm_min=2, tm_sec=56, tm_wday=4, tm_yday=43, tm_isdst=-1)
$ python3.7 -c 'import time; f = "%a %b %d %H:%M:%S %Y"; d = "Fri Feb 12 16:02:56 2021"; r = time.strptime(d, f); print(r)'
time.struct_time(tm_year=2021, tm_mon=2, tm_mday=12, tm_hour=16, tm_min=2, tm_sec=56, tm_wday=4, tm_yday=43, tm_isdst=-1)
$ python3.8 -c 'import time; f = "%a %b %d %H:%M:%S %Y"; d = "Fri Feb 12 16:02:56 2021"; r = time.strptime(d, f); print(r)'
time.struct_time(tm_year=2021, tm_mon=2, tm_mday=12, tm_hour=16, tm_min=2, tm_sec=56, tm_wday=4, tm_yday=43, tm_isdst=-1)
$ python3.9 -c 'import time; f = "%a %b %d %H:%M:%S %Y"; d = "Fri Feb 12 16:02:56 2021"; r = time.strptime(d, f); print(r)'
time.struct_time(tm_year=2021, tm_mon=2, tm_mday=12, tm_hour=16, tm_min=2, tm_sec=56, tm_wday=4, tm_yday=43, tm_isdst=-1)
from plotman.
Likewise in Windows 3.5-3.9. No other inspiration at the moment. Also confirmed with romp across macOS as well.
Windows 3.5-3.9
PS C:\Users\sda> py -3.5 -c "import time; f = '%a %b %d %H:%M:%S %Y'; d = 'Fri Feb 12 16:02:56 2021'; r = time.strptime(d, f); print(r)"
time.struct_time(tm_year=2021, tm_mon=2, tm_mday=12, tm_hour=16, tm_min=2, tm_sec=56, tm_wday=4, tm_yday=43, tm_isdst=-1)
PS C:\Users\sda> py -3.6 -c "import time; f = '%a %b %d %H:%M:%S %Y'; d = 'Fri Feb 12 16:02:56 2021'; r = time.strptime(d, f); print(r)"
time.struct_time(tm_year=2021, tm_mon=2, tm_mday=12, tm_hour=16, tm_min=2, tm_sec=56, tm_wday=4, tm_yday=43, tm_isdst=-1)
PS C:\Users\sda> py -3.7 -c "import time; f = '%a %b %d %H:%M:%S %Y'; d = 'Fri Feb 12 16:02:56 2021'; r = time.strptime(d, f); print(r)"
time.struct_time(tm_year=2021, tm_mon=2, tm_mday=12, tm_hour=16, tm_min=2, tm_sec=56, tm_wday=4, tm_yday=43, tm_isdst=-1)
PS C:\Users\sda> py -3.8 -c "import time; f = '%a %b %d %H:%M:%S %Y'; d = 'Fri Feb 12 16:02:56 2021'; r = time.strptime(d, f); print(r)"
time.struct_time(tm_year=2021, tm_mon=2, tm_mday=12, tm_hour=16, tm_min=2, tm_sec=56, tm_wday=4, tm_yday=43, tm_isdst=-1)
PS C:\Users\sda> py -3.9 -c "import time; f = '%a %b %d %H:%M:%S %Y'; d = 'Fri Feb 12 16:02:56 2021'; r = time.strptime(d, f); print(r)"
time.struct_time(tm_year=2021, tm_mon=2, tm_mday=12, tm_hour=16, tm_min=2, tm_sec=56, tm_wday=4, tm_yday=43, tm_isdst=-1)
from plotman.
stacktrace from reporter:
jobs = Job.get_running_jobs(dir_cfg['log'])
File "/chia/plotman/job.py", line 66, in get_running_jobs
jobs.append(Job(proc, logroot))
File "/chia/plotman/job.py", line 135, in init
self.init_from_logfile()
File "/chia/plotman/job.py", line 156, in init_from_logfile
self.start_time = datetime.strptime(m.group(1), '%a %b %d %H:%M:%S %Y')
File "/usr/lib/python3.8/strptime.py", line 568, in strptime_datetime
tt, fraction, gmtoff_fraction = strptime(datastring, format)
File "/usr/lib/python3.8/strptime.py", line 349, in strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data 'Fri Feb 12 16:02:56 2021' does not match format '%a %b %d %H:%M:%S %Y'
platform 5.8.0-43-generic #49-Ubuntu SMP Fri Feb 5 03:01:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
One thing that looks suspicious is the two spaces between %b
and %d
in the format string?
from plotman.
Hi, I've tested and to reproduce the issue set the locale time is set to : LC_TIME=de_CH.UTF-8 it crashes, but when I set this to LC_TIME=en_US.UTF-8 no problem.
from plotman.
Thanks! I suspected it might have to do with locale. I'm guessing in de_CH the expectation for Friday abbreviation is 'Fr' for Freitag?
FWIW, we're reading from a file produced by a different program in a different code base (the chia plotter) so we have no real guarantee of the format or locale with which it was produced.
The right approach here is probably to do something fuzzier and best-effort to make as much sense of the log datetime as we can.
from plotman.
A workaround is to use:
export LC_TIME=en_US.UTF-8
from plotman.
The linked fix seems to be on development only, this issue can be closed once in main?
from plotman.
Related Issues (20)
- Allow Randomization of Archive Drive Destinations HOT 3
- Configuration file does not show by default the pool_contract_address HOT 1
- Plotman v0.5 on mac osx creates new plot every 20 secs HOT 10
- how to create new plots
- phase stagger doesn't work with madmax? HOT 18
- log file stops at [P4] Writing C2 table . madmax HOT 2
- Increasing archive throughput HOT 13
- Fixed secondary temp -2 folder is inflexible tbh HOT 8
- allow passing of k setting with madmax HOT 4
- M1 Mac Mini, fresh install errors HOT 2
- finding unused dst dirs fails because of trailing slash "/" mismatch HOT 1
- v0.5.2 breaks with config file used in v0.5.1 HOT 4
- Plotman (k33) keeps making plots for a -d storage disk that's already full - it even reports it as full! HOT 1
- ParserError first time running plotman HOT 1
- Install fails when upgrading to chia 1.3, Debian 11, Python 3.9 HOT 6
- archiving issue HOT 1
- Error in resources/target_definitions.yaml - rsyncd - transfer_script HOT 6
- archiving does not pick up compressed plots HOT 3
- Allow Bitblade CUDA to create more than 1 plot per run (-n) HOT 2
- pip install does not work on Ubuntu 22.04 LTS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plotman.