Skip to content

Encode header row (LMS-197) - #1817

Merged
sarina merged 1 commit into
masterfrom
sarina/lms-197
Dec 5, 2013
Merged

Encode header row (LMS-197)#1817
sarina merged 1 commit into
masterfrom
sarina/lms-197

Conversation

@sarina

@sarina sarina commented Dec 2, 2013

Copy link
Copy Markdown
Contributor

@ormsbee

I was going to extend this to do some encoding on the new gradesstore store_rows writerows call, but based on our conversation (currently that data won't have unicode characters, and we should modularize/abstract that stuff better), I think this simple fix should just go in and we can tackle the other part separately.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this out? I don't think that creating the unicode object like this will work if s is a non-ASCII byte string, because it will try to decode it with ASCII encoding by default (causing a UnicodeDecode error). If s here is actually a unicode object to begin with, you can just do s.encode().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran a bunch of manual tests and both unicode(s).encode('utf-8') and s.encode('utf-8') work the same. I chose this was because of how the encoding was done at L139 below -- I'm not sure why we'd use a different pattern at L136 versus L138.

@sarina

sarina commented Dec 3, 2013

Copy link
Copy Markdown
Contributor Author

So I tested this all manually. I'm happy to wait on this PR and put in actual tests when the pending grades tests get merged.

Since we're planning to deprecate the legacy dashboard, Will has been fairly lenient on not forcing testing coverage.

@ormsbee

ormsbee commented Dec 5, 2013

Copy link
Copy Markdown
Contributor

👍

sarina added a commit that referenced this pull request Dec 5, 2013
Encode header row (LMS-197)
@sarina
sarina merged commit 2c2c238 into master Dec 5, 2013
@sarina
sarina deleted the sarina/lms-197 branch December 5, 2013 15:20
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants