diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-09-06 11:34:57 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-09-06 11:34:57 -0700 |
commit | eab5a6ee1abff1fbf142cf1558ba940b6d4b270a (patch) | |
tree | 3ff8163bd01c976f106cb372869fb7fbfdd75059 /pym/portage/__init__.py | |
parent | 8ce21665b856e24815274240011a4aa81826113a (diff) | |
download | portage-eab5a6ee1abff1fbf142cf1558ba940b6d4b270a.tar.gz portage-eab5a6ee1abff1fbf142cf1558ba940b6d4b270a.tar.bz2 portage-eab5a6ee1abff1fbf142cf1558ba940b6d4b270a.zip |
merge: avoid abssymlink readlink call
This will avoid the "OSError: [Errno 2] No such file or directory" that
is triggered inside abssymlink if the merge encoding is not ascii or
utf_8, as shown in bug #382021.
Diffstat (limited to 'pym/portage/__init__.py')
-rw-r--r-- | pym/portage/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 901ea2c96..d73ea6d5e 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -391,9 +391,12 @@ def getcwd(): return "/" getcwd() -def abssymlink(symlink): +def abssymlink(symlink, target=None): "This reads symlinks, resolving the relative symlinks, and returning the absolute." - mylink=os.readlink(symlink) + if target is None: + mylink = target + else: + mylink = os.readlink(symlink) if mylink[0] != '/': mydir=os.path.dirname(symlink) mylink=mydir+"/"+mylink |