Page MenuHomePhabricator

unicode rawstring prefix ur"" gives a syntax error in py3.6
Closed, ResolvedPublic


having an unicode rawstring prefix ur"" a syntax error is given in py3.6:

Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> x = ur'foo'
SyntaxError: invalid syntax


Related Gerrit Patches:

Event Timeline

Xqt created this task.May 2 2017, 8:49 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMay 2 2017, 8:49 AM
Xqt triaged this task as High priority.May 2 2017, 8:50 AM
Dalba added a subscriber: Dalba.May 2 2017, 8:58 AM

Actually, this is the case in all python 3 versions, not just 3.6. From the docs:

Given that Python 2.x’s raw unicode literals behave differently than Python 3.x’s the 'ur' syntax is not supported.

Do we have any ur prefixed string literal in master? I couldn't find any.

Change 351262 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] Import unicode_literals in

Change 351262 merged by jenkins-bot:
[pywikibot/core@master] Import unicode_literals in

Xqt closed this task as Resolved.May 2 2017, 2:53 PM