Python directory created arbitrarily in some directories

When I browse my directories in Thunar, it (Thunar) automatically creates a subdirectory named “python” upon opening some directories. In some others it doesn’t, but in the directories where it has “decided” to create this “python” subdirectory, it always creates it: if I manually delete it (the “python” subdirectory), exit the parent directory, and then enter it again, the “python” subdirectory is created again. Also it happens if I press F5 while in such a directory.

It is observed only in Thunar. For comparison I have browsed my system somewhat in “xfe” file manager and did not observe this. This is not the same issue as here Thunar is displaying a non-existent directory SOLVED / General discussion / Xfce Forums — in my case the “python” directory is not a bookmark, but an actual directory that is created with its content (see below), I checked it in the terminal with ls and tree.

It does not seem to be the result of something malicious, since there are no files within the “python” directory, it is always created just with some empty subdirectories (always the same ones). The output of the tree command on such “python” directory:

.
└── usr
    └── lib
        └── python3.13
            ├── collections
            ├── encodings
            ├── importlib
            ├── logging
            ├── re
            └── site-packages
                ├── _distutils_hack
                ├── icoextract
                │   └── scripts
                ├── ordlookup
                └── PIL

As far as I could see, all the files and directories, in your example at least, are part of the python package
(python-3.13.2-1 in my Xfce4 system, Manjaro stable branch)

There are two more directories, presumably from previous python versions:

ls -d /usr/lib/python3.1*
/usr/lib/python3.11  /usr/lib/python3.12  /usr/lib/python3.13

They are pretty much empty and nothing gets created just by visiting them with Thunar. :man_shrugging:

So, from my observations:
… no, it doesn’t do that

That would be very very unusual - something changing in /usr just by navigating there.

I would not consider removing anything from /usr without going through pacman a good idea.

No, it doesn’t do anything to /usr/.... What I listed is the contents of the “pyhton” dir that gets created. For example (just for example: like I said, this behavior is observed in many other directories too) I navigate in Thunar to /mnt/Data/Distribs/Drivers/, where I keep different drivers for my Windows machines. Upon opening it, Thunar creates in addition to the many directories that are already there an extra directory named “python”. And that directory contains the content that I have given in the first post:

.
└── usr
    └── lib
        └── python3.13
            ├── collections
            ├── encodings
            ├── importlib
            ├── logging
            ├── re
            └── site-packages
                ├── _distutils_hack
                ├── icoextract
                │   └── scripts
                ├── ordlookup
                └── PIL

Again, this is the content of /mnt/Data/Distribs/Drivers/python.

Looks like you installed something like icoextract

It seems to be a thumbnailer, which is started in some folders. It has nothing to do which Thunar. However, Thunar triggers tumbler which choses this thumbnailer plugin to generate thumbnails. The icoextract thumbnailer then will create this python folder structure.

1 Like

/mnt is normally owned by root - a user owned process like Thunar can’t create anything there - or: should not be able to

To /mnt you have perhaps mounted another file system?
And presumably have adapted permissions so that your user can write there?

I can’t replicate what you describe anywhere - not in my /home and not under /mnt or anywhere else.

What @xabbu said sounds plausible.

Do you have icoextract installed, enabled it as a tumbler plugin and a matching file in a folder you have write access to? Otherwise you can’t replicate it.

1 Like

… nah - I’ll leave that to the OP :wink:

1 Like

As already pointed out by @xabbu the behaviour is caused by a thirdparty script.

I understand that you get confused - and it may or may not have been intended by the creator.

Please create an issue with the creator of the thumbnailer script.

1 Like

Yes, I had icoextract installed, but only as a dependency for Bottles, and have not fiddled with icoextract specifically. Just in case I removed it and restarted the machine, and it partially resolved the issue: the python dir has stopped being created while browsing directories.

Only now I have noticed that in my home directory “python” dir gets created not only when I open it in Thunar, but when I launch many of the apps written in Python. But that’s another issue.

Okay, the issue with the “python” dir being created in the home dir was due to my own eff-up of accidentally setting wrong python-related environment variables for systemd, which I could not see when I was checking it with printenv, since systemd runs in a different context. This was also responsible for the icoextract creating python dirs when browsing directories with exe files in them: after I addressed the issue with the systemd variables, I reinstalled icoextract and now it does not create any unneeded directories.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.