get_jobs() TypeError in py3.7.0 but not in py2.7.12

Bug #1811302 reported by Chris
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python Jenkins
New
Undecided
Unassigned

Bug Description

On both systems I seem to have an active good connection

i.e. I can execute:
server.jobs_count()
and both return 66

but when I try to do:
server.get_jobs('All')

I get a list of 66 dicts on py2, but on py3 I get (i had set s=server already):
In [20]: s.get_jobs('All')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-20-eba0071b4f25> in <module>()
----> 1 s.get_jobs('All')

~/anaconda3/lib/python3.7/site-packages/jenkins/__init__.py in get_jobs(self, folder_depth, folder_depth_per_request, view_name)
    985 else:
    986 return self.get_all_jobs(folder_depth=folder_depth,
--> 987 folder_depth_per_request=folder_depth_per_request)
    988
    989 def get_all_jobs(self, folder_depth=None, folder_depth_per_request=10):

~/anaconda3/lib/python3.7/site-packages/jenkins/__init__.py in get_all_jobs(self, folder_depth, folder_depth_per_request)
   1037 jobs_list.append(job)
   1038 if 'jobs' in job and isinstance(job['jobs'], list): # folder
-> 1039 if folder_depth is None or lvl < folder_depth:
   1040 children = job['jobs']
   1041 # once folder_depth_per_request is reached, Jenkins

TypeError: '<' not supported between instances of 'int' and 'str'

Revision history for this message
Chris (a-chris-w) wrote :

Nevermind! I see that using the named param works on py3

s.get_jobs(view_name='All')

I didn't remember that being a behavioral difference from py2 to py3...(?)

Revision history for this message
Chris (a-chris-w) wrote :

You can close this issue, or convert to a question if it might be helpful to someone else...
Thanks everyone for your work on this project!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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