[Pythonmac-SIG] how to delete files which special characters on Mac OS 10.3

Paul Berkowitz berkowit at silcom.com
Mon Jan 12 17:10:14 EST 2004


On 1/12/04 1:48 PM, "Arthur Elsenaar" <artelse at mohr-i.nl> wrote:

> 
> On Jan 12, 2004, at 21:41, Dr. L. Humbert wrote:
> 
>> 'SIIHamm,G\xed\xb6\x86\xed\xbb\xa9chu.a.rtf'
>> I wanted to delete those files with the finder (via trash),
>> but I had no success.
>>     error -43
>> Ok, so I decided to open a terminal and tried
>>     rm -rf *
>> in the directory, where those files "live".
>> But -- it did'nt work.
> 
> I've exactly the same problem with some files containing 'illegal'
> characters in the file name. In my case most of these files are in the
> german language and contain umlauts. They just sit there and I can't
> delete them, I tried most of the ways you describe here, but to no
> afail.
> 
> Mostly these files were saved by nicotine (pyslsk) on X11, a python
> peer-to-peer filesharing app. It clearly is a bug in OS X, but does
> anyone know how to get rid of files that are listed, but when you try
> deleting them don't exist?

In AppleScript, the problem only arises when the startup disk name contains
these accents, Otherwise accents are OK. It's a discrepancy between the file
system, which uses decomposed Unicode diacritic characters only, and most
European language's keyboards which use precomposed Unicode diacritic
characters. Perhaps in Python the problem extends to other folders and files
in the path, I don't know. It worth trying to change the name of your
startup disk (maybe other disks too) so they contain no accents, then try
again. Worst come to worst, do it in AppleScript ('alias' filePath' form).

-- 
Paul Berkowitz





More information about the Pythonmac-SIG mailing list