Re: simple problem with os.rename() parameters - path with spaces

2005-09-10 Thread Peter Hansen
Tom wrote: > Peter Hansen wrote: >> Where do you think those double quotation marks came from? What >> happens if you try the following instead of using the variables you >> were trying to use? >> >> os.rename("e:\\music\\Joni Mitchell\\ogg-8", >> "e:\\music.ogg\\Joni Mitchell\\ogg-8") >> >

Re: simple problem with os.rename() parameters - path with spaces

2005-09-10 Thread Tom
Peter Hansen wrote: > Tom wrote: > >>Drive E: is removable, so I was careful to verify that that was a factor >>in the problem. >> >>Yes, I can do the same renaming, with the same drive, at the command line. >> >>I think I put the emphasis in the wrong place in my question. This >>isn't really

Re: simple problem with os.rename() parameters - path with spaces

2005-09-10 Thread Peter Hansen
Tom wrote: > Drive E: is removable, so I was careful to verify that that was a factor > in the problem. > > Yes, I can do the same renaming, with the same drive, at the command line. > > I think I put the emphasis in the wrong place in my question. This > isn't really about os.rename(). It is

Re: simple problem with os.rename() parameters - path with spaces

2005-09-10 Thread Tom
Yes, I am sure about those things. I've tried shutil.move and got the same result. Forward slash? I'll give that a try and report back here if it works. Thanks, Tom. Larry Bates wrote: > Are you sure the source directory exists and you > have rights to rename it? Because the rename works > for

Re: simple problem with os.rename() parameters - path with spaces

2005-09-10 Thread Tom
Peter Hansen wrote: > Tom wrote: > >>I'm having a problem using a path with spaces as a parameter to >>os.rename() in a program on WinXP. >> >>This works fine at the command line (where the folder "c:\aa bb" exists) >> >> > os.rename( "c\aa bb", "c:\cc dd" ); >> > >> >>But, I can't get it to work

Re: simple problem with os.rename() parameters - path with spaces

2005-09-09 Thread Peter Hansen
Tom wrote: > I'm having a problem using a path with spaces as a parameter to > os.rename() in a program on WinXP. > > This works fine at the command line (where the folder "c:\aa bb" exists) > > > os.rename( "c\aa bb", "c:\cc dd" ); > > > > But, I can't get it to work in my program, eg. > >

Re: simple problem with os.rename() parameters - path with spaces

2005-09-09 Thread Larry Bates
Are you sure the source directory exists and you have rights to rename it? Because the rename works for me. But you may want to look at shutil.move and/or use forward slashes (they work under Windows) -Larry Bates Tom wrote: > I'm having a problem using a path with spaces as a parameter to > o

simple problem with os.rename() parameters - path with spaces

2005-09-09 Thread Tom
I'm having a problem using a path with spaces as a parameter to os.rename() in a program on WinXP. This works fine at the command line (where the folder "c:\aa bb" exists) > os.rename( "c\aa bb", "c:\cc dd" ); > But, I can't get it to work in my program, eg. print SrcDir print NewDir os.rena