Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

sys.stdin not None and missing encoding attribute when running with pythonw.exe #1023

Closed
huguesv opened this issue Nov 16, 2018 · 0 comments
Closed
Assignees
Milestone

Comments

@huguesv
Copy link
Contributor

huguesv commented Nov 16, 2018

Environment data

  • PTVSD version: 4.2
  • OS and version: windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): CPython 3.7 using pythonw.exe
  • Using VS Code or Visual Studio: VS

Actual behavior

None has no attribute encoding exception

Expected behavior

Either sys.stdin.encoding works, or sys.stdin is None (it is None when running without debugging)

Steps to reproduce:

  1. Debug this code using pythonw.exe (no console)
import sys

with open('issue4866.txt', 'wt') as f:
    f.write('hello\n')
    f.write(str(type(sys.stdin)) + '\n')
    if sys.stdin is not None:
        f.write(str(sys.stdin.encoding) + '\n')
    f.write('bye\n')

From microsoft/PTVS#4866

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants