Re: :copy bug

"Oleg Puchinin" <[email protected]> Mon, 20 Nov 2006 17:12:17 +0600
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Hmm.......

Python 2.5

-------------------------------------------------------------
Aap: Internal Error
Aap: Traceback (most recent call last):
   File "/usr/lib/aap/Exec-1.088/Process.py", line 1168, in Process
    exec script_string in recdict, recdict
   File "<string>", line 9, in <module>
   File "/usr/lib/aap/Exec-1.088/Commands.py", line 2069, in aap_copy
    copy_move(line_nr, recdict, arg, 1)
   File "/usr/lib/aap/Exec-1.088/CopyMove.py", line 62, in copy_move
    argdictlist[-1], optiondict, 1, errmsg = 1)
   File "/usr/lib/aap/Exec-1.088/CopyMove.py", line 517, in remote_copy_move
    shutil.copy(fpath, destpath)
   File "/usr/lib/python2.5/shutil.py", line 80, in copy
    copyfile(src, dst)
   File "/usr/lib/python2.5/shutil.py", line 41, in copyfile
    raise Error, "`%s` and `%s` are the same file" % (src, dst)
 Error: `./silent_bob` and `/usr/bin/silent_bob` are the same file

Aap: Aborted
------------------------------------------------------------

def samestat(s1, s2):
    """Test whether two stat buffers reference the same file"""
    return s1.st_ino == s2.st_ino and \
           s1.st_dev == s2.st_dev

def samefile(f1, f2):
    """Test whether two pathnames reference the same actual file"""
    s1 = os.stat(f1)
    s2 = os.stat(f2)
    return samestat(s1, s2)


Oleg.

2006/11/20, Oleg Puchinin <[email protected]>:
> Yes........
> flock variant (in attachement) ..........
>
> 2006/11/20, Bram Moolenaar <[email protected]>:
> >
> > Oleg Puchinin wrote:
> >
> > > I found bug in ":copy" command. The result is wrong when target file
> > > symlinked to source file.
> > > ":system cp" work properly (do nothing).
> >
> > Perhaps you can suggest a patch to solve this?
> >
> > --
> > hundred-and-one symptoms of being an internet addict:
> > 269. You receive an e-mail from the wife of a deceased president, offering
> >      to send you twenty million dollar, and you are not even surprised.
> >
> >  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
> > ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> > \\\        download, build and distribute -- http://www.A-A-P.org        ///
> >  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
> >
>
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV