diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1230,9 +1230,11 @@ return hardlink, num -_winreservednames = b'''con prn aux nul - com1 com2 com3 com4 com5 com6 com7 com8 com9 - lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'''.split() +_winreservednames = { + 'con', 'prn', 'aux', 'nul', + 'com1', 'com2', 'com3', 'com4', 'com5', 'com6', 'com7', 'com8', 'com9', + 'lpt1', 'lpt2', 'lpt3', 'lpt4', 'lpt5', 'lpt6', 'lpt7', 'lpt8', 'lpt9', +} _winreservedchars = ':*?"<>|' def checkwinfilename(path): r'''Check that the base-relative path is a valid filename on Windows.