Skip to content

Instantly share code, notes, and snippets.

@nilp0inter
Created December 10, 2013 21:26
Show Gist options
  • Save nilp0inter/7900502 to your computer and use it in GitHub Desktop.
Save nilp0inter/7900502 to your computer and use it in GitHub Desktop.
import sys
BAD_VERSIONS = [
(2, 4),
(2, 5),
(2, 6) ]
TRANSLATE_TEXT = sys.version_info[:2] in BAD_VERSIONS
# Encoding used for the PKG-INFO files
PKG_INFO_ENCODING = 'utf-8'
def _(text):
if TRANSLATE_TEXT:
return text.encode(PKG_INFO_ENCODING)
else:
return text
AUTHORS = _(u'Alejandro Galindo García, Roberto Abdelkader Martínez Pérez')
@nilp0inter
Copy link
Author

This is a snippet to show a possible fix for a distutils bug with file encodings.
nilp0inter/cpe#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment