Pydevの注意
Pydevでデバッグ実行すると止まる症状。
[Eclipseホーム]\plugins\org.python.pydev_2.7.0.2012080220\pysrc\_pydev_execfile.py (バージョンはその時々で違うかも)
stream = open(file, 'rb') try: encoding = None encoding = 'utf-8' #<--追加してあげる #Get encoding! for _i in range(2): line = stream.readline() #Should not raise an exception even if there are no more contents #Must be a comment line if line.strip().startswith(b'#'): #Don't import re if there's no chance that there's an encoding in the line if b'coding' in line: import re p = re.search(br"coding[:=]\s*([-\w.]+)", line) if p: try: encoding = p.group(1).decode('ascii') break except: encoding = None
結構昔からの不具合みたいなんだけど対応してくれない。