Skip to content

BUG: cfuncs.py: fix crash when sys.stderr is not available#27013

Merged
mattip merged 1 commit intonumpy:mainfrom
nicoddemus:issue-26862-freeze-stderr
Jul 23, 2024
Merged

BUG: cfuncs.py: fix crash when sys.stderr is not available#27013
mattip merged 1 commit intonumpy:mainfrom
nicoddemus:issue-26862-freeze-stderr

Conversation

@nicoddemus
Copy link
Contributor

@nicoddemus nicoddemus commented Jul 22, 2024

In some environments (for example frozen executables created with PyInstaller for GUI applications) sys.stderr and sys.stdout might be None.

The import-time access to sys.stderr.write in some f2py modules was causing such applications to crash during startup.

Fix #26862

In some environments (for example frozen executables created with PyInstaller for GUI applications) `sys.stderr` and `sys.stdout` might be `None`.

The import-time access to `sys.stderr.write` in some `f2py` modules was causing such applications to crash during startup.

Fix numpy#26862
@nicoddemus nicoddemus force-pushed the issue-26862-freeze-stderr branch from f612ca7 to 3887aaf Compare July 22, 2024 22:28
@mattip mattip merged commit 0d57708 into numpy:main Jul 23, 2024
@mattip mattip added the 09 - Backport-Candidate PRs tagged should be backported label Jul 23, 2024
@mattip
Copy link
Member

mattip commented Jul 23, 2024

Thanks @nicoddemus. We should backport this.

@nicoddemus nicoddemus deleted the issue-26862-freeze-stderr branch July 23, 2024 10:42
@charris charris changed the title cfuncs.py: fix crash when sys.stderr is not available BUG: cfuncs.py: fix crash when sys.stderr is not available Jul 24, 2024
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2.0.0 sys.stderr attribute error packaged with cx_freeze

3 participants