Skip to content

Commit f6f1349

Browse files
committed
Merge branch 'fix-path-encoding' into feature-windows-ci-tests
2 parents 37c67db + 4e8d558 commit f6f1349

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

newrelic/common/encoding_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import types
2929
import zlib
3030
from collections import OrderedDict
31+
from pathlib import Path
3132

3233
HEXDIGLC_RE = re.compile("^[0-9a-f]+$")
3334
DELIMITER_FORMAT_RE = re.compile("[ \t]*,[ \t]*")
@@ -66,6 +67,8 @@ def json_encode(obj, **kwargs):
6667
def _encode(o):
6768
if isinstance(o, bytes):
6869
return o.decode("latin-1")
70+
elif isinstance(o, Path):
71+
return str(o)
6972
elif isinstance(o, types.GeneratorType):
7073
return list(o)
7174
elif hasattr(o, "__iter__"):

0 commit comments

Comments
 (0)