[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a389700fbc74 by Ronald Oussoren in branch '2.7':
Ensure that plistlib doesn't corrupt deeply nested datastructures
http://hg.python.org/cpython/rev/a389700fbc74

New changeset 6a8cb4875ac6 by Ronald Oussoren in branch '3.3':
Ensure that plistlib doesn't corrupt deeply nested datastructures
http://hg.python.org/cpython/rev/6a8cb4875ac6

New changeset e0c0bcd60033 by Ronald Oussoren in branch 'default':
(3.3->default) Ensure that plistlib doesn't corrupt deeply nested datastructures
http://hg.python.org/cpython/rev/e0c0bcd60033

--
nosy: +python-dev

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-23 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-17 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The tests look good, thanks for writing them.

--

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-16 Thread Mike Milkin

Mike Milkin added the comment:

Adding tests.

--
Added file: http://bugs.python.org/file29894/issue-17357-tests.txt

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The attach patch should fix the issue (but there needs to be a unittest as 
well).

--
Added file: http://bugs.python.org/file29863/issue-17353.txt

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I agree that plistlib shouldn't raise an exception for data that can 
represented as a valid plist file.

I've checked that the Cocoa class for generating plist files will happily 
create a plist file when the data is nested 100 levels deep. In that case 
NSData values generate lines of 12 characters long.



An unrelated issue: PlistWriter.writeValue should treat bytes instances the 
same as Data instances in Python 3. That would be a (small) feature 
enhencement, and hence can only be done for Python 3.4.

--
Added file: http://bugs.python.org/file29862/deeply-nested-plist.py

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-14 Thread Ezio Melotti

Ezio Melotti added the comment:

If possible it would be better to still generate a valid output, possibly by 
limiting the indentation or removing it after a certain point.
However I don't know if there are any restrictions that should be followed 
while generating a plist (What happens if the line is too long? Is the 
indentation required?).

--

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-14 Thread Mike Milkin

Mike Milkin added the comment:

Yep you are correct.
>>>
plistlib.readPlistFromBytes(plistlib.writePlistToBytes({'test': 
plistlib.Data(b'aa')}))
{'test': Data(b'aa')}
>>> plistlib.readPlistFromBytes(plistlib.writePlistToBytes([{'test': 
>>> plistlib.Data(b'aa')}]))
[{'test': Data(b'')}]

I presume we want to raise a ValueError if the indentation is more than the 
maximal line length.

--

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-14 Thread Ezio Melotti

Ezio Melotti added the comment:

On 3.x it's called writePlistToBytes, and it seems to have the same issue.

--
versions:  -Python 3.2

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-04-14 Thread Mike Milkin

Mike Milkin added the comment:

Looks like plistlib.writePlistToString is no loger in the plistlib.

--
nosy: +mmilkin

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-03-11 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
nosy: +ezio.melotti

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-03-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

We should limit the indentation to be less than the maximal line length.

--
assignee:  -> ronaldoussoren
components: +Macintosh
nosy: +ronaldoussoren, serhiy.storchaka
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.2, Python 3.3 -Python 3.5

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-03-04 Thread Jacques Fortier

Jacques Fortier added the comment:

Quick source inspection suggests this is present in the latest version.

--
versions: +Python 3.4, Python 3.5

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-03-04 Thread Jacques Fortier

Jacques Fortier added the comment:

My second print should have been:

print plistlib.writePlistToString({'test': 
plistlib.Data('aa')})

--

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-03-04 Thread Jacques Fortier

New submission from Jacques Fortier:

To reproduce:
import plistlib
print plistlib.writePlistToString([{'test': 
plistlib.Data('aa')}])

Compare to:
print plistlib.writePlistToString({'test': Data('aa')})

It looks like the max line length calculation in the Data class is causing the 
output to be empty once you get nested far enough.

--
components: Library (Lib)
messages: 183496
nosy: jfortier
priority: normal
severity: normal
status: open
title: Plistlib outputs empty data tags when deeply nested
versions: Python 2.7

___
Python tracker 

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