This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ocean-city
Recipients JDay, amaury.forgeotdarc, ocean-city
Date 2008-10-09.21:33:19
SpamBayes Score 2.5291547e-10
Marked as misclassified No
Message-id <1223588019.43.0.794284424333.issue4071@psf.upfronthosting.co.za>
In-reply-to
Content
Or, if PyArg_ParseTuple overflowed or GetFullPathNameA failed, (not
check GetLastError() because it's vogus) try GetFullPathNameW like
attached file "quick_hack_for_getfullpathname.patch".

This inverses flow

    if (unicode_file_names()) {
        /* unicode */
    }
    /* ascii */

# Maybe it would be nice if convert_to_unicode() functionality is built
in PyArg_ParseTuple. (inverse of "et")

Be care, this is quick hack, so maybe buggy. I confirmed test_os and
test_ntpath passed though.

/////////////////////////////////////////////////////

import unittest
import ntpath
import os

class TestCase(unittest.TestCase):
    def test_getfullpathname(self):
        for c in ('x', u'x'):
            for count in xrange(1, 1000):
                name = c * count
                path = ntpath._getfullpathname(name)
                self.assertEqual(os.path.basename(path), name)

if __name__ == '__main__':
    unittest.main()
History
Date User Action Args
2008-10-09 21:33:39ocean-citysetrecipients: + ocean-city, amaury.forgeotdarc, JDay
2008-10-09 21:33:39ocean-citysetmessageid: <1223588019.43.0.794284424333.issue4071@psf.upfronthosting.co.za>
2008-10-09 21:33:24ocean-citylinkissue4071 messages
2008-10-09 21:33:22ocean-citycreate