Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file object is not writing to disk using the write #153

Closed
DonJayamanne opened this issue Nov 14, 2017 · 2 comments
Closed

file object is not writing to disk using the write #153

DonJayamanne opened this issue Nov 14, 2017 · 2 comments
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@DonJayamanne
Copy link

DonJayamanne commented Nov 14, 2017

From @larsoleruben on July 27, 2017 11:0

Environment data

VS Code version: 1.14.2
Python Extension version: 0.6.9 (22 July 2017)
Python Version: 3.6
OS and version: Windows 8.1

Actual behavior

This will not write to the file during debugging

myFile = open('c:/temp/test.txt', 'w')
a = myFile.write('ddsdsdsds\n')
print(a)
myFile.close

This correctly writes to the file during debugging

with open('c:/temp/test.txt', 'w') as outfile:
    a=outfile.write("sdsdsdsdsd\n")
    print(a)

Expected behavior

The above code should both write to the file. also during debugging

Steps to reproduce:

Excute above

If the script is executed from the console, both methods works
Also the code works nomally in Visual Studio, and also Visual Studio Code for Mac.
Only win 8.1 seems to have a problem.

Logs

Output from Python output panel
Nothing

Output from ```Console window``` (Help->Developer Tools menu)
Nothing

Copied from original issue: DonJayamanne/pythonVSCode#1125

@brettcannon brettcannon added awaiting 1-verification bug Issue identified by VS Code Team member as probable bug labels Nov 14, 2017
@brettcannon
Copy link
Member

Closing as invalid because the issue is you forgot to call close() in your code sample.

@brettcannon
Copy link
Member

BTW if you run with warnings turned on you will see a warning about the unclosed file.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants