Test failures with Python 3.2 and enabled warnings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-distutils-extra |
New
|
Undecided
|
Unassigned |
Bug Description
12 tests fail with Python 3.2 and enabled warnings. Warnings are disabled by default in Python 2.7 and >=3.2. Warnings can be enabled by -Wd option or PYTHONWARNINGS="d" environmental variable.
'contents = open(path).read()' should be changed to 'file = open(path); contents = file.read(); file.close()' or 'with open(path) as file: contents = file.read()'.
Example failure:
$ PYTHONPATH="." python3.2 -Wd test/auto.py
..F..F.
=======
FAIL: test_dbus (__main__.T)
D-BUS configuration and service files
-------
Traceback (most recent call last):
File "test/auto.py", line 149, in test_dbus
self.
AssertionError: "/tmp/python-
- /tmp/python-
- if '-//freedesktop
- /tmp/python-
- if '-//freedesktop
- /tmp/python-
- lines = [l.strip() for l in open(f)
- /tmp/python-
- lines = [l.strip() for l in open(f)
- /tmp/python-
- lines = [l.strip() for l in open(f)