Posted By

dmitrydavidov on 09/05/11


Tagged

python bug


Versions (?)

Right function "enum_types" in "mimetypes.py"


 / Published in: Python
 

  1. def enum_types(mimedb):
  2. i = 0
  3. while True:
  4. try:
  5. ctype = _winreg.EnumKey(mimedb, i)
  6. except EnvironmentError:
  7. break
  8. try:
  9. ctype = ctype.encode(default_encoding) # omit in 3.x!
  10. except UnicodeError:
  11. pass
  12. else:
  13. yield ctype
  14. i += 1

Report this snippet  

You need to login to post a comment.