Nick Coghlan added the comment:

Attached diff shows a proof of concept fixer for the encode case.

It could be adjusted fairly easily to also handle decode methods (by including 
an alternative in the pattern and also capturing the method name)

I'm sure how useful such a fixer would be in practice, though, since it only 
triggers when the codec name is passed as a literal - passing in a variable 
instead keeps it from firing.

----------
keywords: +patch
Added file: 
http://bugs.python.org/file32515/issue17823_lib2to3_fixer_for_binary_codecs.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17823>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to