[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-24 Thread wjm251

wjm251 wjm...@gmail.com added the comment:

but why it is forced to encoded to utf-8,
I think it should be encoded by the locale related encodings,not always utf-8,
for example,in GBK locale,it should use GBK to encode the unicode object,right?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10187
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-24 Thread wjm251

wjm251 wjm...@gmail.com added the comment:

oh,you mentioned the PEP 263
but I already set a header like this,you can see the attached test.py
#coding=GBK

why exec choose to use utf-8 not GBK?
GBK is a valid Chinese character  set in python26

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10187
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-24 Thread wjm251

wjm251 wjm...@gmail.com added the comment:

Got that ,
thank you

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10187
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-23 Thread wjm251

New submission from wjm251 wjm...@gmail.com:

windows Xp chinese version

see the attached file, the header was set to GBK,and the file is GBK encoded, 
but why the output was '\xe5\xa4\xa7'(it is utf-8 encoded of Chinese character 
大)

--
components: Library (Lib)
files: test.py
messages: 119482
nosy: wjm251
priority: normal
severity: normal
status: open
title: exec encode unicode to utf-8 str automatically in GBK environment
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file19349/test.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10187
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10187] exec encode unicode to utf-8 str automatically in GBK environment

2010-10-23 Thread wjm251

wjm251 wjm...@gmail.com added the comment:

in windows English Version and ubuntu 10.04(locale is utf-8)
all have the same the behavior,

am I wrong?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10187
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9393] shelve.open/bsddb.hashopen raise Exception'No such file or directory'for Chinese path

2010-07-28 Thread wjm251

New submission from wjm251 wjm...@gmail.com:

Windows XP Simple Chinese Version
in python2.5,Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 
bit (Intel)] on win32
I have a directory D:\你好新建文件夹
my code is as follows: 
#--
temppath = uD:\\你好新建文件夹\\a
import shelve
cache = shelve.open(temppath, 'c')
#--

when use temppath.encode(utf-8),it works,
but in python2.6,temppath can works properly

but I got a Error with such traceback

Traceback (most recent call last):
  File D:\eclipse_workspace\pytest\src\test.py, line 5, in module
cache = shelve.open(temppath, 'c')
  File 
D:\eclipse_workspace\omstarv5r6\linksvn\src\UNPPython\pywindows\Lib\shelve.py,
 line 225, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
  File 
D:\eclipse_workspace\omstarv5r6\linksvn\src\UNPPython\pywindows\Lib\shelve.py,
 line 209, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
  File 
D:\eclipse_workspace\omstarv5r6\linksvn\src\UNPPython\pywindows\Lib\anydbm.py,
 line 83, in open
return mod.open(file, flag, mode)
  File 
D:\eclipse_workspace\omstarv5r6\linksvn\src\UNPPython\pywindows\Lib\dbhash.py,
 line 16, in open
return bsddb.hashopen(file, flag, mode)
  File 
D:\eclipse_workspace\omstarv5r6\linksvn\src\UNPPython\pywindows\Lib\bsddb\__init__.py,
 line 310, in hashopen
d.open(file, db.DB_HASH, flags, mode)
bsddb.db.DBNoSuchFileError: (2, 'No such file or directory')

--
components: Library (Lib)
messages: 111779
nosy: wjm251
priority: normal
severity: normal
status: open
title: shelve.open/bsddb.hashopen raise Exception'No such file or directory'for 
Chinese path
versions: Python 2.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9393
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9394] shelve.open/bsddb.hashopen raise bsddb.db.DBNoSuchFileError: (2, 'No such file or directory') with Chinese Path

2010-07-28 Thread wjm251

New submission from wjm251 wjm...@gmail.com:

Windows XP Simple Chinese Version
in python2.5,Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 
bit (Intel)] on win32
I have a directory D:\你好新建文件夹
my code is as follows: 
#--
temppath = uD:\\你好新建文件夹\\a
import shelve
cache = shelve.open(temppath, 'c')
#--

when use temppath.encode(utf-8),it works,
but in python2.6,temppath can works properly

but I got a Error with such traceback

Traceback (most recent call last):
  File D:\eclipse_workspace\pytest\src\test.py, line 5, in module
cache = shelve.open(temppath, 'c')
  File 
D:\eclipse_workspace\omstarv5r6\linksvn\src\UNPPython\pywindows\Lib\shelve.py,
 line 225, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
  File 
D:\eclipse_workspace\omstarv5r6\linksvn\src\UNPPython\pywindows\Lib\shelve.py,
 line 209, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
  File 
D:\eclipse_workspace\omstarv5r6\linksvn\src\UNPPython\pywindows\Lib\anydbm.py,
 line 83, in open
return mod.open(file, flag, mode)
  File 
D:\eclipse_workspace\omstarv5r6\linksvn\src\UNPPython\pywindows\Lib\dbhash.py,
 line 16, in open
return bsddb.hashopen(file, flag, mode)
  File 
D:\eclipse_workspace\omstarv5r6\linksvn\src\UNPPython\pywindows\Lib\bsddb\__init__.py,
 line 310, in hashopen
d.open(file, db.DB_HASH, flags, mode)
bsddb.db.DBNoSuchFileError: (2, 'No such file or directory')

--
components: Library (Lib)
messages: 111780
nosy: wjm251
priority: normal
severity: normal
status: open
title: shelve.open/bsddb.hashopen raise bsddb.db.DBNoSuchFileError: (2, 'No 
such file or directory') with Chinese Path
type: behavior
versions: Python 2.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9394
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9393] shelve.open/bsddb.hashopen exception with unicode paths

2010-07-28 Thread wjm251

wjm251 wjm...@gmail.com added the comment:

I think it is supposed that unicode paths and GBK encoded str objects will be 
ok in Windows.
But only UTF-8 encoded str can

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9393
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9393] shelve.open/bsddb.hashopen exception with unicode paths

2010-07-28 Thread wjm251

wjm251 wjm...@gmail.com added the comment:

sorry I donot know exactly your meaning,
what does these  mean: s format by et  , z format
and I'm not familiar with the C/C++

do you mean that I can use the attached patch to complie a new Python dll? 
but it seams that in My PC the shelve module always uses bsddbm automaticly, 

can you explains more clearly?

thank you very much
sincerely

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9393
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com