Commit b03d637
authored
fix: duplicated file may has different line endings (#77)
* fix: duplicated file may has different line endings
Python's stream writing uses OS's line ending.
So if you duplicate a Unix line ending file on Windows by writing file
content, the duplicate file will use \r\n as its line ending.
Why we don't use copy file API at the first place?
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
* fix: disallow duplicate file with dst = src
It just can't be done. Even worse, if the user select "overwrite",
the source file gets deleted first, and no destination file will be
created because no source file can be opened anymore.
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
* style: make black happy
Signed-off-by: Jack Cherng <jfcherng@gmail.com>1 parent 74be57b commit b03d637
2 files changed
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
57 | | - | |
58 | | - | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments