[ python-Bugs-989338 ] test_unicode_file fails on win2k

SourceForge.net noreply at sourceforge.net
Fri Oct 15 08:14:54 CEST 2004


Bugs item #989338, was opened at 2004-07-12 13:11
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=989338&group_id=5470

Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Miki Tebeka (tebeka)
Assigned to: Nobody/Anonymous (nobody)
Summary: test_unicode_file fails on win2k

Initial Comment:
>>> test_support.verbose = 1
>>> test_unicode_file.test_main()
test_directories
(test.test_unicode_file.TestUnicodeFiles) ... ERROR
test_equivalent_files
(test.test_unicode_file.TestUnicodeFiles) ... ERROR
test_single_files
(test.test_unicode_file.TestUnicodeFiles) ... ERROR

======================================================================
ERROR: test_directories
(test.test_unicode_file.TestUnicodeFiles)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"C:\apps\Python24\lib\test\test_unicode_file.py", line
178, in test_directories
    self._do_directory(TESTFN_ENCODED+ext,
TESTFN_ENCODED+ext, True)
  File
"C:\apps\Python24\lib\test\test_unicode_file.py", line
112, in _do_directory
    os.mkdir(make_name)
OSError: [Errno 22] Invalid argument: '@test-??.dir'

======================================================================
ERROR: test_equivalent_files
(test.test_unicode_file.TestUnicodeFiles)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"C:\apps\Python24\lib\test\test_unicode_file.py", line
170, in test_equivalent_files
    self._test_equivalent(TESTFN_ENCODED, TESTFN_UNICODE)
  File
"C:\apps\Python24\lib\test\test_unicode_file.py", line
154, in _test_equivalent
    f = file(filename1, "w")
IOError: [Errno 2] No such file or directory: '@test-??'

======================================================================
ERROR: test_single_files
(test.test_unicode_file.TestUnicodeFiles)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"C:\apps\Python24\lib\test\test_unicode_file.py", line
164, in test_single_files
    self._test_single(TESTFN_ENCODED)
  File
"C:\apps\Python24\lib\test\test_unicode_file.py", line
136, in _test_single
    f = file(filename, "w")
IOError: [Errno 2] No such file or directory: '@test-??'

----------------------------------------------------------------------
Ran 3 tests in 0.061s

FAILED (errors=3)

Traceback (most recent call last):
  File "<pyshell#21>", line 1, in -toplevel-
    test_unicode_file.test_main()
  File
"C:\apps\Python24\lib\test\test_unicode_file.py", line
191, in test_main
    run_suite(suite)
  File "C:\apps\Python24\lib\test\test_support.py",
line 274, in run_suite
    raise TestFailed(msg)
TestFailed: errors occurred; run in verbose mode for
details
>>> 

This is Python2.4a1 on win2k pro

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2004-10-15 08:14

Message:
Logged In: YES 
user_id=21627

In control panel/regional settings, change the first *and*
the third tab to English. This requires a reboot.

The failure itself is harmless. test_support assumes that 

TESTFN_UNICODE = unicode("@test-\xe0\xf2", "latin-1")

is a filename that can be represented in the default file
encoding. On Windows, if the default file encoding is not
CP-1252 (as it is in the Western European installations),
this file name cannot be represented correctly in "mbcs".

To fix this, we would need to come up with procedure to
generate a file name depending on the locale. Unfortunately,
such a procedure is very difficult to implement.

----------------------------------------------------------------------

Comment By: Miki Tebeka (tebeka)
Date: 2004-10-14 10:59

Message:
Logged In: YES 
user_id=358087

How do I switch my locale to English on winXP pro?

----------------------------------------------------------------------

Comment By: Anthony Baxter (anthonybaxter)
Date: 2004-10-13 17:31

Message:
Logged In: YES 
user_id=29957

Sounds like a locale thing - do the people seeing the bug
have the problem if they switch their locale to english?


----------------------------------------------------------------------

Comment By: Marek Baczynski (imbaczek)
Date: 2004-09-17 01:30

