file/folder naming

ecu_jon hayesjdno3 at yahoo.com
Sat Feb 19 01:13:42 EST 2011


ok changed the try/except to just a file copy and got this:
sourcepath is : [u'I:\\college\\spring11\\capstone-project\
\facbac-009.py']
destpath is : V:\week3
destpath is : V:\week3\facbac-009.py
Traceback (most recent call last):
  File "I:\college\spring11\capstone-project\folder.py", line 53, in
button1Click
    backupfiles()
  File "I:\college\spring11\capstone-project\folder.py", line 19, in
backupfiles
    shutil.copy2(sourcepath,
os.path.join(destpath,os.path.basename(files)))
  File "C:\Python27\lib\shutil.py", line 127, in copy2
    copyfile(src, dst)
  File "C:\Python27\lib\shutil.py", line 67, in copyfile
    if _samefile(src, dst):
  File "C:\Python27\lib\shutil.py", line 62, in _samefile
    return (os.path.normcase(os.path.abspath(src)) ==
  File "C:\Python27\lib\ntpath.py", line 471, in abspath
    path = _getfullpathname(path)
TypeError: coercing to Unicode: need string or buffer, list found

yes i see the list.
but shouldnt this "for files in sourcepath:" parse thru the list ... ?



More information about the Python-list mailing list