Patchwork D6102: py3: use fsencode for the vcr recording paths and strings for the custom_patches arguments

login
register
mail settings
Submitter phabricator
Date March 10, 2019, 1:50 a.m.
Message ID <28c1afa76286232ecf6d527f6792d5ae@localhost.localdomain>
Download mbox | patch
Permalink /patch/39170/
State Not Applicable
Headers show

Comments

phabricator - March 10, 2019, 1:50 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2bad8f92cebf: py3: use fsencode for vcr recording paths and strings for custom_patches args (authored by Kwan, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D6102?vs=14415&id=14429#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6102?vs=14415&id=14429

REVISION DETAIL
  https://phab.mercurial-scm.org/D6102

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS




To: Kwan, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -128,17 +128,18 @@ 
     fullflags = flags + _VCR_FLAGS
     def decorate(fn):
         def inner(*args, **kwargs):
-            cassette = kwargs.pop(r'test_vcr', None)
+            cassette = pycompat.fsdecode(kwargs.pop(r'test_vcr', None))
             if cassette:
                 import hgdemandimport
                 with hgdemandimport.deactivated():
                     import vcr as vcrmod
                     import vcr.stubs as stubs
                     vcr = vcrmod.VCR(
                         serializer=r'json',
                         custom_patches=[
-                            (urlmod, 'httpconnection', stubs.VCRHTTPConnection),
-                            (urlmod, 'httpsconnection',
+                            (urlmod, r'httpconnection',
+                             stubs.VCRHTTPConnection),
+                            (urlmod, r'httpsconnection',
                              stubs.VCRHTTPSConnection),
                         ])
                     with vcr.use_cassette(cassette):