Github user JoshRosen commented on the pull request:
https://github.com/apache/spark/pull/1042#issuecomment-50102861
It looks like `unittest2` isn't the only change required for the unit tests
to pass on Python 2.6.
In `tests.py`, `createFileInZip()` uses `ZipFile` as a context manager,
which is only supported in Python 2.7+
(https://docs.python.org/2.7/library/zipfile.html?highlight=zipfile#zipfile.ZipFile):
```python
with zipfile.ZipFile(path, 'w') as zip:
zip.writestr(name, content)
return path
```
We should probably replace this with a try-finally block.
There's a neat tool called [pyqver](https://github.com/ghewgill/pyqver)
that aims to identify the minimum required Python version for a particular
script. Unfortunately, it doesn't detect this ZipFile issue; I'll look into
opening a pull request to add a check for it.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---