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

updated string literal syntax for python3 compatibility #603

Merged
merged 1 commit into from Apr 26, 2019

Conversation

heartsucker
Copy link
Contributor

@heartsucker heartsucker commented Apr 18, 2019

fixes: ticket:3028

https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3028


This change is Reviewable

import os.path

from allmydata.util.assertutil import precondition, _assert

def path2magic(path):
return re.sub(ur'[/@]', lambda m: {u'/': u'@_', u'@': u'@@'}[m.group(0)], path)
return re.sub(six.u(r'[/@]'), lambda m: {u'/': u'@_', u'@': u'@@'}[m.group(0)], path)
Copy link
Member

Choose a reason for hiding this comment

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

u"..." is supported from Python 3.3 onward. Do we need to change these?

Copy link
Member

Choose a reason for hiding this comment

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

Ah. I see. u"..." works but ur"..." doesn't.

@meejah
Copy link
Contributor

meejah commented Apr 23, 2019

looks like legit failures on Windows at least?

@meejah meejah merged commit fee6eb3 into master Apr 26, 2019
@heartsucker heartsucker deleted the 3028-string-literals branch April 26, 2019 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants