[issue37344] plistlib doesn't skip whitespace in XML format detection

2019-07-14 Thread Ronald Oussoren
Ronald Oussoren added the comment: You can always strip the file yourself :-) Ignoring leading whitespace for XML would be fairly invasive due to the way the code is set up. I'm not set against it, but I'm not in favour of complicating the implementation for an edge case like this.

[issue37344] plistlib doesn't skip whitespace in XML format detection

2019-07-14 Thread Shane G
Shane G added the comment: This issue was created because I ran across a plist like this when parsing entitlements in an IPA. I assume that this happened by some unusual step in the toolchain when building the application. To some other points: * agreed lstrip()ing just the key would not wo

[issue37344] plistlib doesn't skip whitespace in XML format detection

2019-07-14 Thread Ronald Oussoren
Ronald Oussoren added the comment: @shaneg, could you elaborate on why you created this issue? I don't know of tooling that would generate such files, and it is highly unlikely that Apple's system tooling/libraries would do so. -- ___ Python track

[issue37344] plistlib doesn't skip whitespace in XML format detection

2019-07-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: lstrip() would not work with UTF-16 encoded plist files neither with BOM. Who produces plist files with leading whitespaces? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue37344] plistlib doesn't skip whitespace in XML format detection

2019-07-14 Thread Ronald Oussoren
Ronald Oussoren added the comment: I don't agree with calling lstrip() before checking which format is used because leading whitespace is invalid for binary plist files (and plutil agrees with me on that). -- ___ Python tracker

[issue37344] plistlib doesn't skip whitespace in XML format detection

2019-06-20 Thread Prateek Nayak
Change by Prateek Nayak : -- keywords: +patch pull_requests: +14098 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14266 ___ Python tracker ___ __

[issue37344] plistlib doesn't skip whitespace in XML format detection

2019-06-19 Thread Ned Deily
Ned Deily added the comment: Thanks for the report. Would you be interested in providing a pull request with a fix? -- nosy: +ned.deily, ronaldoussoren versions: +Python 3.8, Python 3.9 ___ Python tracker

[issue37344] plistlib doesn't skip whitespace in XML format detection

2019-06-19 Thread Shane G
New submission from Shane G : plistlib in Python 3.7.3 (and earlier) does not autodetect plist data as XML if it contains whitespace before the "https://github.com/python/cpython/blob/3.7/Lib/plistlib.py#L493 -- messages: 346089 nosy: shaneg priority: normal severity: normal status: op