Open yuhongzhi opened 7 years ago
I have encountered this problem, is there a solution? OS: Ubuntu 12.04 python: 2.7.3 shell: zsh
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.
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.
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.
Just hit this on macOS running with a fresh homebrew --HEAD
install. Removing ~/Library/autojump/autojump.txt{,.bak}
did the trick.
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
.
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