Skip to content

Commit c17acec

Browse files
authored
Prevent 'invalid escape sequence' errors in newer Python versions (#637)
1 parent 568883a commit c17acec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

image/bin/my_init

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LOG_LEVEL_WARN = 1
2222
LOG_LEVEL_INFO = 2
2323
LOG_LEVEL_DEBUG = 3
2424

25-
SHENV_NAME_WHITELIST_REGEX = re.compile('\W')
25+
SHENV_NAME_WHITELIST_REGEX = re.compile(r'\W')
2626

2727
log_level = None
2828

@@ -93,7 +93,7 @@ def import_envvars(clear_existing_environment=True, override_existing_environmen
9393
# Text files often end with a trailing newline, which we
9494
# don't want to include in the env variable value. See
9595
# https://github.com/phusion/baseimage-docker/pull/49
96-
value = re.sub('\n\Z', '', f.read())
96+
value = re.sub('\n\\Z', '', f.read())
9797
new_env[name] = value
9898
if clear_existing_environment:
9999
os.environ.clear()

0 commit comments

Comments
 (0)