Pinta crashes on saving files to directory with non-English letters

Bug #779427 reported by TrenAr on 2011-05-08
42
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Pinta
Medium
Unassigned

Bug Description

Pinta 1.0, WinXP SP3

Bugreport (russian):
System.Reflection.TargetInvocationException: Адресат вызова создал исключение. ---> GLib.GException: Failed to open 'C:\Documents and Settings\TrenAr_2\Рабочий стол\fTest-Pinta.png' for writing: No such file or directory

It's all because russian letters in path. In previous versions Pinta don't open these files. Now it's open, but crashes on saving :(

---

Bugreport (full):
System.Reflection.TargetInvocationException: Адресат вызова создал исключение. ---> GLib.GException: Failed to open 'C:\Documents and Settings\TrenAr_2\Рабочий стол\fTest-Pinta.png' for writing: No such file or directory

   в Gdk.Pixbuf.Save(String filename, String type)

   в Pinta.Core.GdkPixbufFormat.DoSave(Pixbuf pb, String fileName, String fileType) в c:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Core\ImageFormats\GdkPixbufFormat.cs:строка 72

   в Pinta.Core.GdkPixbufFormat.Export(Document document, String fileName) в c:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Core\ImageFormats\GdkPixbufFormat.cs:строка 80

   в Pinta.DialogHandlers.SaveFile(Document document, String file, FormatDescriptor format) в c:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta\DialogHandlers.cs:строка 631

   в Pinta.DialogHandlers.SaveFileAs(Document document) в c:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta\DialogHandlers.cs:строка 596

   в Pinta.DialogHandlers.HandlePintaCoreActionsFileSaveAsActivated(Object sender, EventArgs e) в c:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta\DialogHandlers.cs:строка 152

   --- Конец трассировки внутреннего стека исключений ---

   в System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

   в System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

   в System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

   в System.Delegate.DynamicInvokeImpl(Object[] args)

   в GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)

   в GLib.SignalClosure.Invoke(ClosureInvokedArgs args)

   в GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)

grofaty (grofaty) wrote :

Pinta 1.0 on Windows XP sp3.
1. open new file.
2. draw someting
3. File | Save
4. save a file to non-English letter directory
Pinta crashes.

I can confirm the crash behavior. The same error crash message.

Changed in pinta:
status: New → Confirmed

Can someone test if this occurs on other platforms?

Changed in pinta:
importance: Undecided → Medium
Cameron White (cameronwhite91) wrote :

It worked fine for me on Linux (KDE).

I can't reproduce this exact issue on Windows 7, either with Pinta 1.0 or the latest development build, but I do get some strange stuff happening.
If I try to save within a non-English letter directory, the leading part of the filename is stripped (i.e. "test.jpg" becomes ".jpg" and then the file gets saved in a random directory (not the directory I chose). I don't get a crash, though.

grofaty (grofaty) wrote :

I can reproduce the steps from #1 on Windows XP sp3 using Pinta 1.0. Actually I have found out that saving the file into non-English directory returns error as described in bug report, but clicking on "x" (right top window icon) and Pinta works fine again. So it actually does not crash, just returns this error on saving and unable to save the file.

I have tried steps from #1 on Ubuntu 11.04 adding a Webupd8 repository for Pinta 1.0:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install pinta

The problem does not appear in Ubuntu 11.04.

This may be a platform specific problem or it can be a Gtk# specific. On Windows I am using Gtk# version 2.12.9 as suggested by official Pinta web page: http://pinta-project.com/download.ashx
I have checked Gtk# version on Ubuntu by using command: dpkg -l | grep libgtk | grep sharp (I hope this is correct command to check Gtk# version on Ubuntu) and it is displayed the 2.14.1-1 version.

Don't know what is now recommended version of Gtk# for Pinta, but communicating few months ago with Jonathan Pobst (official Pinta project starter) he suggested to use version on official Pinta web page, because new version of Gtk# at that time had some serious bug that caused some problems in Pinta.

tags: added: windows
Robert Nordan (rpvn) on 2012-04-22
summary: - Pinta crashes on saving
+ Pinta crashes on saving for filenames w/ cyrillic characters
grofaty (grofaty) wrote :

I have tested Pinta v1.4 on Windows XP and problem still persists. Reproduced like in #1. Bug error the same as in bug report: "No such file or directory". So this bug is: if folder name where Pinta tries to save a file includes non-English letters (NOT only cyrillics characters but others non-English letters also) and file name can have English only, Pinta crashes.

Also tested in Pinta v1.4 on Ubuntu 12.04 and no problem. So this bug is Windows specific.

grofaty (grofaty) wrote :

Just a note, if I remember correctly I have read somewhere in the web that Windows saves files in UTF-16 code page format (I could be wrong).

grofaty (grofaty) wrote :

I tested this bug again, steps from #1, and I can confirm this bug is still appearing on Pinta-1.5-preview-20121121 on Windows.

P.S. I have changed the title of bug report, because bug also appears with non-cyrillics but non-English letter as well.

summary: - Pinta crashes on saving for filenames w/ cyrillic characters
+ Pinta crashes on saving files to directory with non-English letters

I just tested this on Windows 7 64 bit and I can't reproduce it. Seems like it is a Win XP only bug.

grofaty (grofaty) wrote :

I retested on pinta-1.5-preview-20130309 on Windows XP. I can't replicate it in the way I have made it in #1 (maybe instructions are not the best, so I am writing it more clear bellow).

@ ealis2001, can you please replicate bellow instructions on Windows 7 (I only have Windows XP).

TEST 1: NON-ENGLISH LATIN CHARACTERS DIRECTORY
1. Open CMD and type in the command:
md c:\šđčćž

2.
a) In Pinta. New image 1000 x 1000 px.
b) Paintbrush and draw something on canvas.
c) From toolbar click on Save button.
d) Type in some file name like: test1.png and click on Save button.
e) File | Close to close an image.
f) Open button from toolbar and select file from path c:\šđčćž\test.png
e) File opens without a problem. So it looks like this bug was at least partially fixed. Now non-English latin characters directory works fine.

TEST 2: CYRILLIC CHARACTERS DIRECTORY
1. Open CMD and type in the command:
md c:\Адресат

2. Repeat step 2 (all of the sub-steps) from above "test 1".
At 2d) I have typed in test1.png (and trying to save in above directory name) and after clicking on Save button I got an error message: "A file name .png already exists. Do you want to replace it?" --> so Pinta does not crash anymore, but file still can't be saved. It eats "file name" name.

Can someone replicate this problem on Windows 7 using the latest development preview pinta-1.5-preview-20130309:
https://docs.google.com/file/d/0Byd1IDWcGH1ORmsyV3pRd3NJLVU/edit (click on Download button).

grofaty (grofaty) wrote :
grofaty (grofaty) wrote :

Retested this problem from #10 on Pinta from master on Windows XP using gtk-sharp-2.12.20.
Problem does not appear anymore. It looks to me that Gtk-sharp upgrade fixed the problem.

Can someone else test #10 on Windows 7 or Windows 8?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers