Skip to content

debug console is not working and stdout has wrong file descriptor #1263

@gkyh0805

Description

@gkyh0805

Environment data

  • VS Code version: 1.21.1
  • Extension version (available under the Extensions sidebar): 2018.3.1
  • OS and version: Windows Server R2
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 2.7.14
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): XXX
  • Relevant/affected Python packages and their versions: XXX

Actual behavior

I have experimented a deep learning code with two computers, and all codes worked well without any bugs.

After I restart vscode two days ago, I have some troubles about print on one computer.

When I started the code, vscode show the terminal with the commands.
(I remember that the vscode show the debug console first.)

and the running is immediately stopped.

The error occurred in print function.

the error message is

IOError: [Errno 9] Bad file descriptor

and the return of the sys.stdout.fileno() and sys.stderr.fileno() is -2.

and the change of strout to nullwriter makes the code run.

This problem occured my second computer either, after the restart of the vscode..

How can I solve this problem?

Expected behavior

XXX

Steps to reproduce:

  1. XXX

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

XXX

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-debuggingbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions