Problem while copying a file from a remote filer

Aahz aahz at pythoncraft.com
Wed Mar 25 19:51:21 EDT 2009


In article <mailman.1957.1237182478.11746.python-list at python.org>,
Chris Rebert  <clp2 at rebertia.com> wrote:
>On Sun, Mar 15, 2009 at 10:24 PM, venutaurus539 at gmail.com
><venutaurus539 at gmail.com> wrote:
>> Hi all,
>> I have to write an application which does a move and
>copy of a
>> file from a remote machine to the local machine. I tried something
>> like:
>>
>> file =3D ur"\\\\venuwin2008\\C\\4Folders\\Folder02\\Folder002\
>> \TextFile_06.txt"
>
>The 'r' prefix on the string makes it a raw string, meaning you don't
>have do double-up the backslashes, but you did so anyway, so your path
>has many extra backslashes, making it invalid. Dropping the 'r' prefix
>should fix the problem.

Alternatively, and I think better practice, undouble the backslashes
instead of removing the 'r' prefix.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"At Resolver we've found it useful to short-circuit any doubt and just
refer to comments in code as 'lies'. :-)"
--Michael Foord paraphrases Christian Muirhead on python-dev, 2009-3-22



More information about the Python-list mailing list