Comment 1 for bug 369022

Revision history for this message
Matt Winkelmann (matthias-winkelmann+launchpad) wrote :

There's a patch attached that solves this by escaping single quotes. There are other characters, especially in website titles, that lead to apparently malformed yaml, such as the “ in this page's title. As far as I understand, yaml should work with all unicode characters, therefore the problem might actually be on the server side. A quick fix would be to basically whitelist a standard range of characters (a-Z0-9,[]()!@#$$ etc.) and remove everything else via regex. Using an existing, tested yaml library might be even better.

Anyway, please try the patch attached. I suspect single quotes were responsible for a majority of these failed uploads.

Instructions: save patch in RescueTimeUploader, then patch -o uploader.py uploader.py quotes.diff
Install per README.

Please report back on any changes. Note that old files in /failed will not be corrected.