Deprecation warnings

Bug #1812232 reported by Robie Basak on 2019-01-17
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pastebinit (Debian)
Fix Released
Unknown
pastebinit (Ubuntu)
Status tracked in Eoan
Disco
Medium
Simon Quigley
Eoan
Medium
Simon Quigley

Bug Description

[Impact]

Without this fix, scripts which depend on the output of pastebinit will probably break. It will also confuse the new user, who might think it is their fault, and annoy the experienced user.

[Test Case]

Running this:
$ echo "test" | pastebinit

Should just produce the URL. Not this:
/usr/bin/pastebinit:42: DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5
  release = platform.linux_distribution()[0].lower()
/usr/bin/pastebinit:413: DeprecationWarning: pasteURLopener style of invoking requests is deprecated. Use newer urlopen functions/methods
  url_opener = pasteURLopener()

[Regression Potential]

Little to none. Unless Python itself breaks, the syntax itself should be correct.

[Original Description]

$ dpkg-query -W pastebinit
pastebinit 1.5-2
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Disco Dingo (development branch)
Release: 19.04
Codename: disco
$ echo 'a'|pastebinit
/usr/bin/pastebinit:42: DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5
  release = platform.linux_distribution()[0].lower()
/usr/bin/pastebinit:413: DeprecationWarning: pasteURLopener style of invoking requests is deprecated. Use newer urlopen functions/methods
  url_opener = pasteURLopener()
http://paste.ubuntu.com/p/R4f5RKMWTf/

Expected results: URL output only

Hans Joachim Desserud (hjd) wrote :

Thanks for reporting.

Found a corresponding bug report in Debian, so marking confirmed and attaching bug watch.

tags: added: disco
Changed in pastebinit (Ubuntu):
status: New → Confirmed
Changed in pastebinit (Debian):
status: Unknown → New
Changed in pastebinit (Ubuntu):
importance: Undecided → Low
Changed in pastebinit (Debian):
status: New → Fix Released
Simon Quigley (tsimonq2) on 2019-04-19
description: updated
Changed in pastebinit (Ubuntu Disco):
assignee: nobody → Simon Quigley (tsimonq2)
Changed in pastebinit (Ubuntu Eoan):
assignee: nobody → Simon Quigley (tsimonq2)
Changed in pastebinit (Ubuntu Disco):
importance: Undecided → Medium
Changed in pastebinit (Ubuntu Eoan):
importance: Low → Medium
Changed in pastebinit (Ubuntu Disco):
status: New → In Progress
Changed in pastebinit (Ubuntu Eoan):
status: Confirmed → In Progress
Simon Quigley (tsimonq2) on 2019-04-20
Changed in pastebinit (Ubuntu Eoan):
status: In Progress → Fix Released

An upload of pastebinit to disco-proposed has been rejected from the upload queue for the following reason: "Version isn't lower than eoan (try moving that tilde one word left)".

Hello Robie, or anyone else affected,

Accepted pastebinit into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pastebinit/1.5-2.2~ubuntu0.19.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in pastebinit (Ubuntu Disco):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-disco
Brian Murray (brian-murray) wrote :

Verification done for disco:

Preparing to unpack .../pastebinit_1.5-2.2~ubuntu0.19.04.1_all.deb ...
Unpacking pastebinit (1.5-2.2~ubuntu0.19.04.1) over (1.5-2) ...
Setting up pastebinit (1.5-2.2~ubuntu0.19.04.1) ...
Processing triggers for man-db (2.8.5-2) ...
[ 12:45PM 10049 ] [ bdmurray@impulse:~ ]
 $ echo "test" | pastebinit
https://paste.ubuntu.com/p/94cZvGprMP/

tags: added: verification-done verification-done-disco
removed: verification-needed verification-needed-disco
Unit 193 (unit193) wrote :

Howdy,

While attempting to use this version of pastebinit with the openstack pastebin, it fails and spits out the following error:

 Failed to contact the server: POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str.

As this is a regression, I don't think this should be SRU'd as-is.

Unit 193 (unit193) on 2019-05-14
tags: added: regression-proposed
Brian Murray (brian-murray) wrote :

This isn't a regression in disco as the same error occurs with the version of the package in the release pocket for disco.

[ 9:53AM 10159 ] [ bdmurray@impulse:~ ]
 $ pastebinit -b paste.openstack.org -i /tmp/test.txt
/usr/bin/pastebinit:42: DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5
  release = platform.linux_distribution()[0].lower()
/usr/bin/pastebinit:413: DeprecationWarning: pasteURLopener style of invoking requests is deprecated. Use newer urlopen functions/methods
  url_opener = pasteURLopener()
Traceback (most recent call last):
  File "/usr/bin/pastebinit", line 417, in <module>
    params = json.dumps(params)
  File "/usr/lib/python3.7/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.7/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.7/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.7/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable
[ 9:54AM 10162 ] [ bdmurray@impulse:~ ]
 $ apt-cache policy pastebinit
pastebinit:
  Installed: 1.5-2
  Candidate: 1.5-2
  Version table:
 *** 1.5-2 500
        500 http://192.168.10.7/ubuntu disco/main amd64 Packages
        500 http://192.168.10.7/ubuntu disco/main i386 Packages
        100 /var/lib/dpkg/status

tags: removed: regression-proposed
Brian Murray (brian-murray) wrote :

If openstack.org is an important bin for your pastes please open a new bug report about this issue with pastebinit.

Unit 193 (unit193) wrote :

Howdy,

The problem I described is new as of this SRU, the issue you're hitting is an older one. You can't use -i but must pipe output to pastebinit:

unit193@Sigma:~$ cat popcon_perf2.patch | pastebinit
/usr/bin/pastebinit:42: DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5
  release = platform.linux_distribution()[0].lower()
/usr/bin/pastebinit:414: DeprecationWarning: pasteURLopener style of invoking requests is deprecated. Use newer urlopen functions/methods
  url_opener = pasteURLopener()
http://paste.openstack.org/show/5PwveZ4A1TjJb5YrsyeD

This is with 1.5-2 on disco.

tags: added: regression-proposed verification-failed verification-failed-disco
removed: verification-done verification-done-disco
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.