Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decode bytes when formatting them as strings
USDTProbe objects (and USDTProbeArguments and USDTProbeLocations) are instantiated with data that's sourced from libccc calls. That means that their attributes are bytes-typed, not string-typed. When a bytes-typed value is rendered into a string with Python's '%s' formatting directive, it gets a wrapped in single quotes and prefixed with b. For example, b'probe-location'. This is visually noisy, but also breaks some tool behavior which uses string-formatted values for stuff like filters. This is only an issue in Python 3. In Python 2, the bytes type is just an alias for the string type, and so byte sequences from libcc were implicitly decoded as ASCII text.
- Loading branch information