I got it.

Switched to shutil and made to paths complete paths. The added benefit is
that it didn't trash the original file.

shutil.copy2(_files_to_mod + "\\" + fname, _files_to_mod + "\\" + new_name)

Thanks.

---------- Forwarded message ----------
From: Roy Hinkelman <royh...@gmail.com>
Date: Tue, Dec 8, 2009 at 12:27 PM
Subject: Re: File renaming using os.rename problem (spir)
To: tutor@python.org




Why don't you simply print out fname? This should point you to the error.

Denis


I did here:
>         if fname == old_name:
>             print fname # test

and it looks correct.

On an WinXP, should I use shutil instead?

Roy
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to