-
-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unicode handling in Exiters (#6032)
### Problem Three unicode issues had snuck into the two `Exiter` implementations (with/without `pantsd`), which prevented a useful error from rendering in the local case, and caused `pantsd` to hang up in the remote case. ### Solution Add a unicode-containing compilation failure integration test that runs with/without `pantsd`, and fix the three issues. ### Result Unicode-containing exceptions should render correctly in more cases.
- Loading branch information
Stu Hood
authored
Jun 27, 2018
1 parent
c5e0102
commit 8fdee38
Showing
7 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python_library() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This file is expected to fail to "compile", and raise a unicode error while doing so. | ||
# Because the error itself contains unicode, it can exercise that error handling codepaths | ||
# are unicode aware. | ||
import sys¡ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# coding=utf-8 | ||
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, | ||
unicode_literals, with_statement) | ||
|
||
from pants_test.pants_run_integration_test import PantsRunIntegrationTest, ensure_daemon | ||
|
||
|
||
class ExiterIntegrationTest(PantsRunIntegrationTest): | ||
"""Tests that "interesting" exceptions are properly rendered.""" | ||
|
||
@ensure_daemon | ||
def test_unicode_containing_exception(self): | ||
"""Test whether we can run a single target without special flags.""" | ||
pants_run = self.run_pants(['test', 'testprojects/src/python/unicode/compilation_failure']) | ||
self.assert_failure(pants_run) | ||
|
||
self.assertIn('during bytecode compilation', pants_run.stderr_data) | ||
self.assertIn('import sys¡', pants_run.stderr_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters