equal
deleted
inserted
replaced
453 return self._filter("encode", filename, data) |
453 return self._filter("encode", filename, data) |
454 |
454 |
455 def wwrite(self, filename, data, flags): |
455 def wwrite(self, filename, data, flags): |
456 data = self._filter("decode", filename, data) |
456 data = self._filter("decode", filename, data) |
457 if "l" in flags: |
457 if "l" in flags: |
458 f = self.wjoin(filename) |
458 self.wopener.symlink(data, filename) |
459 try: |
|
460 os.unlink(f) |
|
461 except OSError: |
|
462 pass |
|
463 d = os.path.dirname(f) |
|
464 if not os.path.exists(d): |
|
465 os.makedirs(d) |
|
466 os.symlink(data, f) |
|
467 else: |
459 else: |
468 try: |
460 try: |
469 if self._link(filename): |
461 if self._link(filename): |
470 os.unlink(self.wjoin(filename)) |
462 os.unlink(self.wjoin(filename)) |
471 except OSError: |
463 except OSError: |