LZMAFile does not support the with statement properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PylibLZMA |
New
|
Undecided
|
Unassigned |
Bug Description
Description of problem:
LZMAFile does not support the with statement properly.
Version-Release number of selected component (if applicable):
pyliblzma-
How reproducible:
Every time
Steps to Reproduce:
1. Use LZMAFile in a with statement, for example like this:
#!/usr/bin/env python2
import sys
from lzma import LZMAFile
lzmafile = LZMAFile(
#dir(lzmafile)
with lzmafile as f:
print f.read()
2. Run the script from above, for example like this:
python2 bug-lzma-with.py /usr/share/
Actual results:
Traceback (most recent call last):
File "./bug-
with tmp as f:
AttributeError: __exit__
Expected results:
No errors
Additional info:
If the dir call is uncommented, the program will work fine.
I'm using python-