Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error on Ubuntu 12.04 #7

Open
deshack opened this Issue · 3 comments

3 participants

@deshack

Package version: 0.2.8
Operating System: Ubuntu 12.04 LTS
Python version: 2.7.3
Error message (when launching "archey" command):

Traceback (most recent call last):
File "/usr/bin/archey", line 304, in
func()
File "/usr/bin/archey", line 288, in disk_display
usedpercent = float(re.sub("[A-Z]", "", used)) / float(re.sub("[A-Z]", "", size)) * 100
ValueError: invalid literal for float(): 4,9

@deshack

With python 3.2.3 the error is still present, but last line is different:

ValueError: inalid literal for float(): 5,0

@jherazob

It's the comma. I put a print statement on the line before this one and ran it on a machine where the error appeared, it gave me this:
used: 2,3T -- size: 3,6T
The commas are tripping it up. Python expects dots, not commas in floats.

I changed the two preceding lines to:

 used = re.sub(",",".",total.split()[3])
 size = re.sub(",",".",total.split()[2])

And voila! Problem fixed.

@narrowfail

Quick fix:

used = used.replace(',','.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.