Skip to content

[ENH] Excluding files at root of drive on Windows using wildcard is not working #1031

@ikus060

Description

@ikus060

Bug summary

Using --exclude "*:/pagefile.sys" is not working on Windows.

Version, Python, Operating System

Call rdiff-backup info and replace the following line with the output,
repeat for each environment impacted, especially if using remote operations:

C:\Users\vmtest>rdiff-backup info
---
exec:
  api_version:
    actual: 0
    default: 200
    max: 201
    min: 200
  argv:
  - C:\Python310\Scripts\rdiff-backup
  - info
  parsed: null
  version: 2.2.6
python:
  executable: C:\Python310\python.exe
  name: cpython
  version: 3.10.11
system:
  fs_encoding: utf-8
  platform: Windows-10-10.0.14393-SP0
...

rdiff-backup call

How did you call rdiff-backup, with which parameters:

C:\Users\vmtest>rdiff-backup -v 5 --remote-schema "C:\PROGRA~1\Minarca\MINARC~1\core\openssh\WIN_AM~1\ssh.exe -oBatchMode=yes -oPreferredAuthentications=publickey -p 22222 -oUserKnownHostsFile=C:\Users\vmtest\AppData\Local\minarca\known_hosts -oIdentitiesOnly=yes -i C:\Users\vmtest\AppData\Local\minarca\id_rsa %s 'minarca/6.0.0b12 rdiff-backup/2.2.6 (Windows 10 AMD64)'" backup --no-hard-links --exclude-symbolic-links --create-full-path --no-compression --exclude "*:/pagefile.sys"  --include G:/ --exclude "G:/**" G:/ [email protected]::DESKTOP-4QNNQ86/G/

What happened and what did you expect?

Filter defined as --exclude "*:/pagefile.sys" should exclude file similar to "C:/pagefile.sys" or "D:/pagefile.sys".

More information

It seams there is a bug in _glob_get_prefix_res on 2.2.6 to handle this scenario because the regex pattern generated are [b'[^/]*:', b'[^/]*:/pagefile.sys'], but [^/]*: is not valid because the "drive" letter is C:/ not C:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions