autotrash ignores hidden files

Bug #1571160 reported by medontlikemusic
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
autotrash (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

autotrash doesn't remove files/folders that start with an dot (like .foo) from the trash.

Description: Ubuntu 15.10
Release: 15.10

autotrash version: 0.1.5-1.1

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in autotrash (Ubuntu):
status: New → Confirmed
Revision history for this message
Colin Hemming (b-ubuntuone14) wrote :

Still present in Xubuntu 16.04

I'm not greatly experienced with Python and globbing, but this seems to fix it by making two passes; firstly for files without the dot prefix and secondly with the prefix...

--Replace--
for file_name in glob.iglob(os.path.join(trash_info_path, '*.trashinfo')):
...
    files.append(file_info)

--With--
for trash_base in ('*.trashinfo', '.*.trashinfo'):
    for file_name in glob.iglob(os.path.join(trash_info_path, trash_base)):
...
        files.append(file_info)

I've tested this as far as I can, but it would be good for someone more proficient in Python to have a look and verify it.

Revision history for this message
Colin Hemming (b-ubuntuone14) wrote :

I have recently installed a Manjaro machine and installed this from source as it's not in the Manjaro repositories. The code for autotrash has been changed and improved. As a result, this bug is no longer an issue with the latest version. To fix and improve this, the source just needs to be brought up to date in the PPA for Xubuntu!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.