[Pywikipedia-l] [ pywikipediabot-Bugs-2009068 ] diskcache files could be deleted when bot finishes

SourceForge.net noreply at sourceforge.net
Wed Jul 2 19:37:24 UTC 2008


Bugs item #2009068, was opened at 2008-07-02 20:39
Message generated for change (Comment added) made by btongminh
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2009068&group_id=93107

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Melancholie (melancholie)
Assigned to: Nobody/Anonymous (nobody)
Summary: diskcache files could be deleted when bot finishes

Initial Comment:
Currently, using diskcache, cache files are created in the folder "cache". But they do not get deleted on proper exits. If you run the bot once more, a new cache file (for each wiki) is created:

1st run: msg-wikipedia-eo-wpovcxkn
2nd run: msg-wikipedia-eo-oqxakgvsy
etc.

When the bot finishes, all current *cache* files (c|sh)ould be deleted.

----------------------------------------------------------------------

>Comment By: Bryan (btongminh)
Date: 2008-07-02 21:37

Message:
Logged In: YES 
user_id=1806226
Originator: NO

Really strange that that destructor does not work. Perhaps add this
function to wikipedia.stopme() ?

----------------------------------------------------------------------

Comment By: Francesco Cosoleto (cosoleto)
Date: 2008-07-02 21:28

Message:
Logged In: YES 
user_id=181280
Originator: NO

I consider this a bug report, not a feature request because that it's
expected behaviour.

diskcache.py:

    def __del__(self):
        self.cache_file.close()
        import os
        os.unlink(self.cache_path)
        os = None

os.unlink() delete the file (http://docs.python.org/lib/os-file-dir.html).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2009068&group_id=93107



More information about the Pywikipedia-l mailing list