Option to replace slashes in a tag value

Bug #775271 reported by Lorenz N. Höber
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
pytagsfs
Incomplete
Medium
Unassigned

Bug Description

It would be nice to have an option to replace slashes in a tag value.
This option should include "-o ro" to pretend malicious tag changes.

Revision history for this message
Forest Bond (forest-bond) wrote :

Hi Lorenz,

I guess you are having problems because some of your files have '/' characters in the tag values? What happens with these files?

I think that if pytagsfs is not handling these files well (haven't looked at the code in question yet) it is a bug and so we don't need a new command-line option, we just need to fix the bug. pytagsfs can't really support tag values with slashes in them.

Thanks,
Forest

Changed in pytagsfs:
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Lars Hellemo (hellemo) wrote :

Hi, I had this problem too, the files that have tags with slashes simply don't show up, and it took me a while to figure out why. Automatically using a different character or at least giving a warning would be nice :-)

Revision history for this message
Patrick Fischer (patrick-fischer) wrote :

My simple workaround is this patch

--- /usr/lib/pymodules/python2.6/pytagsfs/sourcetreerep/__init__.py 2014-06-27 13:51:43.821449515 +0200
+++ /tmp/__init__.py 2014-06-27 23:10:12.164954437 +0200
@@ -156,8 +156,6 @@
                 raise UnrepresentablePath(
                   u'fake path would have a path segment with length zero')

+ fake_path_part = fake_path_part.replace(unicode_path_sep, "_")
+
             if unicode_path_sep in fake_path_part:
                 # The tag value has a slash in it. Proceeding would result
                 # in a fake path that has too many levels of directories.

Now all "/" within Tags will be replaced by "_"

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.