[Bug 4143] New: C version of pathencode generates broken strings for os functions

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Wed Jan 1 23:47:42 CST 2014


http://bz.selenic.com/show_bug.cgi?id=4143

          Priority: normal
            Bug ID: 4143
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: C version of pathencode generates broken strings for
                    os functions
          Severity: bug
    Classification: Unclassified
                OS: All
          Reporter: yomgui1 at gmail.com
          Hardware: All
            Status: UNCONFIRMED
           Version: unspecified
         Component: Mercurial
           Product: Mercurial

pathencode in mercurial/pathencode.c may generate a string in such way
that PyString_GET_SIZE() != strlen().

This sort of string causes functions like ones in os module (chdir, ...), that
use "et" to parse arguments, to fail with error:

TypeError: must be encoded string without NULL bytes, not str

* Step to reproduce the issue:

python -c "import os; import mercurial.parsers as p; print
os.chdir(p.pathencode('test/'*30))"

=> the TypeError is raised

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list