[Python-bugs-list] [ python-Bugs-546749 ] odd exception moving file to trash

noreply@sourceforge.net noreply@sourceforge.net
Tue, 23 Apr 2002 14:01:24 -0700


Bugs item #546749, was opened at 2002-04-21 15:11
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=546749&group_id=5470

Category: Macintosh
Group: Platform-specific
>Status: Closed
>Resolution: Duplicate
Priority: 5
Submitted By: Just van Rossum (jvr)
Assigned to: Jack Jansen (jackjansen)
Summary: odd exception moving file to trash

Initial Comment:
MacPython 2.2.1 on OSX.1.4, from IDE:
>>> import macfs, findertools
>>> f = open("a_file_to_trash", "w")
>>> f.close()
>>> fss = macfs.FSSpec("a_file_to_trash")
>>> vrefnum = fss.as_tuple()[0]
>>> vrefnum, pardir = macfs.FindFolder(vrefnum, 
"trsh", 1)
>>> trashfolder = macfs.FSSpec((vrefnum, pardir, 
"")).as_pathname()
>>> findertools.move("a_file_to_trash", 
trashfolder)
Traceback (most recent call last):
  File "<input>", line 1, in ?
  File "Titaantje:Applications:Python 
2.2.1:Mac:Lib:findertools.py", line 74, in move
    return finder.move(src_fss, to=dst_fss)
  File "Titaantje:Applications:Python 
2.2.1:Mac:Lib:lib-
scriptpackages:Finder:Standard_Suite.py", line 
293, in move
    raise aetools.Error, 
aetools.decodeerror(_arguments)
aetools.Error: (0, 'component result = no error', 
None)
>>> 

The file _does_ get moved to the trash, but that's 
not visible in the Finder's Trash window, not even 
after more items are dragged to the trash 
manually.

----------------------------------------------------------------------

>Comment By: Jack Jansen (jackjansen)
Date: 2002-04-23 23:01

Message:
Logged In: YES 
user_id=45365

Closing as a duplicate of #493826

----------------------------------------------------------------------

Comment By: Jack Jansen (jackjansen)
Date: 2002-04-23 11:20

Message:
Logged In: YES 
user_id=45365

Ah! If it does show up if the thrash wasn't empty before then I think this is one of those finder quirks that happen when you do something behind its back. Esp. with the thrash this is imaginable: it is a figment of the finders imagination, consisting in reality of numerous folders on numerous disks. I think we should ignore this bit of the problem for now, and later may try adding findertools.touched() here or there. Or moving to the finder thrash object in stead of the folder underlying it.

----------------------------------------------------------------------

Comment By: Just van Rossum (jvr)
Date: 2002-04-22 17:23

Message:
Logged In: YES 
user_id=92689

(sorry for the duplicate...)

Yes I'm sure: there's nothing visible in the Finder, but it 
does show with "ls" in the terminal. New finding: it
_does_ show if the trash wasn't empty before...

----------------------------------------------------------------------

Comment By: Jack Jansen (jackjansen)
Date: 2002-04-22 15:18

Message:
Logged In: YES 
user_id=45365

This is a duplicate of #493826. I'm leaving this in too, though, because the bit about the resulting file not being visible in the thrash is something not in the other error report.

Also, a question: are you sure about not seeing the result in the Trash window? I *am* seeing it there. And I'm tempted to think that errn==0 simply doesn't signal an error...

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=546749&group_id=5470