equal
deleted
inserted
replaced
329 # Python 2.x's mimetypes module attempts to decode strings |
329 # Python 2.x's mimetypes module attempts to decode strings |
330 # from Windows' ANSI APIs as ascii (fail), then re-encode them |
330 # from Windows' ANSI APIs as ascii (fail), then re-encode them |
331 # as ascii (clown fail), because the default Python Unicode |
331 # as ascii (clown fail), because the default Python Unicode |
332 # codec is hardcoded as ascii. |
332 # codec is hardcoded as ascii. |
333 |
333 |
|
334 sys.argv # unwrap demand-loader so that reload() works |
334 reload(sys) # resurrect sys.setdefaultencoding() |
335 reload(sys) # resurrect sys.setdefaultencoding() |
335 oldenc = sys.getdefaultencoding() |
336 oldenc = sys.getdefaultencoding() |
336 sys.setdefaultencoding("latin1") # or any full 8-bit encoding |
337 sys.setdefaultencoding("latin1") # or any full 8-bit encoding |
337 mimetypes.init() |
338 mimetypes.init() |
338 sys.setdefaultencoding(oldenc) |
339 sys.setdefaultencoding(oldenc) |