-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #119 #120
Fix #119 #120
Conversation
Pull Request Test Coverage Report for Build 175
💛 - Coveralls |
Well, the test is failing for me locally with |
@lubomir the test should fail on Travis? Couple things to notice, you probably are on Fedora, Travis probably on Ubuntu, also, locale and/or language settings may differ from your distro to Travis. |
tests/test_shortcuts.py
Outdated
@@ -199,6 +199,12 @@ def test_run_show_cmd_logfile_stdout(self, mock_out): | |||
self.assertEqual(mock_out.getvalue(), | |||
'COMMAND: echo foo\n-----------------\nfoo\n') | |||
|
|||
def test_run_split_in_middle_of_utf8_sequence(self): | |||
logfile = os.path.join(self.tmp_dir, 'output.log') | |||
cmd = "printf ' ' && printf 'č%.0s' {1..10000}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently this isn't working properly in Travis because that {1..10000} syntax is a feature of bash, not supported by the dash shell used by Debian & Ubuntu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes sense. I'll rework to avoid that then.
@@ -199,6 +199,12 @@ def test_run_show_cmd_logfile_stdout(self, mock_out): | |||
self.assertEqual(mock_out.getvalue(), | |||
'COMMAND: echo foo\n-----------------\nfoo\n') | |||
|
|||
def test_run_split_in_middle_of_utf8_sequence(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're only planning to add the test now and not a fix, would you like to add an xfail marker here? Otherwise we can't merge it without breaking CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't merge this. I wanted provide a reproducer. I may get to writing a fix for this eventually, but not sure when.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the xfail. If you want to, feel free to merge.
b2a8250
to
9efaeeb
Compare
tests/test_shortcuts.py
Outdated
@@ -199,6 +201,13 @@ def test_run_show_cmd_logfile_stdout(self, mock_out): | |||
self.assertEqual(mock_out.getvalue(), | |||
'COMMAND: echo foo\n-----------------\nfoo\n') | |||
|
|||
@pytest.mark.xfail(reason="Not fixed yet (#119)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add strict=True to xfail
9efaeeb
to
750a0eb
Compare
I added another commit that seems to fix the issue (at least it makes the test pass). I'm not sure if it's the best possible fix though. |
6a854b0
to
73fc568
Compare
When there is an incomplete multibyte sequence, process the data only until the start of this sequence. When next chunk is read, prepend the left overs to it. This should complete the sequence and processing should continue normally. Fixes: release-engineering#119
73fc568
to
e03a8b4
Compare
When there is an incomplete multibyte sequence, process the data only until the start of this sequence. When next chunk is read, prepend the left overs to it. This should complete the sequence and processing should continue normally.
Fixes: #119