Roundup Tracker - Issues

Issue 2550558

classification
blobfiles.py's getfile() should use r+b
Type: behavior Severity: normal
Components: Web interface Versions: 1.4
process
Status: closed
:
: : dwilliams, richard
Priority: :

Created on 2009-07-07 20:30 by dwilliams, last changed 2010-02-02 05:10 by richard.

Messages
msg3749 Author: [hidden] (dwilliams) Date: 2009-07-07 20:30
The getfile() method located around line 106 of backends/blobfiles.py
should open files for both reading and writing, otherwise changes to msg
and file content within extensions and detectors can not be committed
because the .tmp extension can't be removed.

This:

    def getfile(self, classname, nodeid, property):
        filename = self.filename(classname, nodeid, property)
        f = open(filename, 'rb')

is changed to this:

    def getfile(self, classname, nodeid, property):
        filename = self.filename(classname, nodeid, property)
        f = open(filename, 'r+b')

fixing this particularly vexing issue.
msg4014 Author: [hidden] (richard) Date: 2010-02-02 05:10
The file handle is not retained in the current code so this change no longer 
makes sense. Thanks for the submission anyway.
History
Date User Action Args
2010-02-02 05:10:07richardsetstatus: new -> closed
nosy: + richard
messages: + msg4014
2009-07-07 20:30:03dwilliamscreate