Hello Andrew Wong,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/18384

to review the following change.


Change subject:  This commit will fix python 3.x failure in dep_extract.py
......................................................................

This commit will fix python 3.x failure in dep_extract.py

Description:
The following script fails:
kudu/build-support/mini-cluster/build_mini_cluster_binaries.sh

with the following error:
Stacktrace…
 ../build-support/mini-cluster/relocate_binaries_for_mini_cluster.py
../build/mini-cluster kudu kudu-tserver kudu-master
2022-03-23 17:57:58,557 INFO: Including target 'kudu' out of
'['kudu', 'kudu-tserver', 'kudu-master']' and its dependencies in archive...
2022-03-23 17:57:58,652 INFO: Attempting to relocate sasl2 modules...
Traceback (most recent call last):
  File "../build-support/mini-cluster/relocate_binaries_for_mini_cluster.py",
line 501, in <module>
    main()
  File "../build-support/mini-cluster/relocate_binaries_for_mini_cluster.py",
line 498, in main
 relocate_deps(target_src, target_dst, config)
  File "../build-support/mini-cluster/relocate_binaries_for_mini_cluster.py",
line 404, in relocate_deps
    return relocate_deps_linux(target_src, target_dst, config)
  File "../build-support/mini-cluster/relocate_binaries_for_mini_cluster.py",
line 340, in relocate_deps_linux
    libs = dep_extractor.extract_deps(target_src)
  File "../build-support/mini-cluster/../../build-support/dep_extract.py",
line 108, in extract_deps
    match = LDD_RE.match(line)
TypeError: cannot use a string pattern on a bytes-like object

This error is traced to line 108 in the file
kudu/build-support/dep_extract.py

      match = LDD_RE.match(line)

Proposed fix:

The “re” function expects ASCII character string. In python 2.x
the default treatment of charters follows ASCII standard. However,
in python 3.x the default encoding follows the UTF-8 standard.
This leads to a failure in python 3.X when the UTF-8 encoded
character objects are used as arguments to functions such as “re”.
The recommended fix is to decode the string before it is passed
as an argument to the ‘re’ call, and this works with both
 python 2.x as well as python 3.x.

Change-Id: Ied217653a90a6c4260e889cdfbafa683938acf1e
---
M build-support/dep_extract.py
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/84/18384/1
--
To view, visit http://gerrit.cloudera.org:8080/18384
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied217653a90a6c4260e889cdfbafa683938acf1e
Gerrit-Change-Number: 18384
Gerrit-PatchSet: 1
Gerrit-Owner: harinreddy <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>

Reply via email to