- Notifications
You must be signed in to change notification settings - Fork673
Closed
Description
Description of the problem, including code/CLI snippet
Idea is to use Gitlab-Python to manage Labels in numerous project in a more scallable way 😅
MWE
# setup gl-pygl=gitlab.Gitlab(GITLAB_ADRESS,private_token=TOKEN,ssl_verify=False)gl.auth()#get the projectsrc_prj=gl.projects.get(SRC_PRJ_ID)# try to serialize the first Label Projectwithopen('data.txt','w')asoutfile:json.dump(src_prj.labels.list(all=True)[0],outfile)
Get the following
Traceback (mostrecentcalllast):File"C:/Users/MPERIN/Git/labelautomation/labelmodel.py",line79,in<module>json.dump(src_prj.labels.list(all=True)[0],outfile)File"C:\Users\MPERIN\AppData\Local\Continuum\miniconda3\envs\labelautomation\lib\json\__init__.py",line179,indumpforchunkiniterable:File"C:\Users\MPERIN\AppData\Local\Continuum\miniconda3\envs\labelautomation\lib\json\encoder.py",line438,in_iterencodeo=_default(o)File"C:\Users\MPERIN\AppData\Local\Continuum\miniconda3\envs\labelautomation\lib\json\encoder.py",line179,indefaultraiseTypeError(f'Object of type{o.__class__.__name__} 'TypeError:Objectof typeProjectLabelisnotJSONserializable
Expected Behavior
The Gilabl-python object are well serialized into JSON
Actual Behavior
The serialization crashes 😒
Specifications
- python-gitlab version: 2.2 (pip)
- API version you are using (v3/v4): v4
- Gitlab server version (or gitlab.com): 11.10.0
Metadata
Metadata
Assignees
Labels
No labels