[BUG] py::print does not work when linking as a Windows application
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
Hey folks, I'm not sure if this is intended behavior, but py::print does not work for me when building a Windows application in cmake, I get the error AttributeError: 'NoneType' object has no attribute 'write. However, things work fine when keeping everything identical and building as a console application.
I don't know why pybind11 prints to console happily but doesn't like the std::out in an MSVC windows application, but I thought I'd bring it up~
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported behavior with py::print in the CMake-built Windows application and compare it with the console application case. Trace how py::print handles std::out under MSVC, then verify that output works in the Windows application without regressing console builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, python
- Domain
- backend-api-design, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100