Skip to content

Problem with utf-8 content in python file #1

@naro

Description

@naro

Let's have this content in new SublimeText window:

# -*- coding: utf-8 -*-
print "Ahoj světe"

Invoking PythonTidy generates this traceback in console:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 282, in run_
  File "./Tidy.py", line 37, in run
    PythonTidy.tidy_up(source, output)
  File "/Users/naro/Library/Application Support/Sublime Text 2/Packages/PythonTidy/PythonTidy/PythonTidy.py", line 4809, in tidy_up
    module = compiler.parse(str(INPUT))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u011b' in position 38: ordinal not in range(128)

For ascii-only files it works fine. Running

python PythonTidy/runner.py test1.py

works as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions