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.

classification
Title: distutils2 test failures
Type: Stage: resolved
Components: Distutils2 Versions: 3rd party
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: alexis, eric.araujo, mu_mind, python-dev, tarek
Priority: normal Keywords:

Created on 2011-10-13 16:37 by eric.araujo, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (12)
msg145470 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-13 16:37
I get three errors/failures on linux3:

ERROR: test_simple_run (distutils2.tests.test_command_install_data.InstallDataTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "distutils2/tests/test_command_install_data.py", line 76, in test_simple_run
    cmd.run()
  File "distutils2/command/install_data.py", line 50, in run
    out = self.copy_file(_file[0], dir_dest)[0]
  File "distutils2/command/cmd.py", line 378, in copy_file
    copyfile(infile, outfile)
  File "distutils2/_backport/shutil.py", line 83, in copyfile
    raise Error("`%s` and `%s` are the same file" % (src, dst))
Error: `/tmp/user/1013/tmpEl9F8m/tmp91wrrV/foo/inst/three` and `/tmp/user/1013/tmpEl9F8m/tmp91wrrV/foo/inst/three` are the same file

======================================================================
FAIL: test_config (distutils2.tests.test_config.ConfigTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "distutils2/tests/test_config.py", line 291, in test_config
    self.assertEqual(dist.package_data, {'cheese': 'data/templates/*'})
AssertionError: {u'cheese': [u'data/templates/*']} != {'cheese': 'data/templates/*'}
- {u'cheese': [u'data/templates/*']}
?  -          --                  -

+ {'cheese': 'data/templates/*'}

======================================================================
FAIL: test_parse_extensions_in_config (distutils2.tests.test_config.ConfigTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "distutils2/tests/test_config.py", line 341, in test_parse_extensions_in_config
    self.assertEqual(ext.sources, ['c_src/speed_coconuts.c'])
AssertionError: Lists differ: ['c\x00\x00\x00_\x00\x00\x00s\... != ['c_src/speed_coconuts.c']

First differing element 0:
c_src/speed_coconuts.c
c_src/speed_coconuts.c

- ['c\x00\x00\x00_\x00\x00\x00s\x00\x00\x00r\x00\x00\x00c\x00\x00\x00/\x00\x00\x00s\x00\x00\x00p\x00\x00\x00e\x00\x00\x00e\x00\x00\x00d\x00\x00\x00_\x00\x00\x00c\x00\x00\x00o\x00\x00\x00c\x00\x00\x00o\x00\x00\x00n\x00\x00\x00u\x00\x00\x00t\x00\x00\x00s\x00\x00\x00.\x00\x00\x00c\x00\x00\x00']
+ ['c_src/speed_coconuts.c']

The last one looks like a codecs issue.
msg145771 - (view) Author: David Barnett (mu_mind) Date: 2011-10-18 04:57
I looked into the ConfigTestCase.test_config failure, and it looks like it just needs the righthand edited to match the left. "package_data" lines are supposed to allow comma-separated lists of paths on the righthand.
msg145772 - (view) Author: David Barnett (mu_mind) Date: 2011-10-18 05:35
The ConfigTestCase.test_parse_extensions_in_config failure is a manifestation of http://bugs.python.org/issue6988.
msg145832 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-18 16:16
New changeset 5d858149df06 by Éric Araujo in branch 'default':
Synchronize config with packaging (fixes #13170)
http://hg.python.org/distutils2/rev/5d858149df06
msg145939 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-19 19:08
New changeset cda119958db3 by Éric Araujo in branch 'default':
Kludge around shlex not supporting unicode in 2.x (#13170).
http://hg.python.org/distutils2/rev/cda119958db3
msg146534 - (view) Author: David Barnett (mu_mind) Date: 2011-10-28 04:56
The remaining test (test_command_install_data.InstallDataTestCase.test_simple_run) was broken in r1152. What's happening is that the type of exception being raised was changed and it's getting through the try/except block in install_data.run().

Instead of calling shutil.copyfile, the code in 1152 is calling distutils2._backport.shutil.copyfile, which instead of raising a shutil.Error instance raises a distutils2._backport.shutil.Error instance.

Ideally, I think distutils2/_backport/shutil.py should do "from shutil import Error" instead of defining its own Error class, but I'm not sure if that's kosher for the way backports are supposed to work, and importing shutil from the stdlib is broken in that file besides.
msg146569 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-28 15:18
> The remaining test (test_command_install_data.InstallDataTestCase.test_simple_run) was
> broken in r1152.
This looks like a local revision number, which has no meaning outside of one specific repository.  What is the changeset identifier?  (see http://hgbook.red-bean.com/read/a-tour-of-mercurial-the-basics.html#id345536)

Thanks for the diagnosis!  Code calling functions from the backported shutil should obviously catch exceptions from the backported shutil.  I’ll review all modules using the backport.

FYI, some distutils2 modules use shutil from the stdlib, for functions that are already here in 2.4; not sure if that is good or bad.

> Ideally, I think distutils2/_backport/shutil.py should do "from shutil import Error"
> instead of defining its own Error class
Oh, no, our backported module is strictly independent from the stdlib one.

> importing shutil from the stdlib is broken in that file besides.
I don’t understand this.
msg146574 - (view) Author: David Barnett (mu_mind) Date: 2011-10-28 18:01
>> The remaining test (test_command_install_data.InstallDataTestCase.test_simple_run) was
>> broken in r1152.
>This looks like a local revision number, which has no meaning outside of one specific repository.  What is the changeset identifier?  (see http://hgbook.red-bean.com/read/a-tour-of-mercurial-the-basics.html#id345536)
Oh, sorry, it's d1d251292ee7. (I got the short rev from the hg.python.org interface, so I thought it would be "authoritative" enough, but I guess it is ambiguous)

>> importing shutil from the stdlib is broken in that file besides.
> I don’t understand this.
When I do "import shutil" inside _backport/shutil.py, it seems to be importing itself (??) if I don't explicitly enable absolute imports (in python 2.7). If I delete the "class Error" definition and instead add "from shutil import Error", I get an ImportError.
msg146719 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-31 17:29
> When I do "import shutil" inside _backport/shutil.py
You shouldn’t do that!  Our backported module is fully stand-alone.

I have fixed the bug with this change in install_data.py:
 
-from shutil import Error
+from distutils2._backport.shutil import Error

I think I’m going to update our whole codebase to only use the backported shutil, never the stdlib one, for clarity (i.e. to avoid similar bugs in the future).
msg147502 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-12 15:27
All three issues fixed, thanks!  I can’t push today but I will as soon as possible, probably Monday.

I will open another report for the change I reverted in config; it was done on purpose by another developer to fix a bug with distutils2’s own setup script, so there is a real bug to fix here.
msg147596 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-11-14 14:24
New changeset 5b096fc6e65d by Éric Araujo in branch 'default':
Fix import in install_data (#13170).  Thanks to David Barnett.
http://hg.python.org/distutils2/rev/5b096fc6e65d

New changeset 2d469ccfe30e by Éric Araujo in branch 'python3':
Merge fixes for #13170 and #12386 and other misc. changes from default
http://hg.python.org/distutils2/rev/2d469ccfe30e
msg148036 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-11-21 13:21
New changeset c1b1b537196d by Éric Araujo in branch 'default':
Remove usage of stdlib shutil.
http://hg.python.org/distutils2/rev/c1b1b537196d
History
Date User Action Args
2022-04-11 14:57:22adminsetgithub: 57379
2011-11-21 13:21:51python-devsetmessages: + msg148036
2011-11-14 14:24:19python-devsetmessages: + msg147596
2011-11-12 15:27:19eric.araujosetstatus: open -> closed
resolution: fixed
messages: + msg147502

stage: resolved
2011-10-31 17:29:45eric.araujosetassignee: tarek -> eric.araujo
messages: + msg146719
2011-10-28 18:01:51mu_mindsetmessages: + msg146574
2011-10-28 15:18:33eric.araujosetmessages: + msg146569
2011-10-28 04:56:32mu_mindsetmessages: + msg146534
2011-10-19 19:08:03python-devsetmessages: + msg145939
2011-10-18 16:16:43python-devsetnosy: + python-dev
messages: + msg145832
2011-10-18 05:35:27mu_mindsetmessages: + msg145772
2011-10-18 04:57:34mu_mindsetnosy: + mu_mind
messages: + msg145771
2011-10-13 16:37:16eric.araujocreate