Fix line number for known_hosts error messages. #401

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@dylanahsmith
Contributor

Line number for files conventionally start with 1, but using for lineno, line in enumerate(f): would consider the first line to be line 0.

Passing an initial value of 1 to enumerate will fix this line number.

@bitprophet bitprophet added this to the 1.16 milestone Nov 2, 2015
@bitprophet
Member

Took me a while to realize that this only impacts log lines and not actual exceptions. 😩 One can reproduce the incorrect-line-number messages by enabling logging, mangling a known_hosts file so it includes lines like e.g. foo (vs foo ssh-rsa <key text>) and then calling e.g. SSHClient.load_system_host_keys.

@bitprophet
Member

Also, no idea why I punted this to 1.16.

@bitprophet bitprophet removed this from the 1.16 milestone Nov 3, 2015
@bitprophet bitprophet added a commit that closed this pull request Nov 3, 2015
@bitprophet bitprophet Changelog closes #401 3a5227c
@bitprophet bitprophet closed this in 3a5227c Nov 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment