Ticket #7835: trac_7835-preparsing-unicode.patch

File trac_7835-preparsing-unicode.patch, 856 bytes (added by timdumol, 11 years ago)

Adds '# -*- coding: utf-8 -*-' to the preparsing code.

  • sagenb/notebook/worksheet.py

    diff -r 4a442d0e5792 sagenb/notebook/worksheet.py
    a b  
    36543654        """
    36553655        # The extra newline below is necessary, since otherwise source
    36563656        # code introspection doesn't include the last line.
    3657         return 'open("%s","w").write(_support_.preparse_worksheet_cell(base64.b64decode("%s"),globals())+"\\n"); execfile(os.path.abspath("%s"))'%(CODE_PY, base64.b64encode(s), CODE_PY)
     3657        return 'open("%s","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("%s"),globals())+"\\n"); execfile(os.path.abspath("%s"))'%(CODE_PY, base64.b64encode(s), CODE_PY)
    36583658
    36593659    ##########################################################
    36603660    # Loading and attaching files