You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace read_str_coding to use tokenize.detect_encoding() #975
Rewrite rope.base.fscommands.{unicode_to_file_data,file_data_to_unicode} and rope.base.resources to use tokenize.open()/detect_encoding().
Currently, we do some regex mucking to parse the encoding cookie. tokenize.open() is a documented way in the stdlib to open and decode a file with coding cookie and also handles BOM.
Open issue:
tokenize.detect_encoding() would raise syntax error on a file that has a BOM that doesn't match their coding cookie, should rope behave the same or should we attempt to be more tolerant of such ambiguities?
Activity
RajvanshSingh4 commentedon Nov 27, 2026
/assign
lieryan commentedon Nov 28, 2026
related: #966