id(_os.system) : _os.system,
}
-os = _unicode_module_wrapper(_os, overrides=_os_overrides)
+os = _unicode_module_wrapper(_os, overrides=_os_overrides,
+ encoding=_fs_encoding)
_os_merge = _unicode_module_wrapper(_os,
encoding=_merge_encoding, overrides=_os_overrides)
import shutil as _shutil
-shutil = _unicode_module_wrapper(_shutil)
+shutil = _unicode_module_wrapper(_shutil, encoding=_fs_encoding)
# Imports below this point rely on the above unicode wrapper definitions.
_selinux = None
_selinux_merge = _unicode_module_wrapper(_selinux, encoding=_merge_encoding)
try:
import portage._selinux
- selinux = _unicode_module_wrapper(_selinux)
+ selinux = _unicode_module_wrapper(_selinux, encoding=_fs_encoding)
except OSError, e:
sys.stderr.write("!!! SELinux not loaded: %s\n" % str(e))
del e
"mv '%s' '%s'" % (src, dest))
def movefile(src, dest, newmtime=None, sstat=None, mysettings=None,
- hardlink_candidates=None, encoding='utf_8'):
+ hardlink_candidates=None, encoding=_fs_encoding):
"""moves a file from src to dest, preserving all permissions and attributes; mtime will
be preserved even when moving across filesystems. Returns true on success and false on
failure. Move is atomic."""
# This is a special version of the os module, wrapped for unicode support.
from portage import os
+from portage import _fs_encoding
from portage import _merge_encoding
from portage import _os_merge
from portage import _selinux_merge
# different value of sys.getfilesystemencoding(),
# so fall back to utf_8 if appropriate.
try:
- _unicode_encode(obj, encoding='utf_8', errors='strict')
+ _unicode_encode(obj, encoding=_fs_encoding, errors='strict')
except UnicodeEncodeError:
pass
else: