Skip to content

Fix invalid escape sequences in the OpenSSL props literals (cpython-windows/build.py) - #1242

Merged
jjhelmus merged 1 commit into
astral-sh:mainfrom
vadikmironov:fix-openssl-props-escape-sequences
Aug 31, 2026
Merged

jjhelmus merged 1 commit into
astral-sh:mainfrom
vadikmironov:fix-openssl-props-escape-sequences

Conversation

@vadikmironov

Copy link
Copy Markdown
Contributor

OPENSSL_PROPS_REMOVE_RULES and OPENSSL_PROPS_REMOVE_RULES_LEGACY are non-raw bytes literals containing \libcrypto and \libssl and Python reads \l as an escape sequence.

Running any build triggers it:

cpython-windows/build.py:340: SyntaxWarning: invalid escape sequence '\l'
  <_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
cpython-windows/build.py:355: SyntaxWarning: invalid escape sequence '\l'

The build still works alright - an unrecognised escape is left as the literal characters. At this stage it is more of a cleanup as nothing broken. It reduces the number of warnings that would otherwise be picked by build monitor. If invalid escapes are ever promoted to an error as suggested in 3.12 changelog, the build will fail.

The fix is straightforw - mark both literals raw fixes it.

OPENSSL_PROPS_REMOVE_RULES and OPENSSL_PROPS_REMOVE_RULES_LEGACY are
non-raw bytes literals containing \libcrypto and \libssl, so Python
reads \l as an escape sequence and warns on every build.

Marking both raw leaves their contents unchanged.
@jjhelmus

Copy link
Copy Markdown
Contributor

LGTM, thanks for the fix.

@jjhelmus
jjhelmus merged commit 0010f13 into astral-sh:main Aug 31, 2026
21 checks passed
@vadikmironov

Copy link
Copy Markdown
Contributor Author

Thanks a lot for a quick merge!

@vadikmironov
vadikmironov deleted the fix-openssl-props-escape-sequences branch August 31, 2026 15:55
vadikmironov added a commit to vadikmironov/omniglot-bazel-starter that referenced this pull request Aug 31, 2026
The raw bytes literals landed in astral-sh/python-build-standalone#1242,
so applying the patch on top of current main conflicts and the whole
series fails before any build starts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants