Abnormal names

i have some directories that contain non-ASCII characters, eg Puccini_ La Bohème [Disc 1] that are a bother, but the OS can find them just fine. these get converted by util.normpath and util.syspath into a beet-normal form for inclusion in the database, for reasons i can appreciate.

but then these normalized names are DIFFERENT than what actually exists wrt/ the OS, and the os.path.exists() test fails in commands.import_files(). does beets insist on RENAMING files to conform to its normalization?

1 Like

No filename conversions/renames of special characters seem to being done for me. In fact that is why I had to recently create the “bare-ASCII” plugin to make it easier to match names with accents.

Am I misunderstanding something?

hi @GrahamCobb , it’s not that all characters are getting flattened to ASCII. eg, Vladimir Ashkenazy; André Previn_ London Symphony Orchestra... is included without issue. and the item.path attribute is a (binary) BLOB, it can handle these. but the logic of commands.import_files() (beets/commands.py at 2b8a2eb96bcaf418cdfcc0cfe762a18e31cff138 · beetbox/beets · GitHub) fails for me, expecting the normed name to exist?

I am guessing you are using Windows. If so, I really can’t be much help - I don’t own a Windows system.

I believe the purpose of normpath is to make the file path fully specified (for example, remove dependence on the current directory), and the purpose of syspath is to make sure the file path is in the correct format for the OS being used. In other words, they should not be changing the name at all - just making sure the name being stored will work in future. It certainly isn’t supposed to involve any renaming of the files.

You probably need someone familiar with Windows filesystems to explain what is going on in your case. I guess it could be something to do with character sets for filesystem names or something?

Hi @GrahamCobb, we agree: No Windoz! I’m using mostly Linux for this, with most of the music captured from my OSX machines.

On Linux, syspath does nothing. And normpath doesn’t look like it does anything which should break the path. And, I certainly use beets on Linux with many weird filenames without having any problem.

All I can think of is that it is something to do with unicode encodings. I am using python3, all my filenames are UTF-8 and my locale is always set as en_IE.utf8.

Sorry I can’t be more helpful.