hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kengo Seki (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-12303) test-patch pylint plugin fails silently and votes +1 incorrectly
Date Wed, 05 Aug 2015 18:01:05 GMT
Kengo Seki created HADOOP-12303:

             Summary: test-patch pylint plugin fails silently and votes +1 incorrectly
                 Key: HADOOP-12303
                 URL: https://issues.apache.org/jira/browse/HADOOP-12303
             Project: Hadoop Common
          Issue Type: Sub-task
          Components: yetus
    Affects Versions: HADOOP-12111
            Reporter: Kengo Seki

This patch

[sekikn@mobile hadoop]$ cat /tmp/test.patch 
diff --git a/dev-support/releasedocmaker.py b/dev-support/releasedocmaker.py
index 37bd58a..7cd6dd3 100755
--- a/dev-support/releasedocmaker.py
+++ b/dev-support/releasedocmaker.py
@@ -580,4 +580,4 @@ def main():
 if __name__ == "__main__":
-    main()
+    main( )

is supposed to cause the following pylint errors.

C:583, 0: No space allowed after bracket
    main( )
        ^ (bad-whitespace)
C:583, 0: No space allowed before bracket
    main( )
          ^ (bad-whitespace)

But the system locale is set as follows, pylint check is passed, and there is no pylint output.

[sekikn@mobile hadoop]$ locale
[sekikn@mobile hadoop]$ dev-support/test-patch.sh --basedir=/Users/sekikn/dev/hadoop --project=hadoop


| Vote |      Subsystem |  Runtime   | Comment
|  +1  |       @author  |  0m 00s    | The patch does not contain any @author 
|      |                |            | tags.
|  +1  |    asflicense  |  0m 21s    | Patch does not generate ASF License 
|      |                |            | warnings.
|  +1  |        pylint  |  0m 01s    | There were no new pylint issues. 
|  +1  |    whitespace  |  0m 00s    | Patch has no whitespace issues. 
|      |                |  0m 24s    | 


[sekikn@mobile hadoop]$ cat /private/tmp/test-patch-hadoop/8656/branch-pylint-result.txt 
[sekikn@mobile hadoop]$ cat /private/tmp/test-patch-hadoop/8656/patch-pylint-result.txt 
[sekikn@mobile hadoop]$ cat /private/tmp/test-patch-hadoop/8656/diff-patch-pylint.txt 

Removing '2>/dev/null' from pylint.sh reveals the root cause. Setting LC_ALL or LC_CTYPE
such like 'en_US.UTF-8' solves this problem.

                          pylint plugin: prepatch

Running pylint against modified python scripts.
No config file found, using default configuration
Traceback (most recent call last):
  File "/usr/local/bin/pylint", line 11, in <module>
  File "/Library/Python/2.7/site-packages/pylint/__init__.py", line 23, in run_pylint
  File "/Library/Python/2.7/site-packages/pylint/lint.py", line 1332, in __init__
  File "/Library/Python/2.7/site-packages/pylint/lint.py", line 747, in check
  File "/Library/Python/2.7/site-packages/pylint/lint.py", line 869, in _do_check
    self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)
  File "/Library/Python/2.7/site-packages/pylint/lint.py", line 944, in check_astroid_module
  File "/Library/Python/2.7/site-packages/pylint/checkers/format.py", line 743, in process_tokens
    self.check_indent_level(token, indents[-1]+1, line_num)
  File "/Library/Python/2.7/site-packages/pylint/checkers/format.py", line 963, in check_indent_level
    expected * unit_size))
  File "/Library/Python/2.7/site-packages/pylint/checkers/__init__.py", line 101, in add_message
    self.linter.add_message(msg_id, line, node, args, confidence)
  File "/Library/Python/2.7/site-packages/pylint/utils.py", line 410, in add_message
    (abspath, path, module, obj, line or 1, col_offset or 0), msg, confidence))
  File "/Library/Python/2.7/site-packages/pylint/reporters/text.py", line 61, in handle_message
  File "/Library/Python/2.7/site-packages/pylint/reporters/text.py", line 51, in write_message
  File "/Library/Python/2.7/site-packages/pylint/reporters/__init__.py", line 94, in writeln
    print(self.encode(string), file=self.out)
  File "/Library/Python/2.7/site-packages/pylint/reporters/__init__.py", line 84, in encode
    locale.getdefaultlocale()[1] or
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py",
line 511, in getdefaultlocale
    return _parse_localename(localename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py",
line 443, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

In such a case, pylint plugin should fail and vote -1.

This message was sent by Atlassian JIRA

View raw message