Skip to content

Commit 68a3d5b

Browse files
author
Luiko Czub
committed
fix _getAttachmentArgs() - closing file descriptor #148
1 parent 610c5ac commit 68a3d5b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/testlink/testlinkapigeneric.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,10 @@ def _getAttachmentArgs(self, attachmentfile):
21362136
else:
21372137
raise testlinkerrors.TLArgError(
21382138
'invalid attachment file: %s' % attachmentfile)
2139-
2139+
finally:
2140+
# ensure file open inside this method call is closed again
2141+
if not already_file_obj:
2142+
a_file_obj.close()
21402143

21412144
return {'filename':os.path.basename(a_file_path),
21422145
'filetype':guess_type(a_file_path)[0],

src/testlink/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
#
1818
# ------------------------------------------------------------------------
1919

20-
VERSION = '0.8.1-fix127'
20+
VERSION = '0.8.2-dev148'
2121
TL_RELEASE = '1.9.20-fixed'

0 commit comments

Comments
 (0)