Skip to content
Browse files

Make sure to use binary mode for all files

Should fix issue #7
  • Loading branch information...
1 parent 3089470 commit e2d3a05160d7010e4eace3c9c8597a28d1db0b15 @jiaaro committed Jan 2, 2013
Showing with 3 additions and 3 deletions.
  1. +1 −1 pydub/audio_segment.py
  2. +2 −2 pydub/utils.py
View
2 pydub/audio_segment.py
@@ -259,7 +259,7 @@ def export(self, out_f=None, format='mp3', codec=None):
if format == 'wav':
return out_f
- output = NamedTemporaryFile(mode="w+", delete=False)
+ output = NamedTemporaryFile(mode="w+b", delete=False)
# build call args
args =[self.ffmpeg,
View
4 pydub/utils.py
@@ -2,9 +2,9 @@
from math import log
-def _fd_or_path_or_tempfile(fd, mode='w+', tempfile=True):
+def _fd_or_path_or_tempfile(fd, mode='w+b', tempfile=True):
if fd is None and tempfile:
- fd = TemporaryFile()
+ fd = TemporaryFile(mode=mode)
if isinstance(fd, basestring):
fd = open(fd, mode=mode)

0 comments on commit e2d3a05

Please sign in to comment.
Something went wrong with that request. Please try again.