Skip to content

Commit 491ac8d

Browse files
[MRG] FIX: Use os.replace instead of os.rename when copying CTF files (needed for windows) (#1035)
* fix: replace instead of rename for win support * add changelog * Update doc/whats_new.rst Co-authored-by: Richard Höchenberger <[email protected]>
1 parent ace2a7d commit 491ac8d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/whats_new.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ Detailed list of changes
8282

8383
- :func:`~mne_bids.read_raw_bids` doesn't populate ``raw.info['subject_info']`` with invalid values anymore, preventing users from writing the data to disk again, by `Richard Höchenberger`_ (:gh:`1031`)
8484

85+
- Writing and copying CTF files now works on Windows when files already exist (``overwrite=True``), by `Stefan Appelhoff`_ (:gh:`1035`)
86+
8587
:doc:`Find out what was new in previous releases <whats_new_previous_releases>`
8688

8789
.. include:: authors.rst

mne_bids/copyfiles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ def copyfile_ctf(src, dest):
162162
bids_folder_name = op.splitext(op.split(dest)[-1])[0]
163163
for fname in fnames:
164164
ext = op.splitext(fname)[-1]
165-
os.rename(op.join(dest, fname),
166-
op.join(dest, bids_folder_name + ext))
165+
os.replace(op.join(dest, fname),
166+
op.join(dest, bids_folder_name + ext))
167167

168168

169169
def copyfile_kit(src, dest, subject_id, session_id,

0 commit comments

Comments
 (0)