Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587198 - sys-apps/portage: does not work with python3
Summary: sys-apps/portage: does not work with python3
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
Keywords: InVCS
Depends on:
Blocks: 604854
  Show dependency tree
Reported: 2016-06-26 23:18 UTC by Zac Medico
Modified: 2017-02-10 18:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2016-06-26 23:18:29 UTC
Currently, does not work with python3 because it tries to compare a byte string with and integer, which always returns files. The following change fixes the problem, and works with both python2 and python3:

diff --git a/bin/ b/bin/
index 73c7a5f..fbd18b9 100755
--- a/bin/
+++ b/bin/
@@ -89,7 +89,7 @@ def chpath_inplace(filename, is_text_file, old, new):
 		if not in_byte:
-		if in_byte == old[matched_byte_count]:
+		if in_byte == old[matched_byte_count:matched_byte_count+1]:
 			matched_byte_count += 1
 			if matched_byte_count == len_old:
 				modified = True
Comment 1 Zac Medico gentoo-dev 2016-06-26 23:42:07 UTC
This is fixed in the master branch:
Comment 2 Zac Medico gentoo-dev 2017-02-10 18:48:56 UTC
Fixed in portage-2.3.3.