Exercise submission is very pedantic about indentation

Bug #575765 reported by David Coles on 2010-05-05
This bug affects 1 person
Affects Status Importance Assigned to Milestone
David Coles

Bug Description

In worksheets, any whitespace after code can trigger an IndentationError during submit that will not cause an issue when the code run in the console (making it hard to work out why it happens).

For example (using underscores to make spaces more clear):

def x()
____return 3
print x()

Related branches

David Coles (dcoles) wrote :

Calling str.strip may be enough to solve this issue.

Changed in ivle:
importance: Undecided → Low
status: New → Confirmed
status: Confirmed → Triaged
David Coles (dcoles) wrote :

This would be a good one for 1.0.2 this it causes a lot of hassle for students.

Changed in ivle:
assignee: nobody → David Coles (dcoles)
importance: Low → Medium
milestone: none → 1.0.2
Matt Giuca (mgiuca) wrote :

Don't call str.strip -- call rstrip. strip could remove spaces from the front, which could mean wrecking indentation (if the file begins with indents for some reason -- e.g., this should be valid:
____print 4
____print 7
but it would be stripped to:
print 4
____print 7
which is invalid

rstrip should be valid, as it would fix the above example.

David Coles (dcoles) on 2010-07-27
Changed in ivle:
status: Triaged → Fix Committed
William Grant (wgrant) on 2010-07-31
Changed in ivle:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers