Skip to content

Conversation

@jeffdav
Copy link
Contributor

@jeffdav jeffdav commented Mar 28, 2025

Building on Windows, I saw:

PS jeffdav\PythonKit> swift build
Building for debugging...
C:\Users\jeffdav\PythonKit\PythonKit\PythonLibrary.swift:287:33: warning: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [#DeprecatedDeclaration]
285 |
286 |         var value: String? {
287 |             guard let cString = getenv(key) else { return nil }
    |                                 `- warning: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [#DeprecatedDeclaration]

This switches the code to use _dupenv_s() instead, which is pretty straightforward.

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.

1 participant