Skip to content

Commit 3791b25

Browse files
authored
Merge pull request #439 from Shougo/unicode_errors
2 parents 2cbc135 + 76c3105 commit 3791b25

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pynvim/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def find_module(fullname, path):
3434
unicode_errors_default = 'surrogateescape'
3535
else:
3636
find_module = original_find_module
37-
unicode_errors_default = 'strict'
37+
unicode_errors_default = 'ignore'
3838

3939
NUM_TYPES = (int, long, float)
4040

pynvim/msgpack_rpc/msgpack_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, event_loop):
2121
"""Wrap `event_loop` on a msgpack-aware interface."""
2222
self.loop = event_loop
2323
self._packer = Packer(unicode_errors=unicode_errors_default)
24-
self._unpacker = Unpacker()
24+
self._unpacker = Unpacker(unicode_errors=unicode_errors_default)
2525
self._message_cb = None
2626

2727
def threadsafe_call(self, fn):

test/test_buffer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ def test_mark(vim):
164164
def test_invalid_utf8(vim):
165165
vim.command('normal "=printf("%c", 0xFF)\np')
166166
assert vim.eval("char2nr(getline(1))") == 0xFF
167-
168167
assert vim.current.buffer[:] == ['\udcff'] if IS_PYTHON3 else ['\xff']
168+
169169
vim.current.line += 'x'
170-
assert vim.eval("getline(1)", decode=False) == b'\xFFx'
170+
assert vim.eval("getline(1)", decode=False) == '\udcffx' if IS_PYTHON3 else '\xffx'
171171
assert vim.current.buffer[:] == ['\udcffx'] if IS_PYTHON3 else ['\xffx']
172172

173173

0 commit comments

Comments
 (0)