Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-4454] Remove log statements when parsing invalid PLIST data #4535

Open
swift-ci opened this issue Mar 31, 2017 · 0 comments
Open

[SR-4454] Remove log statements when parsing invalid PLIST data #4535

swift-ci opened this issue Mar 31, 2017 · 0 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-4454
Radar None
Original Reporter ylin (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 1
Component/s Foundation
Labels Improvement, CoreFoundation
Assignee None
Priority Medium

md5: 7e26fbf2abb60b1f3c314edbad299f85

Issue Description:

Sample code:

import Foundation
var str = "ow=01;90:di=01;90"
_ = try? PropertyListSerialization.propertyList(from: str.data(using: .utf8)!, format: nil)

Despite having NO explicit print statements, this code prints out this logging statement:

2017-03-31 09:08:16.758 swift[22119:8ed8f780] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon or value in dictionary on line 1. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolonOrValue to debug.

,IN ADDITION to having an error thrown by `PropertyListSerialization.propertyList(from:, format)`.

Throwing an error should be enough; there is no need to further print a log statement, which is exacerbated by the inability to turn off the logging of said statement. I believe the log statement is coming from this file in CoreFoundation: https://github.com/apple/swift-corelibs-foundation/blob/173e9ea16cf1a0ed9b21cc11ea8a2d15b3f8dca9/CoreFoundation/Parsing.subproj/CFOldStylePList.c

Tested on Swift 3.1 on OSX and Ubuntu 16.04.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant