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.

py27 TypeError: write() argument 1 must be unicode, not str

See original GitHub issue

Looks like the default terminator of ‘\n’ isn’t happy being written to an io stream due to the default encoding. A work around is to set terminator to u’\n’. Is there a better fix for this though?

__init__.py, line 337, in do_write
    stream.write(self.terminator)
TypeError: write() argument 1 must be unicode, not str

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
internetcommented, May 10, 2019

Seems to be working fine here too! Thanks again!

1reaction
joe-urciuolicommented, May 7, 2019

Thank you Preston - Looks good!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: write() argument 1 must be unicode, not str
Your problem is that urlopen returns a bytes-oriented file-like object, while io.open expects true text inputs (where "text" means " unicode ...
Read more >
TypeError: write() argument 1 must be unicode, not str
Hi All,. I am currently trying to create a package for my kivy project and I tried to build it for android on...
Read more >
python3报write() argument 1 must be unicode, not str的解决办法
执行output_json_file 功能函数时候,print 打印出write() argument 1 must be unicode, not str的错误错误代码...
Read more >
Commit - python-ldap - Pagure.io
TOXENV=py27 ... In Python 3, text values are represented as ``str``, the Unicode text type. ... "search_ext() argument 1 must be str, not...
Read more >
12847 (TypeError: unicode argument expected, got 'str')
StringIO() >>> s.write('&') Traceback (most recent call last): File "<input>", line 1, in <module> s.write('&') TypeError: unicode argument ...
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