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

weird exception thrown both in the web version and the local version #15

Open
rlisahuang opened this issue Feb 17, 2023 · 4 comments
Open
Assignees

Comments

@rlisahuang
Copy link

rlisahuang commented Feb 17, 2023

If we paste the code below into the editor, either the web version or the local version:

import matplotlib.pyplot as plt
import pandas as pd
import io

csv = '''
ID,group,time,success
P1,control,18.6,1
P2,control,15.42,1
P3,control,25.55,0
P4,control,12.56,0
P5,control,8.67,1
P6,experiment,7.31,0
P7,experiment,9.66,0
P8,experiment,13.64,1
P9,experiment,14.92,1
P10,experiment,18.47,1
'''

# weird error for this line if there is nothing else after this line
b = pd.read_csv(io.StringIO(csv))

you will see some weird exception thrown for the last line. The exception differs between the web and the local versions.

However, if you add one new line after the last line,

b = pd.read_csv(io.StringIO(csv))
# insert new line here

the error disappears.

@rlisahuang rlisahuang added bug Something isn't working PB labels Feb 17, 2023
@rlisahuang
Copy link
Author

Web version:
Screenshot 2023-02-17 at 1 09 50 PM

Local version:
Screenshot 2023-02-17 at 1 10 38 PM

It is not a Python error, because running in REPL / by pressing the Run button shows no error.

@rlisahuang
Copy link
Author

May be related to #18 . But this one is different in a sense that you could provide extra lines at the end of the starter code file to avoid the bug.

@rlisahuang
Copy link
Author

Update: this error does not happen when no modules are used in the last line, or when the module is numpy

@rlisahuang rlisahuang self-assigned this Feb 22, 2023
@rlisahuang
Copy link
Author

Easy fix for now: force every starter code file to have at least one extra line at the end

@rlisahuang rlisahuang reopened this Mar 2, 2023
@rlisahuang rlisahuang removed the urgent label Mar 2, 2023
@rlisahuang rlisahuang added tmpfix and removed bug Something isn't working labels Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant