1
0
mirror of https://github.com/phusion/baseimage-docker.git synced 2026-03-26 20:38:58 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Sebastian Serth
c17acec8ae Prevent 'invalid escape sequence' errors in newer Python versions (#637) 2024-04-20 02:45:27 +03:00

View File

@@ -22,7 +22,7 @@ LOG_LEVEL_WARN = 1
LOG_LEVEL_INFO = 2 LOG_LEVEL_INFO = 2
LOG_LEVEL_DEBUG = 3 LOG_LEVEL_DEBUG = 3
SHENV_NAME_WHITELIST_REGEX = re.compile('\W') SHENV_NAME_WHITELIST_REGEX = re.compile(r'\W')
log_level = None log_level = None
@@ -93,7 +93,7 @@ def import_envvars(clear_existing_environment=True, override_existing_environmen
# Text files often end with a trailing newline, which we # Text files often end with a trailing newline, which we
# don't want to include in the env variable value. See # don't want to include in the env variable value. See
# https://github.com/phusion/baseimage-docker/pull/49 # https://github.com/phusion/baseimage-docker/pull/49
value = re.sub('\n\Z', '', f.read()) value = re.sub('\n\\Z', '', f.read())
new_env[name] = value new_env[name] = value
if clear_existing_environment: if clear_existing_environment:
os.environ.clear() os.environ.clear()