Skip to content

Commit

Permalink
Prevent 'invalid escape sequence' errors in newer Python versions (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSerth authored Apr 19, 2024
1 parent 568883a commit c17acec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions image/bin/my_init
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LOG_LEVEL_WARN = 1
LOG_LEVEL_INFO = 2
LOG_LEVEL_DEBUG = 3

SHENV_NAME_WHITELIST_REGEX = re.compile('\W')
SHENV_NAME_WHITELIST_REGEX = re.compile(r'\W')

log_level = None

Expand Down Expand Up @@ -93,7 +93,7 @@ def import_envvars(clear_existing_environment=True, override_existing_environmen
# Text files often end with a trailing newline, which we
# don't want to include in the env variable value. See
# 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
if clear_existing_environment:
os.environ.clear()
Expand Down

0 comments on commit c17acec

Please sign in to comment.