"Edit timelog.txt" fails on Windows if space present in path

Bug #328118 reported by Rodrigo Daunoravicius
2
Affects Status Importance Assigned to Milestone
GTimeLog
Fix Released
High
Unassigned

Bug Description

The ~/.gtimelog path in Windows XP expands to something like "C:\Documents and Settings\username\.gtimelog". This breaks the "Edit timelog.txt" feature (it tries to open "C:\Documents").

My current solution on my Windows machine is to add double-quotes around the path string in the MainWindow.on_edit_timelog_activate() method.

This will still work in my Ubuntu and Debian machines, but I'm not sure if it won't break elsewhere. I'm submitting the patch anyway.

 The most cross-platform-safe solution would be to rewrite MainWindow.spawn() to use subprocess.call() instead of os.system(), but this would imply parsing the command strings supplied by the user in gtimelogrc.

Tags: patch
Revision history for this message
Rodrigo Daunoravicius (rodelrod) wrote :
Changed in gtimelog:
importance: Undecided → High
tags: added: patch
Revision history for this message
Marius Gedminas (mgedmin) wrote :

Currently I just committed your patch unmodified, but I'd like to fix it properly.

The shlex module from the standard library could be useful for parsing the user-supplied string.

Changed in gtimelog:
milestone: none → 0.3
status: New → Fix Committed
Changed in gtimelog:
status: Fix Committed → Fix Released
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.