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 nadeem.vawda
Recipients alexis, eric.araujo, higery, jlove, nadeem.vawda, paul.moore, pitrou, tarek
Date 2011-10-19.17:21:46
SpamBayes Score 6.15336e-09
Marked as misclassified No
Message-id <1319044907.41.0.954998883671.issue13193@psf.upfronthosting.co.za>
In-reply-to
Content
> The test creates a temporary directory which is inserted at the head of sys.path.
> packaging.database.get_distribution should thus find Spamlib-0.1.dist-info.
> Can someone with a Windows install help me with this?  Printing sys.path and
> os.listdir(sys.path[0]) would be a good start.

    test_resources (packaging.tests.test_command_install_data.InstallDataTestCase) ...
    sys.path: ['c:\\users\\nadeem\\appdata\\local\\temp\\tmpi7pf1f\\tmp4gdwnp',
               '',
               'C:\\Users\\Nadeem\\Code\\python3\\python\\PCbuild\\python33_d.zip',
               'C:\\Users\\Nadeem\\Code\\python3\\python\\DLLs',
               'C:\\Users\\Nadeem\\Code\\python3\\python\\lib',
               'C:\\Users\\Nadeem\\Code\\python3\\python\\PCbuild',
               'C:\\Users\\Nadeem\\AppData\\Roaming\\Python\\Python33\\site-packages',
               'C:\\Users\\Nadeem\\Code\\python3\\python',
               'C:\\Users\\Nadeem\\Code\\python3\\python\\lib\\site-packages']
    os.listdir(sys.path[0]): ['Spamlib-0.1.dist-info']
    ERROR

I noticed that the test succeeds if you run only the InstallDataTestCase (with
"... -v -m InstallDataTestCase test_packaging"), but the sys.path info for this
case is the same as before (modulo the name of the temp directory):

    test_resources (packaging.tests.test_command_install_data.InstallDataTestCase) ...
    sys.path: ['c:\\users\\nadeem\\appdata\\local\\temp\\tmpddi17y\\tmp1mnv9z',
               '',
               'C:\\Users\\Nadeem\\Code\\python3\\python\\PCbuild\\python33_d.zip',
               'C:\\Users\\Nadeem\\Code\\python3\\python\\DLLs',
               'C:\\Users\\Nadeem\\Code\\python3\\python\\lib',
               'C:\\Users\\Nadeem\\Code\\python3\\python\\PCbuild',
               'C:\\Users\\Nadeem\\AppData\\Roaming\\Python\\Python33\\site-packages',
               'C:\\Users\\Nadeem\\Code\\python3\\python',
               'C:\\Users\\Nadeem\\Code\\python3\\python\\lib\\site-packages']
    os.listdir(sys.path[0]): ['Spamlib-0.1.dist-info']
    ok

Additionally, I've been getting a similar failure on my Ubuntu machine:

    ======================================================================
    ERROR: test_resources (packaging.tests.test_command_install_data.InstallDataTestCase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/nadeem/code/src/cpython/def/Lib/packaging/tests/test_command_install_data.py", line 129, in test_resources
        with packaging.database.get_file('Spamlib', 'spamd') as fp:
      File "/home/nadeem/code/src/cpython/def/Lib/packaging/database.py", line 649, in get_file
        return open(get_file_path(distribution_name, relative_path),
      File "/home/nadeem/code/src/cpython/def/Lib/packaging/database.py", line 644, in get_file_path
        raise LookupError('no distribution named %r found' % distribution_name)
    LookupError: no distribution named 'Spamlib' found

Output from Ubuntu machine:

    test_resources (packaging.tests.test_command_install_data.InstallDataTestCase) ...
    sys.path: ['/tmp/tmpubkdye/tmpdmdybx',
               '',
               '/usr/local/lib/python33.zip',
               '/home/nadeem/code/src/cpython/def/Lib',
               '/home/nadeem/code/src/cpython/def/Lib/plat-linux',
               '/home/nadeem/code/src/cpython/def/build/lib.linux-x86_64-3.3',
               '/home/nadeem/.local/lib/python3.3/site-packages',
               '/usr/local/lib/python3.3/site-packages']
    os.listdir(sys.path[0]): ['Spamlib-0.1.dist-info']
    ERROR
History
Date User Action Args
2011-10-19 17:21:47nadeem.vawdasetrecipients: + nadeem.vawda, paul.moore, pitrou, tarek, eric.araujo, alexis, jlove, higery
2011-10-19 17:21:47nadeem.vawdasetmessageid: <1319044907.41.0.954998883671.issue13193@psf.upfronthosting.co.za>
2011-10-19 17:21:46nadeem.vawdalinkissue13193 messages
2011-10-19 17:21:46nadeem.vawdacreate