question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnicodeEncodeError: 'ascii' codec can't encode character '\xa9' in position 84

See original GitHub issue
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 389, in run_callback
    expr()
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 620, in <lambda>
    run_callback('on_hover', callback, lambda: callback.on_hover(v, point, hover_zone))
  File "/Users/user/Library/Application Support/Sublime Text 3/Packages/SourceKittenSubl/subl.py", line 35, in on_hover
    text = subl_source_kitten.popup(point, file, project_directory, text)
  File "/Users/user/Library/Application Support/Sublime Text 3/Packages/SourceKittenSubl/dependencies/../src/subl_source_kitten.py", line 22, in popup
    output = source_kitten.cursor_info(offset, file, project_directory, text)
  File "/Users/user/Library/Application Support/Sublime Text 3/Packages/SourceKittenSubl/dependencies/../src/source_kitten.py", line 49, in cursor_info
    tmp_file = _create_temp_file(text)
  File "/Users/user/Library/Application Support/Sublime Text 3/Packages/SourceKittenSubl/dependencies/../src/source_kitten.py", line 163, in _create_temp_file
    text_file.write(text)
UnicodeEncodeError: 'ascii' codec can't encode character '\xa9' in position 84: ordinal not in range(128)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nettlepcommented, Feb 15, 2018

This issue should be fixed in 08d213e (one of the commits from PR #26.)

The solution was to convert to UTF-8 and store the temporary file as binary.

0reactions
Dan2552commented, May 31, 2017

That indexing error definitely doesn’t sound related to this plugin.

I was referring to indexing: crawldb not available, indexing abandoned


Ok… That’s good to see the tests pass I guess. Suggests something is different between our Sublime Text setups affecting it.

Could you paste in your preferences file? Might also be worth checking any other plugins you have installed but I’m not sure how’s best to check them without uninstalling them 1 by 1 which I’d understand if you didn’t want to do that.


(re ps: cheers, guess I never tried 😊 I’ll log it)

Read more comments on GitHub >

github_iconTop Results From Across the Web

UnicodeEncodeError: 'ascii' codec can't encode character u ...
The issue is that when you call str(), python uses the default character encoding to try and encode the bytes you gave it,...
Read more >
'ascii' codec can't encode character in position | bobbyhadz
The Python "UnicodeEncodeError: 'ascii' codec can't encode character in position" occurs when we use the ascii codec to encode a string that contains ......
Read more >
Fix Python UnicodeEncodeError: 'ascii' codec can't encode ...
The UnicodeEncodeError we reproduced earlier, is caused due to the fact that when str() method is called, the interpreter will use the default...
Read more >
'ascii' codec can't encode character '\xe9' in position ... - GitHub
Description. UnicodeEncodeError: 'ascii' codec can't encode character '\xe9'. Expected behavior. No response. pip version.
Read more >
How To Fix Python Error - UnicodeEncodeError: 'ascii' codec ...
This is a very common error UnicodeEncodeError: 'ascii' codec can't encode character u'xa0' in position x.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found