[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-08-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-08-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 818f22f9ab02 by Serhiy Storchaka in branch 'default':
Issue #26754: Undocumented support of general bytes-like objects
https://hg.python.org/cpython/rev/818f22f9ab02

--

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-06-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Following patch deprecates the support of bytes-like objects (except bytes 
itself) in PyUnicode_FSDecoder() for consistency with issue26800.

--
dependencies: +Don't accept bytearray as filenames part 2
versions:  -Python 3.5
Added file: 
http://bugs.python.org/file43451/PyUnicode_FSDecoder-deprecate-buffer.patch

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-06-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2e48c2c4c733 by Serhiy Storchaka in branch '3.5':
Issue #26754: PyUnicode_FSDecoder() accepted a filename argument encoded as
https://hg.python.org/cpython/rev/2e48c2c4c733

New changeset e18ac7370113 by Serhiy Storchaka in branch 'default':
Issue #26754: PyUnicode_FSDecoder() accepted a filename argument encoded as
https://hg.python.org/cpython/rev/e18ac7370113

--
nosy: +python-dev

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-06-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch makes PyUnicode_FSDecoder() rejecting arbitrary iterables.

--
assignee:  -> serhiy.storchaka
keywords: +patch
stage:  -> patch review
versions: +Python 3.5
Added file: http://bugs.python.org/file43340/PyUnicode_FSDecoder-no-list.patch

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-04-18 Thread Philip Jenvey

Philip Jenvey added the comment:

See issue26800 for reasoning to go with #4

--
nosy: +pjenvey

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PyUnicode_FSDecoder() is used in following functions in the stdlib:

compile()
symtable.symtable()
parser.compile()
parser.compilest()
zipimporter.zipimporter()
_imp.load_dynamic() (before 3.5)

This is behavior of PyUnicode_FSDecoder() from the start (issue9542). All above 
functions accepted only str in 3.1, thus accepting bytes object and others was 
new feature.

None tests are failed if reject non-str and non-bytes argument in 
PyUnicode_FSDecoder(). But none tests are failed even if disable support of 
bytes argument (there is a lack of tests for bytes path).

What should we do?

1. Add a warning when the argument neither str nor supporting the buffer 
protocol.

2. Drop support of non-str and not supporting the buffer protocol arguments 
without a warning.

3. Drop support of non-str and not supporting the buffer protocol arguments 
without a warning, and add a warning when the argument neither str nor bytes.

4. Drop support of non-str and non-bytes arguments without a warning.

--
nosy: +haypo

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

I agree it is a bit strange. It looks like it is a victim of 
PyBytes_FromObject() doing more than it says; its documentation only mentions 
the buffer protocol, not accepting iterables.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I agree this doens't make sense.

--
nosy: +pitrou

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-04-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

PyUnicode_FSDecoder() accepts not only str and bytes or bytes-like object, but 
arbitrary iterable, e.g. list.

Example:

>>> compile('', [116, 101, 115, 116], 'exec')
 at 0xb6fb1340, file "test", line 1>

I think accepting arbitrary iterables is unintentional and weird behavior.

--
components: Interpreter Core
messages: 263378
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: PyUnicode_FSDecoder() accepts arbitrary iterable
type: behavior
versions: Python 3.6

___
Python tracker 

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