Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix quoting for allowed_local_3pids example config #4476

Merged
merged 1 commit into from
Jan 25, 2019

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jan 25, 2019

If you use double-quotes here, you have to escape your backslashes. It's much
easier with single-quotes.

(Note that the existing double-backslashes are already interpreted by python's
""" parsing.)

If you use double-quotes here, you have to escape your backslashes. It's much
easier with single-quotes.

(Note that the existing double-backslashes are already interpreted by python's
""" parsing.)
@richvdh richvdh requested a review from a team January 25, 2019 11:57
@@ -84,11 +84,11 @@ def default_config(self, generate_secrets=False, **kwargs):
#
# allowed_local_3pids:
# - medium: email
# pattern: ".*@matrix\\.org"
# pattern: '.*@matrix\\.org'
Copy link
Member

Choose a reason for hiding this comment

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

I'd have thought this would now have one too many escapes?

Copy link
Member Author

Choose a reason for hiding this comment

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

empirically, it now works. as per the pr description: -escapes are interpreted by python """ strings, so this ends up with single-backslashes in the yaml.

Copy link
Member

Choose a reason for hiding this comment

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

Right, but single slashes is what you want in the yaml if its going to be fed to regex?

Copy link
Member

Choose a reason for hiding this comment

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

OH sorry, I'm with you

@codecov-io
Copy link

Codecov Report

Merging #4476 into develop will increase coverage by 0.03%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #4476      +/-   ##
===========================================
+ Coverage    74.71%   74.75%   +0.03%     
===========================================
  Files          336      336              
  Lines        34056    34056              
  Branches      5538     5538              
===========================================
+ Hits         25445    25458      +13     
+ Misses        7037     7025      -12     
+ Partials      1574     1573       -1

@richvdh richvdh merged commit 4a3f138 into develop Jan 25, 2019
@richvdh richvdh deleted the rav/fix_allowed_3pids_example branch January 25, 2019 13:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants