[Bug 1785821] [NEW] "pastebinit -i file" to paste.openstack.org fails: Object of type 'bytes' is not JSON serializable

Paulo Marcel Coelho Aragão 1785821 at bugs.launchpad.net
Tue Aug 7 13:39:21 UTC 2018


Public bug reported:

pastebinit from a file to paste.openstack.org fails:

paulo:~/tmp$ pastebinit -i /etc/lsb-release -b paste.openstack.org
Traceback (most recent call last):
  File "/usr/bin/pastebinit", line 417, in <module>
    params = json.dumps(params)
  File "/usr/lib/python3.6/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.6/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.6/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.6/json/encoder.py", line 180, in default
    o.__class__.__name__)
TypeError: Object of type 'bytes' is not JSON serializable

It doesn't seem to depend on the file type: I tried with quite a few and
the error was the same each time.

It works as expected when reading from stdin:

paulo:~/tmp$ cat /etc/lsb-release | pastebinit -b paste.openstack.org
http://paste.openstack.org/show/727520

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: pastebinit 1.5-2
ProcVersionSignature: Ubuntu 4.15.0-30.32-generic 4.15.18
Uname: Linux 4.15.0-30-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
CurrentDesktop: XFCE
Date: Tue Aug  7 10:37:10 2018
InstallationDate: Installed on 2018-04-28 (101 days ago)
InstallationMedia: Xubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
PackageArchitecture: all
SourcePackage: pastebinit
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: pastebinit (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug bionic

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to pastebinit in Ubuntu.
https://bugs.launchpad.net/bugs/1785821

Title:
  "pastebinit -i file" to paste.openstack.org fails: Object of type
  'bytes' is not JSON serializable

Status in pastebinit package in Ubuntu:
  New

Bug description:
  pastebinit from a file to paste.openstack.org fails:

  paulo:~/tmp$ pastebinit -i /etc/lsb-release -b paste.openstack.org
  Traceback (most recent call last):
    File "/usr/bin/pastebinit", line 417, in <module>
      params = json.dumps(params)
    File "/usr/lib/python3.6/json/__init__.py", line 231, in dumps
      return _default_encoder.encode(obj)
    File "/usr/lib/python3.6/json/encoder.py", line 199, in encode
      chunks = self.iterencode(o, _one_shot=True)
    File "/usr/lib/python3.6/json/encoder.py", line 257, in iterencode
      return _iterencode(o, 0)
    File "/usr/lib/python3.6/json/encoder.py", line 180, in default
      o.__class__.__name__)
  TypeError: Object of type 'bytes' is not JSON serializable

  It doesn't seem to depend on the file type: I tried with quite a few
  and the error was the same each time.

  It works as expected when reading from stdin:

  paulo:~/tmp$ cat /etc/lsb-release | pastebinit -b paste.openstack.org
  http://paste.openstack.org/show/727520

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: pastebinit 1.5-2
  ProcVersionSignature: Ubuntu 4.15.0-30.32-generic 4.15.18
  Uname: Linux 4.15.0-30-generic x86_64
  ApportVersion: 2.20.9-0ubuntu7.2
  Architecture: amd64
  CurrentDesktop: XFCE
  Date: Tue Aug  7 10:37:10 2018
  InstallationDate: Installed on 2018-04-28 (101 days ago)
  InstallationMedia: Xubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
  PackageArchitecture: all
  SourcePackage: pastebinit
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pastebinit/+bug/1785821/+subscriptions



More information about the foundations-bugs mailing list