Scratch fails to open some text files

Bug #1167294 reported by Sergey "Shnatsel" Davidoff
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scratch
Fix Released
High
Mario Guerriero

Bug Description

Scratch fails to open some files, probably due to encoding issues. I've attached a sample file that triggers the bug. The file is encoded with Windows-1252 but the Python character detection reports it as ISO-8859-2. Gedit displays the file with some unrecognized symbols, while Scratch simply displays a blank page.

ProblemType: Bug
DistroRelease: elementary OS 0.2
Package: scratch-text-editor 1.1.1+r1014-0+pkg40~precise1 [origin: LP-PPA-elementary-os-daily]
ProcVersionSignature: Ubuntu 3.5.0-27.46~precise1-generic 3.5.7.7
Uname: Linux 3.5.0-27-generic x86_64
ApportVersion: 2.0.1-0ubuntu17.1+elementary3~precise1
Architecture: amd64
CrashDB: scratch_text_editor
Date: Wed Apr 10 15:26:52 2013
ExecutablePath: /usr/bin/scratch-text-editor
GsettingsChanges:

InstallationMedia: elementary OS 0.2 "Luna" - Build amd64 LIVE Binary 20121001-15:16
MarkForUpload: True
ProcEnviron:
 PATH=(custom, no user)
 LANG=ru_RU.UTF-8
 SHELL=/bin/bash
SourcePackage: scratch-text-editor
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :
Changed in scratch:
status: New → Confirmed
importance: Undecided → High
milestone: none → 1.2
assignee: nobody → Mario Guerriero (mefrio-g)
status: Confirmed → Fix Released
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

FYI, if you think http://bazaar.launchpad.net/~elementary-apps/scratch/scratch/revision/1017 is a fix, I have to disappoint you: it breaks encoding detection on filenames with spaces.

NEVER EVER feed aribitrary values to spawn_command_line_* methods!

Changed in scratch:
status: Fix Released → Fix Committed
Changed in scratch:
status: Fix Committed → In Progress
Revision history for this message
Mario Guerriero (mefrio-g) wrote :

I pushed a little workaround but what do you suggest to use instead of spawn_command_line_*? spawn_* does not seem to work for some dark reasons.

Changed in scratch:
status: In Progress → Fix Released
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Fix the dark reasons. spawn_command_line_* is not feasible because it breaks filenames with spaces in them as well as some other, more obscure characters.

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.