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: distutils error on MSVC older than 8
Type: Stage: resolved
Components: Distutils Versions: Python 3.1, Python 3.2, Python 2.7, 3rd party
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: BreamoreBoy, dstufft, eric.araujo, francismb, loewis, ocean-city, tarek
Priority: normal Keywords: patch

Created on 2010-07-20 11:07 by ocean-city, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py3k_distutils_on_old_msvc.patch ocean-city, 2010-07-20 11:07
py3k_skip_in_distutils_test.patch ocean-city, 2010-09-12 23:54 use skip functionality
Messages (15)
msg110886 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2010-07-20 11:07
I got an error while testing py3k on VC6. Here is a patch.

======================================================================
ERROR: test_remove_visual_c_ref (distutils.tests.test_msvc9compiler.msvc9compile
rTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\distutils\tests\test_msvc9compiler.py", line 112,
 in test_remove_visual_c_ref
    from distutils.msvc9compiler import MSVCCompiler
  File "e:\python-dev\py3k\lib\distutils\msvc9compiler.py", line 291, in <module
>
    raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VE
RSION)
distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module

----------------------------------------------------------------------
Ran 170 tests in 49.070s

FAILED (errors=1, skipped=4)
Traceback (most recent call last):
  File "test_distutils.py", line 18, in <module>
    test_main()
  File "test_distutils.py", line 13, in test_main
    test.support.run_unittest(distutils.tests.test_suite())
  File "e:\python-dev\py3k\lib\test\support.py", line 1054, in run_unittest
    _run_suite(suite)
  File "e:\python-dev\py3k\lib\test\support.py", line 1037, in _run_suite
    raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\distutils\tests\test_msvc9compiler.py", line 112,
 in test_remove_visual_c_ref
    from distutils.msvc9compiler import MSVCCompiler
  File "e:\python-dev\py3k\lib\distutils\msvc9compiler.py", line 291, in <module
>
    raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VE
RSION)
distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module
msg112244 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-01 01:05
I don’t know the details of MSVC versions, but the error message seems to mean that this version is not supported, so there is nothing to fix.
msg112265 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2010-08-01 05:01
Other test functions already have such skips. So I think another skip is acceptable here. But maybe it's better to skip entire msvc9compilerTestCase class (by class decorator).
msg116242 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2010-09-12 22:57
Fixed in r84753(py3k).
msg116249 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-12 23:21
Wouldn’t it be more accurate to skip the test instead of returning None (falsely indicating success)?
msg116250 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-12 23:21
(Adding distutils2 component so that forward-porting the patch is not forgotten.)
msg116254 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2010-09-12 23:54
How about attached patch? I confirmed this both on MSVC8 and MSVC6.
msg116259 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-13 00:26
Looks excellent, just import the function at the module scope instead of function scope (I’ve heard about import deadlock issues, and performance is not an issue in tests, so there is no reason to import in the function).

Please backport to 3.1 and 2.7 if the bug applies to them.
msg116277 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2010-09-13 05:43
> I’ve heard about import deadlock issues, and performance is not an
> issue in tests, so there is no reason to import in the function

distutils.msvc9compiler imports winreg internally,
and it only exists on windows, so importing distutils.msvc9.....
compiler may raise ImportError on Linux. So I imported only when
sys.platform == "win32".

Committed in r84760(py3k). And will be merged into other branches.
msg120991 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-12 00:18
Re-opening to remind myself about the forward-port.
msg129901 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011-03-02 15:09
Éric, what forward porting exactly needs to be done?
msg131383 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-19 02:43
Martin: Just applying the same changes to distutils2.
msg227766 - (view) Author: Francis MB (francismb) * Date: 2014-09-28 16:50
Hi Éric,
are the changes to distutils2 applied? could the issue be closed (has resolution:fixed) or is something to be done?
msg227767 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-09-28 16:54
Distutils2 is dead.
msg227770 - (view) Author: Francis MB (francismb) * Date: 2014-09-28 17:19
> Distutils2 is dead.
I wasn't aware of that and I'm sorry for that. In that case that issue can IMHO be closed.
History
Date User Action Args
2022-04-11 14:57:04adminsetgithub: 53559
2014-09-28 17:46:38berker.peksagsetstatus: open -> closed
2014-09-28 17:19:20francismbsetmessages: + msg227770
2014-09-28 16:54:30BreamoreBoysetnosy: + dstufft, BreamoreBoy
messages: + msg227767
components: - Distutils2
2014-09-28 16:50:19francismbsetnosy: + francismb
messages: + msg227766
2011-03-19 02:43:38eric.araujosetnosy: loewis, ocean-city, tarek, eric.araujo
messages: + msg131383
2011-03-02 15:09:52loewissetnosy: loewis, ocean-city, tarek, eric.araujo
messages: + msg129901
2010-11-12 00:18:20eric.araujosetstatus: closed -> open
versions: + 3rd party
nosy: loewis, ocean-city, tarek, eric.araujo
messages: + msg120991

assignee: ocean-city -> eric.araujo
components: - Tests
2010-09-13 05:43:56ocean-citysetmessages: + msg116277
2010-09-13 00:26:15eric.araujosetassignee: ocean-city
messages: + msg116259
2010-09-12 23:55:05ocean-citysetassignee: tarek -> (no value)
2010-09-12 23:54:26ocean-citysetfiles: + py3k_skip_in_distutils_test.patch
assignee: tarek
messages: + msg116254
2010-09-12 23:22:14eric.araujosetassignee: tarek -> (no value)
2010-09-12 23:21:51eric.araujosetassignee: tarek
messages: + msg116250
components: + Distutils2
nosy: loewis, ocean-city, tarek, eric.araujo
2010-09-12 23:21:01eric.araujosetmessages: + msg116249
2010-09-12 22:57:16ocean-citysetstatus: open -> closed
versions: + Python 2.7
messages: + msg116242

assignee: tarek -> (no value)
resolution: fixed
stage: resolved
2010-08-01 05:01:15ocean-citysetmessages: + msg112265
2010-08-01 01:05:34eric.araujosetnosy: + loewis, eric.araujo
messages: + msg112244
2010-07-20 11:07:20ocean-citycreate