This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: shutil.copytree debug message problem
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, hydr0g3n
Priority: normal Keywords:

Created on 2006-04-19 12:42 by hydr0g3n, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg28308 - (view) Author: Christophe DUMEZ (hydr0g3n) Date: 2006-04-19 12:42
I noticed a problem in shutil.copytree :

try:
  if symlinks and os.path.islink(srcname):
    linkto = os.readlink(srcname)
    os.symlink(linkto, dstname)
  elif os.path.isdir(srcname):
    copytree(srcname, dstname, symlinks)
  else:
    copy2(srcname, dstname)
# XXX What about devices, sockets etc.?
except (IOError, os.error), why:
  errors.append((srcname, dstname, why))

'why' isn't displayed in tuple, maybe this line would
be better for debug :
  "errors.append((srcname, dstname, why.strerror))"

then, it will display something (for example:
'permission denied').
msg28309 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-04-28 16:55
Logged In: YES 
user_id=849994

From rev. 45785, the line reads errors.append((srcname,
dstname, str(why)))

This way, you get the full information out of the
IOError/OSError.
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43250
2006-04-19 12:42:47hydr0g3ncreate