-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
To support UNICODE xblock.location #6167
Conversation
Thanks for the pull request, @fmyzjs! I've created OSPR-269 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the Github pull request interface. As a reminder, our process documentation is here. |
@fmyzjs - to be clear I put this PR in the "waiting on author" category because it needs unit tests. |
@sarina I don't think need tests here. edX officially actually support unicode xblock locations. cms.envs.common.I open this pull because urllib.quote cannot decode unicode url string. |
@fmyzjs unit tests will validate this change and ensure we don't break unicode support in the future. This is important because as far as I know, we actively disallow unicode characters in locations on edx.org. So if there are no unit tests, is possible we will break in the future. |
def test_unicode_xblock_studio_url(self): | ||
|
||
#import unicode course | ||
modulestore = XMLModuleStore(DATA_DIR, course_dirs=['2014_Uni']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What makes this a Unicode course?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 from me. I'm asking someone from our sustaining team to take a look at this, as well. |
@fmyzjs, there are a lot of commits in here that don't seem related to the work you've done. Could you rebase this pull request, to make sure that it only contains the work that you did? |
@cpennington , do we support unicode in xblock locations? The last I knew, we didn't support unicode org/course/names, but I could be wrong |
I don't think we are yet ready to say that it's fully supported, but I'm happy to see progress towards that front. I believe that opaque_keys in general supports non-ascii characters, so it's just consumers of those keys that will need to adjust, generally. |
so once tests pass, you're cool with this PR? |
Yeah. I guess I don't know what will happen on the other end (whether Studio will get a unicode object from django, or a string object, and whether studio is correctly handling whichever one it does get), so it's probably worth verifying that. |
hi @fmyzjs , may you please rebase this PR? |
👍 once it's rebased |
The example at the top of the PR isn't actually correct usage. In particular:
You can't call |
That said:
|
👍 |
@fmyzjs please rebase, and ping us to let us know when you've done that. The PR must be rebased to resolve some conflicts. |
@fmyzjs - we need you to rebase this PR. If you don't respond within 5 days, we will have to close this PR. |
@fmyzjs - please fix quality build (https://build.testeng.edx.org/job/edx-platform-test-subset/5332/artifact/reports/cms/pep8.report/*view*/). Once you are done please comment on the pull request. We do not get notified when you make or update a commit, we only get notified when you tell us it is ready for review. |
When people use unicode course org name(e.g Chinese) ,urllib.quote cannot format unicode char like: ```shell >>> import urllib >>> loc = 'i4x://创联/7302478/chapter/4ab413b41ad9447db41668bed03f149f' >>> urllib.quote(loc) 'i4x%3A//%E5%88%9B%E8%81%94/7302478/chapter/4ab413b41ad9447db41668bed03f149f' >>> urllib.quote(unicode(loc)) Traceback (most recent call last): File "<console>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 6: ordinal not in range(128) >>> ``` so I open this pull
@fmyzjs please write a comment on a pull request when you've responded. We don't get notices when you push new commits! |
To support UNICODE xblock.location
Ticket: OSPR-269
When people use unicode course org name(e.g Chinese) ,urllib.quote cannot format unicode char like:
so I open this pull
@sarina @nedbat @singingwolfboy