Ticket #9184: storage_save_str_fix2.diff
File storage_save_str_fix2.diff, 832 bytes (added by , 16 years ago) |
---|
-
storage.py
157 157 fd = os.open(full_path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | getattr(os, 'O_BINARY', 0)) 158 158 try: 159 159 locks.lock(fd, locks.LOCK_EX) 160 for chunk in content.chunks(): 161 os.write(fd, chunk) 160 if hasattr(content, 'chunks'): 161 for chunk in content.chunks(): 162 os.write(fd, chunk) 163 else: 164 os.write(fd, content) 162 165 finally: 163 166 locks.unlock(fd) 164 167 os.close(fd)