utilities/api.py uses the wrong comparison operator in a few cases #3361

Closed
opened 2025-12-29 18:28:18 +01:00 by adam · 3 comments
Owner

Originally created by @ebusto on GitHub (Feb 21, 2020).

Environment

  • Python version: 3.8
  • NetBox version: 2.7.7

Steps to Reproduce

Start NetBox with Python 3.8 or newer.

Expected Behavior

No warnings.

Observed Behavior

Python emits the following warnings.

/opt/netbox/netbox/utilities/api.py:94: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if obj is '':
/opt/netbox/netbox/utilities/api.py:109: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if data is '':
Originally created by @ebusto on GitHub (Feb 21, 2020). # Environment * Python version: 3.8 * NetBox version: 2.7.7 ### Steps to Reproduce Start NetBox with Python 3.8 or newer. ### Expected Behavior No warnings. ### Observed Behavior Python emits the following warnings. ``` /opt/netbox/netbox/utilities/api.py:94: SyntaxWarning: "is" with a literal. Did you mean "=="? if obj is '': /opt/netbox/netbox/utilities/api.py:109: SyntaxWarning: "is" with a literal. Did you mean "=="? if data is '': ```
adam closed this issue 2025-12-29 18:28:18 +01:00
Author
Owner

@kobayashi commented on GitHub (Feb 21, 2020):

Thank you for submitting your issue. NetBox does not support python 3.8 right now. Please try version 3.5 or 3.6 for now.

@kobayashi commented on GitHub (Feb 21, 2020): Thank you for submitting your issue. NetBox does not support python 3.8 right now. Please try version 3.5 or 3.6 for now.
Author
Owner

@ebusto commented on GitHub (Feb 21, 2020):

This isn't an incompatibility. Rather, Python 3.8 is informing the developer that they used the wrong operator. This is a trivial fix, so why not do the right thing?

@ebusto commented on GitHub (Feb 21, 2020): This isn't an incompatibility. Rather, Python 3.8 is informing the developer that they used the wrong operator. This is a trivial fix, so why not do the right thing?
Author
Owner

@jeremystretch commented on GitHub (Feb 21, 2020):

Official support for Python 3.8 is being discussed elsewhere (see #4229), but aside from that I don't think we need bug reports for warning messages. They will be identified and addressed as needed through the course of development.

@jeremystretch commented on GitHub (Feb 21, 2020): Official support for Python 3.8 is being discussed elsewhere (see #4229), but aside from that I don't think we need bug reports for warning messages. They will be identified and addressed as needed through the course of development.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3361