Skip to content

Giving me an indentation error when there isnt one #249474

Closed as not planned
Closed as not planned
@OrangeBrownie92

Description

@OrangeBrownie92

Type: Bug

from stats import count_words, char_frequency
def get_book_text(path):
with open(path) as f:
file_contents = f.read()
return file_contents
def main():
path = "books/frankenstein.txt" # relative path
text = get_book_text(path)
count_words(text)
char_counts = char_frequency(text)
print(char_counts)
main()

It only shows this indentation when I copy and paste, the print(char_counts) will not work in any position

VS Code version: Code 1.100.2 (848b80a, 2025-05-14T21:47:40.416Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 5.15.167.4-microsoft-standard-WSL2

System Info
Item Value
CPUs AMD Ryzen 9 7945HX with Radeon Graphics (32 x 2495)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.21GB (14.31GB free)
Process Argv --crash-reporter-id 825d64c2-7c02-4b95-acf3-3ba764c69c58
Screen Reader no
VM 50%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.15.167.4-microsoft-standard-WSL2
CPUs AMD Ryzen 9 7945HX with Radeon Graphics (32 x 0)
Memory (System) 15.23GB (12.91GB free)
VM 0%
Extensions (6)
Extension Author (truncated) Version
remote-wsl ms- 0.99.0
copilot Git 1.322.0
copilot-chat Git 0.27.2
debugpy ms- 2025.8.0
python ms- 2025.6.1
vscode-pylance ms- 2025.5.1
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt551:31249599
vscod805:30301674
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
pythonrstrctxt:31112756
nativeloc2:31192216
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31309971
996jf627:31283433
pythonrdcb7:31303018
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
747dc170:31275177
pylancecolor:31309108
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
gendocf:31295004

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from posterpython

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions