Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue13072] Getting a buffer from a Unicode array uses invalid format

 

 

First page Previous page 1 2 Next page Last page  View All Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Aug 10, 2012, 11:33 PM

Post #26 of 40 (326 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Georg Brandl added the comment:

Deferring.

----------
priority: release blocker -> deferred blocker

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 11, 2012, 2:43 AM

Post #27 of 40 (331 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Martin v. Löwis added the comment:

Is there anything that still needs to be done on this issue? ISTM that the code is correct as it stands (i.e. Getting a buffer now only uses valid format codes)

----------
nosy: +loewis

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 11, 2012, 12:16 PM

Post #28 of 40 (328 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Nick Coghlan added the comment:

There's still work to be done. The current status in 3.3 trunk is that:

Wide build:
>>> memoryview(array("u")).format
'w'

Narrow build:
>>> memoryview(array("u")).format
'u'

Neither of these are valid struct formats, thus they don't play nicely with the assumptions of memoryview (or any other PEP 3118 consumer). Stefan's memoryview changes are needed because there are *valid* struct formats that memoryview doesn't understand (yet), but it's only coincidental that they will reduce the severity of this problem.

Victor's latest patch switches the 'w' and 'u' for the appropriate integer sizes 'I' and 'H' which I think is an excellent approach.

There are also the post-reversion documentation changes Georg requested to bring the docs back into line with PEP 393

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 11, 2012, 1:07 PM

Post #29 of 40 (328 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Martin v. Löwis added the comment:

> Wide build:
>>>> memoryview(array("u")).format
> 'w'
>
> Narrow build:
>>>> memoryview(array("u")).format
> 'u'
>
> Neither of these are valid struct formats, thus they don't play
> nicely with the assumptions of memoryview (or any other PEP 3118
> consumer).

Why do you say that? They have been added by PEP 3118 (and are
just not implemented in the struct module yet).

If you think that their mentioning in PEP 3118 is a mistake,
and they should not get implemented in struct, we should
a) get consensus on that interpretation of the PEP, and
b) actually remove them from the PEP, since otherwise it
is very confusing that they keep being mentioned.
I believe that the addition of these codes was fully
intended by the PEP author, and also part of its acceptance.

If these codes are indeed meant to be in the struct module,
this usage in the array module looks right to me - hence
my proposal to close the issue (the documentation problem
aside).

I agree that it is then desirable that the memoryview object
supports the codes. However, this is separate issue from this
one (as the codes are not invalid, just unsupported).

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 16, 2012, 3:41 AM

Post #30 of 40 (328 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Nick Coghlan added the comment:

Adding a link to #15625, which is discussing the other end of this issue (whether or not memorview should support 'u' as a typecode).

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 16, 2012, 4:46 AM

Post #31 of 40 (329 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Martin v. Löwis added the comment:

Based on the discussion in #15625, it seems that the consensus is to take no action on the format codes in this issue for 3.3, and reconsider in 3.4, to determine in what way the struct module should support Unicode.

Instead, the 'u' array code will be deprecated, in the same way in which the rest of the Py_UNICODE API is deprecated.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 19, 2012, 4:00 AM

Post #32 of 40 (336 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Changes by Georg Brandl <georg [at] python>:


----------
priority: deferred blocker -> release blocker

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 19, 2012, 4:26 AM

Post #33 of 40 (324 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Stefan Krah added the comment:

If everyone agrees on deprecating 'u', here's a patch. I think
that should be sufficient to close this issue (unless we absolutely
need deprecation warnings).

----------
Added file: http://bugs.python.org/file26892/array_deprecate_u.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 19, 2012, 4:49 AM

Post #34 of 40 (332 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Antoine Pitrou added the comment:

> If everyone agrees on deprecating 'u', here's a patch. I think
> that should be sufficient to close this issue (unless we absolutely
> need deprecation warnings).

I think a proper deprecation warning is preferable.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 19, 2012, 5:59 AM

Post #35 of 40 (325 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Nick Coghlan added the comment:

I guess the analogy with bytes objects is that UCS-2 code points can be
handled as 16-bit integer objects.

If we're going to do a programmatic deprecation now, that's the only
alternative typecode currently available. Do we want to recommend that? Or
do we want to postpone programmatic deprecation until we add a 2-byte code
point type code for 3.4?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 19, 2012, 6:14 AM

Post #36 of 40 (324 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Antoine Pitrou added the comment:

> I guess the analogy with bytes objects is that UCS-2 code points can be
> handled as 16-bit integer objects.
>
> If we're going to do a programmatic deprecation now, that's the only
> alternative typecode currently available. Do we want to recommend that? Or
> do we want to postpone programmatic deprecation until we add a 2-byte code
> point type code for 3.4?

I don't understand. If you want to handle 16-bit integers, you already
have the "h" and "H" type codes.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 19, 2012, 7:07 AM

Post #37 of 40 (328 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Stefan Krah added the comment:

Since actual removal is only scheduled for 4.0, I think user warnings
can wait until 3.4.

By then, we should have sorted out the struct format codes. In this
scenario we would be sort of forced to use 'C', 'U' and 'W' as the
new codes, while 'u' and 'w' would continue to linger in the array
module for a while.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 24, 2012, 7:48 AM

Post #38 of 40 (330 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Martin v. Löwis added the comment:

Stefan, your patch array_deprecate_u.diff is fine. If you get to it, please also rephrase the clause "Python's unicode type"; not sure what the convention is to refer to Py_UNICODE now (perhaps "historical unicode type").

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 24, 2012, 11:18 AM

Post #39 of 40 (323 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Roundup Robot added the comment:

New changeset 9c7515e29219 by Stefan Krah in branch 'default':
Issue #13072: The array module's 'u' format code is now deprecated and
http://hg.python.org/cpython/rev/9c7515e29219

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 24, 2012, 11:22 AM

Post #40 of 40 (323 views)
Permalink
[issue13072] Getting a buffer from a Unicode array uses invalid format [In reply to]

Stefan Krah added the comment:

Good, I think this can be closed then.

----------
resolution: -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
type: -> behavior

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

First page Previous page 1 2 Next page Last page  View All Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.