use of with statement breaks Python 2.4 compatibility

Bug #1072533 reported by David Carr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dulwich
Fix Released
High
Unassigned

Bug Description

According to the python reference [1], the with statement was introduced in Python 2.5. According to the Dulwich main page [2], Dulwich is intended to be tested with (and presumably, support) CPython 2.X where X >= 4.

The line in question is in dulwich/repo.py:
with open(os.path.join(root, ".git"), 'r') as f:

I've attached an attempt at a patch.

[1]: http://docs.python.org/2/reference/compound_stmts.html#the-with-statement
[2]: http://www.samba.org/~jelmer/dulwich/

Revision history for this message
David Carr (cppege430dtvg7d94ro-o07xw-9ei9nyjpwdexk1if796) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Merged, thanks!

Changed in dulwich:
status: New → Fix Committed
importance: Undecided → High
Jelmer Vernooij (jelmer)
Changed in dulwich:
milestone: none → 0.9.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.