From c2ed55c8505d5a6e404bca99fbbcf587805e6611 Mon Sep 17 00:00:00 2001 From: Jyrki Pulliainen Date: Fri, 3 Jul 2009 22:25:01 +0100 Subject: [PATCH] copyonwrite: Fix write mode detection for binary files. Due to this bug, copyonwrite path was not correctly unbound on binary files. --- filesystem/copyonwrite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem/copyonwrite.py b/filesystem/copyonwrite.py index 0032a02..7e8d064 100644 --- a/filesystem/copyonwrite.py +++ b/filesystem/copyonwrite.py @@ -14,7 +14,7 @@ def __init__(self, bind=None, **kwargs): self._bound = getattr(kwargs.get('parent',''), '_bind', None) def open(self, mode='r', *moreargs, **kwargs): - if mode == 'w': + if 'w' in mode: self.unbind() ## TODO: we don't have test code for this yet #elif mode == 'r+':