# HG changeset patch # User Ian Moody # Date 1552067879 0 # Node ID 2bad8f92cebfca394a04337d4e8d8f298b30803e # Parent c340a8ac7ef38f88b48796c6add58b3a541cb4e8 py3: use fsencode for vcr recording paths and strings for custom_patches args This fixes phabricator.py's vcrcommand under py3 Differential Revision: https://phab.mercurial-scm.org/D6102 diff -r c340a8ac7ef3 -r 2bad8f92cebf hgext/phabricator.py --- a/hgext/phabricator.py Sat Mar 02 18:48:23 2019 +0000 +++ b/hgext/phabricator.py Fri Mar 08 17:57:59 2019 +0000 @@ -128,7 +128,7 @@ 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(): @@ -137,8 +137,9 @@ 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):