[Mono-bugs] [Bug 72345][Nor] New - System.IO.Path.GetTempPath() raises exception if temp path contains non-ASCII characters

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 8 Feb 2005 11:29:38 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by xschmi01@stud.fit.vutbr.cz.

http://bugzilla.ximian.com/show_bug.cgi?id=72345

--- shadow/72345	2005-02-08 11:29:38.000000000 -0500
+++ shadow/72345.tmp.6776	2005-02-08 11:29:38.000000000 -0500
@@ -0,0 +1,78 @@
+Bug#: 72345
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: xschmi01@stud.fit.vutbr.cz               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.IO.Path.GetTempPath() raises exception if temp path contains non-ASCII characters
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+I run Windows XP SP2 (Czech version). I try to compile and run this simple
+program:
+
+using System;
+using System.IO;
+
+class MainClass
+{
+	public static void Main(string[] args)
+	{
+		string str = Path.GetTempPath();
+		Console.WriteLine(str);
+	}
+}
+
+It works on Microsoft .NET, but raises exception on mono:
+
+"Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+
+in <0x00012> System.IO.Path:GetTempPath ()
+in <0x0000d> temp.MainClass:Main (string[])
+"
+
+It happens only when my TEMP and TMP environment variables are set to path
+containing some czech characters (non-ASCII) (like "c:\&#283;š&#269;"). When I set
+TEMP and TMP to "c:\temp" everything works as expected.
+
+This behaviour is the same for Mono 1.0.5 and 1.1.3 installed from Windows
+installers from official Mono website.
+
+Steps to reproduce the problem:
+1. Set TEMP system environment variable to some directory with some cp-1250
+specific character. 
+2. Compile the code mentioned above.
+3. Run the program.
+
+Actual Results:
+
+Raises exception:
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+
+in <0x00012> System.IO.Path:GetTempPath ()
+in <0x0000d> temp.MainClass:Main (string[])
+
+Expected Results:
+Should print path to temp direcotry, just as MS .NET does.
+
+How often does this happen? 
+Everytime.
+
+Additional Information:
+
+I use FAT32 filesystem, Codepage is windows-1250. I don't know if it
+doesn't work for every non-ASCII character or just for cp-1250.