-
Notifications
You must be signed in to change notification settings - Fork 22
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
Humanization of ints fails for values > 2,592,000 (1 month) #1358
Labels
work-around
a work-around is provided, mitigating the issue.
Comments
MagikEh
changed the title
Humanize ints fails for more than 2,592,000
Humanization of ints fails for values > 2,592,000 (1 month)
Dec 22, 2024
petersilva
added a commit
that referenced
this issue
Dec 23, 2024
petersilva
added a commit
that referenced
this issue
Dec 23, 2024
so added a bunch of tests to the unit tests and found out weird stuff:
fractal% python3
Python 3.12.3 (main, Nov 6 2024, 18:32:19) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from humanize import naturaldelta as nd
>>> nd( 30*24*3600 )
'30 days'
>>> nd( 31*24*3600 )
'a month'
>>> nd( 61*24*3600 )
'2 months'
>>> nd( 60*24*3600 )
'a month'
>>>
|
I like weeks... so I kept it in the conversion from a string to a second interval... but since humanize doesn't return it... it's one way. |
work-around: people are removing metrics files to prevent the occurrence on other systems. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sarracenia/sarracenia/__init__.py
Line 326 in 95ad518
As Such when calling
durationToString(2681007.932507038)
,first_part
becomesa month
and thenamonth
due to the final.replace(" ","")
and clogs up anysr3 status
run because of thed-int(first_part[0:-1])
receiving non-digit characters.Not sure if we want to be more intelligent with the order of operations
and then replace the rest of the array logic with more regex oriented replacements to strip out the numerical values? (to prevent string format assumptions from breaking things again)
Or if some other solution should be discovered.
Fixed in operations temporarily by surrounding with a try/catch and setting the catch to output `'>30d'.
Here's the stacktrace that lead me to this error.
The text was updated successfully, but these errors were encountered: