# HG changeset patch # User Sebastien Jodogne # Date 1621495765 -7200 # Node ID 43f13842bc3bbc86fdf9542ebe083515bc847eec # Parent f9eda86f9045d5d1e3fff0a7f4d119d07529aeb9 fix AutoClassify.py sample for compatibility with Python 3.x diff -r f9eda86f9045 -r 43f13842bc3b OrthancServer/Resources/Samples/Python/AutoClassify.py --- a/OrthancServer/Resources/Samples/Python/AutoClassify.py Fri May 14 11:46:57 2021 +0200 +++ b/OrthancServer/Resources/Samples/Python/AutoClassify.py Thu May 20 09:29:25 2021 +0200 @@ -46,7 +46,12 @@ def FixPath(p): - return p.encode('ascii', errors = 'replace').translate(None, r"'\/:*?\"<>|!=").strip() + s = p.encode('ascii', errors = 'replace').decode('ascii') + + for c in "'\/:*?\"<>|!=": + s = s.replace(c, '') + + return s.strip() def GetTag(resource, tag): if ('MainDicomTags' in resource and