Changeset 119412d in OpenWorkouts-current for ow/utilities.py
- Timestamp:
- Jan 9, 2019, 12:31:39 PM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- b73ae09
- Parents:
- 53bb3e5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/utilities.py
r53bb3e5 r119412d 172 172 173 173 174 def create_blob(data, file_extension ):174 def create_blob(data, file_extension, binary=False): 175 175 """ 176 176 Create a ZODB blob file from some data, return the blob object … … 180 180 with blob.open('w') as open_blob: 181 181 # use .encode() to convert the string to bytes if needed 182 if not isinstance(data, bytes):182 if not binary and not isinstance(data, bytes): 183 183 data = data.encode('utf-8') 184 184 open_blob.write(data)
Note: See TracChangeset
for help on using the changeset viewer.