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 vstinner
Recipients boya, giampaolo.rodola, loewis, pitrou, santoso.wijaya, serhiy.storchaka, skrah, terry.reedy, vstinner
Date 2013-03-25.21:31:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1364247079.04.0.0591112092967.issue9246@psf.upfronthosting.co.za>
In-reply-to
Content
test_posix.py of Python 3 contains the test, but the test is "disabled" (dead code):

def test_getcwd_long_pathnames(self):
    if hasattr(posix, 'getcwd'):
        dirname = 'getcwd-test-directory-0123456789abcdef-01234567890abcdef'
        curdir = os.getcwd()
        base_path = os.path.abspath(support.TESTFN) + '.getcwd'

        try:
            os.mkdir(base_path)
            os.chdir(base_path)
        except:
#           Just returning nothing instead of the SkipTest exception,
#           because the test results in Error in that case.
#           Is that ok?
#            raise unittest.SkipTest("cannot create directory for testing")
            return

            def _create_and_do_getcwd(dirname, current_path_length = 0):
                try:
                    os.mkdir(dirname)
                except:
                    raise unittest.SkipTest("mkdir cannot create directory sufficiently deep for getcwd test")

                os.chdir(dirname)
                try:
                    os.getcwd()
                    if current_path_length < 1027:
                        _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
                finally:
                    os.chdir('..')
                    os.rmdir(dirname)

            _create_and_do_getcwd(dirname)

        finally:
            os.chdir(curdir)
            support.rmtree(base_path)

See the issue #17516 for removal of dead code.
History
Date User Action Args
2013-03-25 21:31:19vstinnersetrecipients: + vstinner, loewis, terry.reedy, pitrou, giampaolo.rodola, skrah, boya, santoso.wijaya, serhiy.storchaka
2013-03-25 21:31:19vstinnersetmessageid: <1364247079.04.0.0591112092967.issue9246@psf.upfronthosting.co.za>
2013-03-25 21:31:19vstinnerlinkissue9246 messages
2013-03-25 21:31:18vstinnercreate