@@ -790,14 +790,14 @@ def build_workflow(opts, retval):
790
790
# among different renderings of the same file, first remove any
791
791
# existing one
792
792
citation_files = {
793
- ext : str ( logs_path / 'CITATION.' + ext )
793
+ ext : logs_path / ( 'CITATION.%s' % ext )
794
794
for ext in ('bib' , 'tex' , 'md' , 'html' )
795
795
}
796
796
for citation_file in citation_files .values ():
797
- if op . lexists ( citation_file ):
797
+ if citation_file . exists () or citation_file . is_symlink ( ):
798
798
citation_file .unlink ()
799
799
800
- Path ( citation_files ['md' ]) .write_text (boilerplate )
800
+ citation_files ['md' ].write_text (boilerplate )
801
801
logger .log (25 , 'Works derived from this fMRIPrep execution should '
802
802
'include the following boilerplate:\n \n %s' , boilerplate )
803
803
@@ -806,8 +806,8 @@ def build_workflow(opts, retval):
806
806
pkgrf ('fmriprep' , 'data/boilerplate.bib' ),
807
807
'--filter' , 'pandoc-citeproc' ,
808
808
'--metadata' , 'pagetitle="fMRIPrep citation boilerplate"' ,
809
- citation_files ['md' ],
810
- '-o' , citation_files ['html' ]]
809
+ str ( citation_files ['md' ]) ,
810
+ '-o' , str ( citation_files ['html' ]) ]
811
811
try :
812
812
check_call (cmd , timeout = 10 )
813
813
except (FileNotFoundError , CalledProcessError , TimeoutExpired ):
@@ -817,8 +817,8 @@ def build_workflow(opts, retval):
817
817
# Generate LaTex file resolving citations
818
818
cmd = ['pandoc' , '-s' , '--bibliography' ,
819
819
pkgrf ('fmriprep' , 'data/boilerplate.bib' ),
820
- '--natbib' , citation_files ['md' ],
821
- '-o' , citation_files ['tex' ]]
820
+ '--natbib' , str ( citation_files ['md' ]) ,
821
+ '-o' , str ( citation_files ['tex' ]) ]
822
822
try :
823
823
check_call (cmd , timeout = 10 )
824
824
except (FileNotFoundError , CalledProcessError , TimeoutExpired ):
0 commit comments