File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,8 +93,11 @@ def check(file):
9393 check (fullname )
9494 return
9595
96+ with open (file , 'rb' ) as f :
97+ encoding , lines = tokenize .detect_encoding (f .readline )
98+
9699 try :
97- f = open (file )
100+ f = open (file , encoding = encoding )
98101 except IOError as msg :
99102 errprint ("%r: I/O Error: %s" % (file , msg ))
100103 return
Original file line number Diff line number Diff line change @@ -375,7 +375,10 @@ C-API
375375Library
376376-------
377377
378- - Issue #4870: Add an `options` attribute to SSL contexts, as well as
378+ - Issue #8774: tabnanny uses the encoding cookie (#coding:...) to use the
379+ correct encoding
380+
381+ - Issue #4870: Add an `options` attribute to SSL contexts, as well as
379382 several ``OP_*`` constants to the `ssl` module. This allows to selectively
380383 disable protocol versions, when used in combination with `PROTOCOL_SSLv23`.
381384
You can’t perform that action at this time.
0 commit comments