summaryrefslogtreecommitdiffstats
path: root/library/python/runtime_py3
diff options
context:
space:
mode:
Diffstat (limited to 'library/python/runtime_py3')
-rw-r--r--library/python/runtime_py3/importer.pxi9
1 files changed, 6 insertions, 3 deletions
diff --git a/library/python/runtime_py3/importer.pxi b/library/python/runtime_py3/importer.pxi
index d449bc9bddc..51bc3020a3f 100644
--- a/library/python/runtime_py3/importer.pxi
+++ b/library/python/runtime_py3/importer.pxi
@@ -91,10 +91,13 @@ def _init_venv():
raise RuntimeError(f'{cfg_source_root} key not found in {virtual_conf}')
-def file_bytes(path):
+def file_bytes(path, strip=False):
# 'open' is not avaiable yet.
with FileIO(path, 'r') as f:
- return f.read()
+ data = f.read()
+ if strip:
+ return data.strip()
+ return data
def _guess_source_root():
@@ -103,7 +106,7 @@ def _guess_source_root():
while tail:
guidence_file = _path_join(path, '.root.path')
if _path_isfile(guidence_file):
- return file_bytes(guidence_file)
+ return file_bytes(guidence_file, strip=True)
if _path_isfile(_path_join(path, '.arcadia.root')):
return _b(path)