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

ENH: Clearer warning with lines which failed to decode correctly #723

Merged
merged 1 commit into from May 30, 2014

Conversation

kwirk
Copy link
Contributor

@kwirk kwirk commented May 15, 2014

This is to make it clear that lines are still processed, even if strict decoding fails. Ref #718

(self.getFileName(), self.getEncoding(), `line`))
logSys.warning(
"Error decoding line from '%s' with '%s'. Continuing "
" to process line ignoring invalid characters: %r" %
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well... with python2 it would not decode line at all, not just ignore those invalid characters... btw -- I wondered why in d23d365 you added decoding with 'ignore' only for python3 and not also for python2 (seems to be available there too)? ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe at the time, the idea was trying to keep behaviour the same as 0.8, but this wasn't possible in Python 3. I think however, that it would be better for Python 2 version to have the same behaviour as Python 3, as this keeps it consistent, and probably is the behaviour users would expect when specifying a encoding.

yarikoptic added a commit that referenced this pull request May 30, 2014
ENH: Clearer warning with lines which failed to decode correctly
@yarikoptic yarikoptic merged commit 98daa9d into fail2ban:master May 30, 2014
@kwirk
Copy link
Contributor Author

kwirk commented Jun 2, 2014

Thanks for merging @yarikoptic. Did you have any thoughts about changing the code to have same behaviour in both Python 2 and 3?

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

Successfully merging this pull request may close these issues.

None yet

2 participants