You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2023/03/22 14:49:00 UTC
[jira] [Commented] (IMPALA-12013) Included pkg_resources fails in Python 2 when file in HOME directory contains special character
[ https://issues.apache.org/jira/browse/IMPALA-12013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17703694#comment-17703694 ]
ASF subversion and git services commented on IMPALA-12013:
----------------------------------------------------------
Commit 8f204c82b74c7eccfe7d921a916ec36c0785cfe7 in impala's branch refs/heads/master from Michael Smith
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=8f204c82b ]
IMPALA-12013: Remove future from pkg_resources.py
Removes import future from pkg_resources.py as this file is fairly old
and only used with Python 2. Adding unicode_literals in IMPALA-3343 /
IMPALA-9489 broke reading files in the HOME directory during package
load via pkg_resources when any of those files contain special
characters (above ASCII 127).
Testing:
- added a file with an em dash to the HOME directory, then run
impala-shell with Python 2.7 and without setuptools installed. This
reproduced the issue before adding this patch, and is fixed by this
patch.
Change-Id: Ia9e05904adf9ffe303cac281538df1bbcff5e48b
Reviewed-on: http://gerrit.cloudera.org:8080/19641
Reviewed-by: Joe McDonnell <jo...@cloudera.com>
Tested-by: Michael Smith <mi...@cloudera.com>
> Included pkg_resources fails in Python 2 when file in HOME directory contains special character
> -----------------------------------------------------------------------------------------------
>
> Key: IMPALA-12013
> URL: https://issues.apache.org/jira/browse/IMPALA-12013
> Project: IMPALA
> Issue Type: Bug
> Components: Catalog
> Affects Versions: Impala 4.2.0
> Reporter: Michael Smith
> Assignee: Michael Smith
> Priority: Minor
>
> The pkg_resources.py we include when creating a Python 2 tarball of impala-shell fails with
> {code:java}
> Traceback (most recent call last):
> File "/Impala/shell/build/impala-shell-4.3.0-SNAPSHOT/impala_shell.py", line 42, in <module>
> from impala_client import ImpalaHS2Client, StrictHS2Client, \
> File "/Impala/shell/build/impala-shell-4.3.0-SNAPSHOT/lib/impala_client.py", line 23, in <module>
> from bitarray import bitarray
> File "/Impala/shell/build/impala-shell-4.3.0-SNAPSHOT/ext-py2/bitarray-2.3.0-py2.7-linux-x86_64.egg/bitarray/__init__.py", line 14, in <module>
>
> File "/Impala/shell/build/impala-shell-4.3.0-SNAPSHOT/ext-py2/bitarray-2.3.0-py2.7-linux-x86_64.egg/bitarray/_bitarray.py", line 7, in <module>
> File "/Impala/shell/build/impala-shell-4.3.0-SNAPSHOT/ext-py2/bitarray-2.3.0-py2.7-linux-x86_64.egg/bitarray/_bitarray.py", line 3, in __bootstrap__
> File "/Impala/shell/build/impala-shell-4.3.0-SNAPSHOT/legacy/pkg_resources.py", line 2669, in <module>
> working_set = WorkingSet()
> File "/Impala/shell/build/impala-shell-4.3.0-SNAPSHOT/legacy/pkg_resources.py", line 410, in __init__
> self.add_entry(entry)
> File "/Impala/shell/build/impala-shell-4.3.0-SNAPSHOT/legacy/pkg_resources.py", line 425, in add_entry
> for dist in find_distributions(entry, True):
> File "/Impala/shell/build/impala-shell-4.3.0-SNAPSHOT/legacy/pkg_resources.py", line 1709, in find_on_path
> if lower.endswith('.egg-info'):
> {code}
> when the user's HOME directory contains a file with a special character in the name (such as an em dash). This was introduced when adding
> {code:java}
> from __future__ import print_function, unicode_literals
> {code}
> to pkg_resources.py; that file doesn't work with Python 3, so adding this was unnecessary.
>
> Workaround is to install python-setuptools or use Python 3.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org