Navigation Menu

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

json int encoding incorrect for dbus.Byte #77978

Closed
bradbishop mannequin opened this issue Jun 7, 2018 · 2 comments
Closed

json int encoding incorrect for dbus.Byte #77978

bradbishop mannequin opened this issue Jun 7, 2018 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@bradbishop
Copy link
Mannequin

bradbishop mannequin commented Jun 7, 2018

BPO 33797
Nosy @mdickinson, @ZackerySpytz, @bradbishop, @tirkarthi

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-05-16.07:38:34.267>
created_at = <Date 2018-06-07.16:32:41.266>
labels = ['type-bug', 'library']
title = 'json int encoding incorrect for dbus.Byte'
updated_at = <Date 2020-05-16.07:38:34.266>
user = 'https://github.com/bradbishop'

bugs.python.org fields:

activity = <Date 2020-05-16.07:38:34.266>
actor = 'ned.deily'
assignee = 'none'
closed = True
closed_date = <Date 2020-05-16.07:38:34.267>
closer = 'ned.deily'
components = ['Library (Lib)']
creation = <Date 2018-06-07.16:32:41.266>
creator = 'radsquirrel'
dependencies = []
files = []
hgrepos = []
issue_num = 33797
keywords = []
message_count = 2.0
messages = ['318954', '369015']
nosy_count = 4.0
nosy_names = ['mark.dickinson', 'ZackerySpytz', 'radsquirrel', 'xtreak']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue33797'
versions = ['Python 2.7']

@bradbishop
Copy link
Mannequin Author

bradbishop mannequin commented Jun 7, 2018

JSON does not correctly encode dbus.Byte from dbus-python on 2.7:

dbus.Byte is a subclass of int with its own __str__ implementation.

>>> import json
>>> import dbus
>>> json.dumps(dbus.Byte(0))
'\x00'

On 3.x:

>>> import json
>>> import dbus
>>> json.dumps(dbus.Byte(0))
'0'

This seems to have been fixed in 3.x here:
https://bugs.python.org/issue18264
and subsequently:
https://bugs.python.org/issue26719

I'm interested in backporting these but they are marked as enhancements. However a backport for a similar issue:
https://bugs.python.org/issue27934

was accepted. Would the maintainers be amenable to a backport of 18264 & 26719?

@bradbishop bradbishop mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jun 7, 2018
@ZackerySpytz
Copy link
Mannequin

ZackerySpytz mannequin commented May 16, 2020

Python 2 is EOL, so I think this issue should be closed.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant