From: Max Shytikov Date: Tue, 22 Apr 2014 19:32:34 +0000 (+0200) Subject: Fixed open tmp file in python3 X-Git-Tag: v1.0.0~36^2~33 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=424c658da44c8bf926c3c0f69bb7cea91402e388;p=vcrpy.git Fixed open tmp file in python3 --- diff --git a/vcr/migration.py b/vcr/migration.py index d3e909a..da1f779 100644 --- a/vcr/migration.py +++ b/vcr/migration.py @@ -65,7 +65,7 @@ def migrate_yml(in_fp, out_fp): def migrate(file_path, migration_fn): # because we assume that original files can be reverted # we will try to copy the content. (os.rename not needed) - with closing(tempfile.TemporaryFile()) as out_fp: + with closing(tempfile.TemporaryFile(mode='w+')) as out_fp: with open(file_path, 'r') as in_fp: migration_fn(in_fp, out_fp) with open(file_path, 'w') as in_fp: