You are not logged in.

#1 2026-03-22 17:49:17

Ratainen
Member
Registered: 2026-03-22
Posts: 6

[SOLVED] Some text files have the wrong mime type x-wine-extension-ini

So depending on the contents of text files they might get their mime type changed to x-wine-extension-ini. When changing the contents, the mime type will immediately update.
I first noticed this with my yazi.toml file as yazi wasn't able to open it. I then removed as much as I could from it and was left with this file that still gets the changed mime type, but if I delete anything from this the mime type becomes the normal text/plain (I can't have a code block end with an empty line or it will get trimmed so I just wrote it in there):

[
[o]
<empty line>

This even happens when making a new text file and typing those contents in it.

I tried following both wine mime association removal sections from here, but they didn't change anything.
I also only have wine installed through Steam and Bottles, but not the actual package.

Last edited by Ratainen (2026-03-26 14:17:20)

Offline

#2 2026-03-22 22:24:03

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,457

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

get their mime type changed to x-wine-extension-ini

According to what tool?
The mime type is heuristically derived from the suffix and the content, https://wiki.archlinux.org/title/Wine#U … sociations will prevent eg. xdg-open from opening files w/ wine

mimetype from https://archlinux.org/packages/?name=perl-file-mimeinfo should™ detect foo.toml as toml file (because of the extension)

Offline

#3 2026-03-23 06:15:58

Ratainen
Member
Registered: 2026-03-22
Posts: 6

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

According to both

xdg-mime query filetype ...

and

file --mime-type ...

That other mimetype tool you linked though detected the type correctly. Weirdly enough xdg-open seems to automatically use that instead and work when I installed it, but yazi is still failing to open files, because of that wine mime.

And I already tried those steps of removing the associations.

Offline

#4 2026-03-23 07:12:03

loqs
Member
Registered: 2014-03-06
Posts: 18,860

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

The issue is fixed in upstream file's git by https://github.com/file/file/commit/0a2 … fec2e8f7a1 while at the same time causing check to fail:

Running test: ../tests/CVE-2014-1943
TZ=UTC MAGIC=../magic/magic ./test -e ../tests/CVE-2014-1943.testfile ../tests/CVE-2014-1943.result
test: ERROR: result was (len 36)
ASCII text, with no line terminators
expected (len 30)
Apple Driver Map, blocksize 0
../tests/CVE-2014-1943.testfile: ASCII text, with no line terminators
make[2]: *** [Makefile:819: check-local] Error 1

Last edited by loqs (2026-03-23 07:48:55)

Offline

#5 2026-03-23 16:56:03

Ratainen
Member
Registered: 2026-03-22
Posts: 6

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

That check failure seems to have just gotten fixed, but even after switching to the file git version the problem stays.

Though I can at least fix the biggest problem from this by switching yazi to use the mime-ext.yazi plugin that just checks the file extension for the app to run, but that breaks some other functionality.

Last edited by Ratainen (2026-03-23 17:01:51)

Offline

#6 2026-03-23 19:16:08

loqs
Member
Registered: 2014-03-06
Posts: 18,860

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

Ratainen wrote:

That check failure seems to have just gotten fixed, but even after switching to the file git version the problem stays.

https://github.com/file/file/commit/fba … b1a6566e5d which fixes check reintroduces the issue. Can you reproduce the issue with that commit reverted?

Offline

#7 2026-03-24 18:11:38

Ratainen
Member
Registered: 2026-03-22
Posts: 6

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

Yeah, the issue seems to happen even with that version if I build it with the checks disabled.
Also I don't know if this is irrelevant as the latest commits fixed the checks, but the check that fails for me is different:

Running test: ../tests/android-vdex-1
TZ=UTC MAGIC=../magic/magic ./test -e ../tests/android-vdex-1.testfile ../tests/android-vdex-1.result
../tests/android-vdex-1.testfile: Android vdex file,
test: ERROR: result was (len 18)
Android vdex file,
expected (len 124)
Android vdex file, verifier deps version: 021, dex section version: 002, number of dex files: 4, verifier deps size: 106328
make[2]: *** [Makefile:819: check-local] Error 1

Offline

#8 2026-03-24 20:17:44

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,457

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

Offline

#9 2026-03-24 21:17:01

loqs
Member
Registered: 2014-03-06
Posts: 18,860

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

If the issue is still there with file's current git HEAD I suggest opening an issue on https://bugs.astron.com. I can not see if one exists already as you need to register even to view issues.

Last edited by loqs (2026-03-24 21:17:24)

Offline

#10 2026-03-25 19:09:43

Ratainen
Member
Registered: 2026-03-22
Posts: 6

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

Okay I think I now know what's going on in here. The x-wine-extension-ini mime type is for the windows ini file which can look identical to toml files.
For example this should be both a valid ini and toml file.

[Abc]
Num1 = 123

[Def]
Num2 = 456

So I guess it's not technically a bug, because the point of the file utility seems to be to guess the file type from the contents instead of the extension.

I think I have to fix this from the yazi config, but for some reason adding an open rule with "application/x-wine-extension-ini" does not seem to work.

{ mime = "application/x-wine-extension-ini", use = "edit" }

Though I don't know if this is getting too yazi specific now and I should just ask for help there.

Offline

#11 2026-03-25 20:06:01

loqs
Member
Registered: 2014-03-06
Posts: 18,860

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

Ratainen wrote:

Okay I think I now know what's going on in here. The x-wine-extension-ini mime type is for the windows ini file which can look identical to toml files.

I do not believe the regular expressions file uses to identify Windows ini should be matching though as they are looking for very specific strings https://github.com/file/file/blob/FILE5 … 1131-L1160

@seth what do you think?

Offline

#12 2026-03-25 20:42:44

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,457

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

File git master detects #10 as "application/x-wine-extension-ini; charset=us-ascii" which is probably wrong.
The reason is the block starting at 1266 - hold on…

The cause is https://github.com/file/file/commit/7a1 … 677ea9c7b5
The comment *explicitly* states

# characters, digits, underscore and white space followed by right bracket
# terminated by CR implies section line to skip BOOTLOG.TXT DETLOG.TXT

Not LF - maybe the idea was CRLF?

Last edited by seth (2026-03-25 21:02:45)

Offline

#13 2026-03-25 21:05:39

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,457

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

Trying to get a comment on the commit.

Offline

#14 2026-03-25 23:11:10

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,457

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

Reverted upstream, https://github.com/file/file/commit/f37 … 3af7a8e223
Do we need a downstream bug to pick the patch?
(Upstream release frequency seems ~1.5 pa, there's precedent, https://gitlab.archlinux.org/archlinux/ … 1c8dbf8ff1 )

Offline

#15 2026-03-26 14:15:32

Ratainen
Member
Registered: 2026-03-22
Posts: 6

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

Oh well, I do love being confidently wrong.
Updating to the latest commit now fixes the issue, but yeah this should probably be fixed downstream so that there wouldn't be a need to use the git version for almost a year just for that fix.

Thanks a lot for the help, I guess I can mark this as solved now.

Last edited by Ratainen (2026-03-26 14:18:22)

Offline

#16 2026-03-26 14:38:23

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,457

Re: [SOLVED] Some text files have the wrong mime type x-wine-extension-ini

Offline

Board footer

Powered by FluxBB