Message:
Logged In: YES 
user_id=838849

I have the very same errors as quiver on WinXP SP1, Python
2.4a3, NTFS, locale Polish.

----------------------------------------------------------------------

Comment By: George Yoshida (quiver)
Date: 2004-09-07 16:37

Message:
Logged In: YES 
user_id=671362

I can reproduce this in Python 2.4a3 on Win 2K SP4(locale is 
set to Japanese). File system is NTFS. But on my box, 
test_single_files passes OK. Only test_equivalent_files and 
test_directories raise ERROR.

Here is the result.

test_unicode_file
test_directories (test.test_unicode_file.TestUnicodeFiles) ... 
ERROR
test_equivalent_files 
(test.test_unicode_file.TestUnicodeFiles) ... ERROR
test_single_files (test.test_unicode_file.TestUnicodeFiles) ... 
ok

==============================================
========================
ERROR: test_directories 
(test.test_unicode_file.TestUnicodeFiles)
------------------------------------------------------------
----------
Traceback (most recent call last):
  File "C:\Python24\lib\test\test_unicode_file.py", line 185, in 
test_directories
    self._do_directory(TESTFN_ENCODED+ext, 
TESTFN_UNICODE+ext, True)
  File "C:\Python24\lib\test\test_unicode_file.py", line 114, in 
_do_directory
    os.chdir(chdir_name)
OSError: [Errno 2] No such file or directory: u'@test-\xe0
\xf2.dir'

==============================================
========================
ERROR: test_equivalent_files 
(test.test_unicode_file.TestUnicodeFiles)
------------------------------------------------------------
----------
Traceback (most recent call last):
  File "C:\Python24\lib\test\test_unicode_file.py", line 176, in 
test_equivalent_files
    self._test_equivalent(TESTFN_ENCODED, 
TESTFN_UNICODE)
  File "C:\Python24\lib\test\test_unicode_file.py", line 157, in 
_test_equivalent
    self._do_equivilent(filename1, filename2)
  File "C:\Python24\lib\test\test_unicode_file.py", line 67, in 
_do_equivilent
    os.stat(filename2))
OSError: [Errno 2] No such file or directory: u'@test-\xe0\xf2'

------------------------------------------------------------
----------
Ran 3 tests in 0.070s

FAILED (errors=2)
test test_unicode_file failed -- errors occurred; run in verbose 
mode for details
1 test failed:
    test_unicode_file

----------------------------------------------------------------------

Comment By: Miki Tebeka (tebeka)
Date: 2004-09-07 08:56

Message:
Logged In: YES 
user_id=358087

Yes it does :-(
I have a winXP on IBM T-40.
The other language that is installed is Hebrew.

The problem that when encoding TESTFN_UNICODE with the file
system ecoding (mbcs) the resulted string is "@test-??"
which is not a legal file name on windows

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2004-09-07 08:31

Message:
Logged In: YES 
user_id=80475

Does this still fail for you in Py2.4a3 ?
If not, please note the result and close the bug.

----------------------------------------------------------------------

Comment By: Miki Tebeka (tebeka)
Date: 2004-07-18 08:44

Message:
Logged In: YES 
user_id=358087

File system is NTFS.

winver gives:
Version 5.1 (Build 2600.xpsp2.030422-1633: Service Pack 1)


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2004-07-15 18:55

Message:
Logged In: YES 
user_id=21627

Are you using a FAT partition?

What precise version string do you get in winver.exe?

----------------------------------------------------------------------

Comment By: Miki Tebeka (tebeka)
Date: 2004-07-13 08:10

Message:
Logged In: YES 
user_id=358087

Sorry, I forgot I've upgraded my OS lately. This *is* WinXP Pro.
Any other data I can send?

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2004-07-12 18:35

Message:
Logged In: YES 
user_id=31435

Peculiar -- it works fine on WinXP Pro, which ought to work 
the same as Win2K here.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=989338&group_id=5470


More information about the Python-bugs-list mailing list