Skip to content
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

invalid literal for float() #463

Open
yuhongzhi opened this issue Jan 9, 2017 · 6 comments
Open

invalid literal for float() #463

yuhongzhi opened this issue Jan 9, 2017 · 6 comments

Comments

@yuhongzhi
Copy link

File "/home/X/.autojump/bin/autojump", line 320, in
sys.exit(main(parse_arguments()))
File "/home/X/.autojump/bin/autojump", line 264, in main
save(config, first(add_path(load(config), args.add)))
File "/home/X/.autojump/bin/autojump_data.py", line 83, in load
ifilter(correct_length, imap(parse, f))))
File "/home/X/.autojump/bin/autojump_data.py", line 73, in
tupleize = lambda x: (x[1], float(x[0]))
ValueError: invalid literal for float(): 17.32050817.3205080757

@wangwpf
Copy link

wangwpf commented Mar 28, 2017

I have encountered this problem, is there a solution?
OS: Ubuntu 12.04
python: 2.7.3
shell: zsh

@ampedandwired
Copy link

Same here:

Traceback (most recent call last):
  File "/usr/bin/autojump", line 420, in <module>
    sys.exit(main(parse_arguments()))
  File "/usr/bin/autojump", line 392, in main
    entries = entriefy(load(config))
  File "/usr/share/autojump/autojump_data.py", line 81, in load
    ifilter(correct_length, imap(parse, f))))
  File "/usr/share/autojump/autojump_data.py", line 71, in <lambda>
    tupleize = lambda x: (x[1], float(x[0]))
ValueError: could not convert string to float: 'j��\x16��L'

Looks like there's some garbage in the database somehow.

@ampedandwired
Copy link

I found a database backup in ~/.local/share/autojump/autojump.txt.bak. Restoring this resolved the problem for me. So seems that somehow corrupted data is getting into the autojump DB which causes the exception.

@pabloab
Copy link

pabloab commented Nov 28, 2017

In my case autojump.txt became completely binary/"garbage" after autojump crash (don't know why). strings autojump.txt doesn't give anything useful. Fixed overwriting with autojump.txt.bak. Compared side by side with an hex editor and at least at first look I could't find any pattern. Using v22.2.4, Python 2.7.12.

@jab
Copy link

jab commented Apr 12, 2018

Just hit this on macOS running with a fresh homebrew --HEAD install. Removing ~/Library/autojump/autojump.txt{,.bak} did the trick.

@pabloab
Copy link

pabloab commented Feb 27, 2019

I cross again with this bug, this time with v22.2.4 Python 3.6.7. In this case I'm pretty sure the problem was moving around files with Cyrillic characters. The error was ValueError: could not convert string to float: '��m�\x18U(�϶'

BTW if you cat those files you might need to fix the messed terminal with reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants