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

Fix line number for known_hosts error messages. #401

Closed

Conversation

@dylanahsmith
Copy link
Contributor

@dylanahsmith dylanahsmith commented Sep 22, 2014

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
Copy link
Member

@bitprophet bitprophet commented Nov 3, 2015

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
Copy link
Member

@bitprophet bitprophet commented Nov 3, 2015

Also, no idea why I punted this to 1.16.

@bitprophet bitprophet removed this from the 1.16 milestone Nov 3, 2015
@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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants