[issue15622] memoryview.to_list() incorrect for 'c' format

2012-08-11 Thread Stefan Krah
Stefan Krah added the comment: Martin v. L??wis wrote: > That the struct module hasn't been updated to support the PEP 3118 is > already reported as issue 3132, please don't confuse the issues. > This issue is about memoryview. No, it isn't. It was always planned to use struct to do the unpacki

[issue15622] memoryview.to_list() incorrect for 'c' format

2012-08-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't know which behaviour is more desirable, but I would consider PEP 3118 a historical document more than a normative spec. Especially when it comes to struct format codes. -- nosy: +pitrou ___ Python tracker <

[issue15622] memoryview.to_list() incorrect for 'c' format

2012-08-11 Thread Martin v . Löwis
Martin v. Löwis added the comment: That the struct module hasn't been updated to support the PEP 3118 is already reported as issue 3132, please don't confuse the issues. This issue is about memoryview. One solution would be to revert the PEPs decision that 'c' is UCS-1. -- title: stru

[issue15622] memoryview.to_list() incorrect for 'c' format

2012-08-11 Thread Stefan Krah
Stefan Krah added the comment: You have rejected the PEP-3118 'u' and 'w' specifiers here: http://mail.python.org/pipermail/python-dev/2012-March/117390.html Otherwise, memoryview follows the existing struct module syntax: http://docs.python.org/dev/library/struct.html#format-characters I

[issue15622] memoryview.to_list() incorrect for 'c' format

2012-08-11 Thread Martin v . Löwis
Martin v. Löwis added the comment: To reproduce: >>> memoryview(array.array('B',b'foo')).cast('c').tolist() [b'f', b'o', b'o'] -- ___ Python tracker ___

[issue15622] memoryview.to_list() incorrect for 'c' format

2012-08-11 Thread Martin v . Löwis
New submission from Martin v. Löwis: PEP 3118 specifies that the 'c'format denotes UCS-1 characters, yet .tolist() converts the memoryview into a list of bytes objects. This is incorrect; it ought to be a list of string objects (as it should for 'u' and 'w' codes). The same holds for item acce