Patchwork [1,of,5] py3: convert filename to bytes in test-hardlinks.t

login
register
mail settings
Submitter Matt Harbison
Date Dec. 10, 2018, 3:44 a.m.
Message ID <fa86071307be46ea610d.1544413473@Envy>
Download mbox | patch
Permalink /patch/37042/
State Accepted
Headers show

Comments

Matt Harbison - Dec. 10, 2018, 3:44 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1544380416 18000
#      Sun Dec 09 13:33:36 2018 -0500
# Node ID fa86071307be46ea610dd7620557a10828a1ebc6
# Parent  443eb4bc41af00cafefcf235f15bad24b1ea56a1
py3: convert filename to bytes in test-hardlinks.t

Windows was complaining about passing str to CreateFileA() in win32.py.

Patch

diff --git a/tests/test-hardlinks.t b/tests/test-hardlinks.t
--- a/tests/test-hardlinks.t
+++ b/tests/test-hardlinks.t
@@ -3,10 +3,10 @@ 
   $ cat > nlinks.py <<EOF
   > from __future__ import print_function
   > import sys
-  > from mercurial import util
+  > from mercurial import pycompat, util
   > for f in sorted(sys.stdin.readlines()):
   >     f = f[:-1]
-  >     print(util.nlinks(f), f)
+  >     print(util.nlinks(pycompat.fsencode(f)), f)
   > EOF
 
   $ nlinksdir()