diff --git a/picard/log.py b/picard/log.py index 3d9394e7f..4b3b66c16 100644 --- a/picard/log.py +++ b/picard/log.py @@ -170,7 +170,7 @@ def name_filter(record): path = path.resolve().relative_to(picard_module_path.parent) except ValueError: pass - record.name = '/'.join(p for p in path.parts if p != '__init__') + record.name = str(Path(*(p for p in path.parts if p != '__init__'))) return True diff --git a/test/test_log.py b/test/test_log.py index d52d8b2d7..94315b7cf 100644 --- a/test/test_log.py +++ b/test/test_log.py @@ -175,10 +175,10 @@ class NameFilterTestAbs(PicardTestCase): name_filter(record) -@patch('picard.log.picard_module_path', PurePosixPath('/path1/path2/')) +@patch('picard.log.picard_module_path', PurePosixPath('/path1/path2/')) # incorrect, but testing anyway class NameFilterTestEndingSlash(PicardTestCase): def test_1(self): record = FakeRecord(name=None, pathname='/path3/module/file.py') self.assertTrue(name_filter(record)) - self.assertEqual(record.name, '//path3/module/file') # FIXME: incorrect picard_module_path, but this shouldn't happen + self.assertEqual(record.name, '/path3/module/file')