Skip to content

Commit

Permalink
Merge pull request googleapis#76 from megadevx/patch-3
Browse files Browse the repository at this point in the history
Fixed save() to work on windows and linux
  • Loading branch information
Narcolapser authored Jan 10, 2018
2 parents a0a1599 + 59d1b2b commit 432dd61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion O365/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import json
import requests
import sys
from os import path

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -81,7 +82,7 @@ def save(self,location):
location -- path to where the file is to be saved.
'''
try:
outs = open(location+'/'+self.json['Name'],'wb')
outs = open(path.join(location, self.json['Name']),'wb')
outs.write(base64.b64decode(self.json['ContentBytes']))
outs.close()
log.debug('file saved locally.')
Expand Down

0 comments on commit 432dd61

Please sign in to comment.