[issue5666] Py_BuildValue("c") should return bytes?

2009-04-03 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Applied the patch in r71107. The issues these depend on can be fixed now.

--
nosy: +benjamin.peterson
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue5666] Py_BuildValue("c") should return bytes?

2009-04-02 Thread STINNER Victor

STINNER Victor  added the comment:

> "C" format, but... it doesn't exist for Py_BuildValue

Ooops, it does exist but it looks that nobody uses it. It's also not 
documented :-( I wrote a new patch:
 - document "C" format for Py_BuildValue (fix also a typo)
 - use "C" format in array and _curses
 - (and leave ocean-city's changes unchanged)

--
Added file: http://bugs.python.org/file13579/py3k_build_value-2.patch

___
Python tracker 

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



[issue5666] Py_BuildValue("c") should return bytes?

2009-04-02 Thread STINNER Victor

STINNER Victor  added the comment:

Let's try grep on py3k:
 grep 'Py_BuildValue("[^"]*c' $(find -name "*.c")

Py_BuildValue("c") is used for:
 - mmap.read_byte() result
 - .getkey() result: this method returns also unicode 
string => your patch breaks getkey()!
 - array.__reduce__(): i don't understand if the patch breaks anything

I think that curses and array should use "C" format, but... it doesn't 
exist for Py_BuildValue. It was maybe forgotten.

--

___
Python tracker 

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



[issue5666] Py_BuildValue("c") should return bytes?

2009-04-02 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue5666] Py_BuildValue("c") should return bytes?

2009-04-02 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

This is related to #5499. PyArg_ParseTuple treats "c" as bytes of 1
length now, but Py_BuildValue still treats "c" as unicode of 1 length.

--
components: Interpreter Core
files: py3k_build_value.patch
keywords: patch
messages: 85184
nosy: ocean-city
priority: release blocker
severity: normal
status: open
title: Py_BuildValue("c") should return bytes?
versions: Python 3.1
Added file: http://bugs.python.org/file13574/py3k_build_value.patch

___
Python tracker 

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