Skip to content

Instantly share code, notes, and snippets.

@yin8086
Created October 15, 2014 02:44
Show Gist options
  • Save yin8086/cd2ff145150cb387b0ad to your computer and use it in GitHub Desktop.
Save yin8086/cd2ff145150cb387b0ad to your computer and use it in GitHub Desktop.
Modify the ipython notebook error in Python
# Python27/Lib/mimetypes.py
# Line 248
# Original Line, comment the following lines
def enum_types(mimedb):
i = 0
while True:
try:
ctype = _winreg.EnumKey(mimedb, i)
except EnvironmentError:
break
# try:
# ctype = ctype.encode(default_encoding) # omit in 3.x!
# except UnicodeEncodeError:
# pass
else:
yield ctype
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment