From 424c658da44c8bf926c3c0f69bb7cea91402e388 Mon Sep 17 00:00:00 2001 From: Max Shytikov Date: Tue, 22 Apr 2014 21:32:34 +0200 Subject: [PATCH] Fixed open tmp file in python3 --- vcr/migration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: