python / cpython

The Python programming language
https://www.python.org
Other
62.77k stars 30.08k forks source link

Make stdprinter use DebugOutputString when no stdout/stderr available #68049

Open zooba opened 9 years ago

zooba commented 9 years ago
BPO 23861
Nosy @tjguk, @zware, @zooba

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields: ```python assignee = None closed_at = None created_at = labels = ['OS-windows'] title = 'Make stdprinter use DebugOutputString when no stdout/stderr available' updated_at = user = 'https://github.com/zooba' ``` bugs.python.org fields: ```python activity = actor = 'BreamoreBoy' assignee = 'none' closed = False closed_date = None closer = None components = ['Windows'] creation = creator = 'steve.dower' dependencies = [] files = [] hgrepos = [] issue_num = 23861 keywords = [] message_count = 3.0 messages = ['240025', '240064', '240069'] nosy_count = 3.0 nosy_names = ['tim.golden', 'zach.ware', 'steve.dower'] pr_nums = [] priority = 'normal' resolution = None stage = None status = 'open' superseder = None type = None url = 'https://bugs.python.org/issue23861' versions = ['Python 3.5'] ```

zooba commented 9 years ago

Currently we initialize stdprinter while initializing and terminate if we can't access std streams.

We should always write to DebugOutputString on Windows (only does anything if a debugger is attached) and avoid terminating in this case.

tjguk commented 9 years ago

Are we talking about re-implementing StdPrinter in terms of OutputDebugString? (Either always, on Windows, or as a fallback?)

zooba commented 9 years ago

There's just a couple of places to add calls to OutputDebugString, plus we need to make creation always succeed on Windows. Not a huge change - it'll still write to the standard stream if it's there.