impossible to download artifacts that are not json-formated
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Jenkins |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
get_build_artifact allows to get artifacts if they are JSON files
but if they are non-json ascii files or binary files it fails
for example run this pipeline:
```
node {
sh '''
echo text > ascii.txt
dd if=/dev/zero of=binary.dat bs=1c count=10
ls -l
cat ascii.txt
cat binary.dat | hexdump
'''
writeJSON file: 'data.json', json: [ 'key': 'val']
archiveArti
archiveArti
archiveArti
}
```
json artifact can be downloaded
```
>>> import jenkins
>>> j = jenkins.Jenkins('http://
>>> data = j.get_build_
>>> print(data)
{'key': 'val'}
```
but not the binary one
```
>>> binary = j.get_build_
Traceback (most recent call last):
File "/workspace/
return json.loads(
File "/Library/
return _default_
File "/Library/
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/
raise JSONDecodeError
json.decoder.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/workspace/
raise JenkinsException(
jenkins.
```
nor the ascii (non-jenkins) one
```
>>> ascii = j.get_build_
Traceback (most recent call last):
File "/workspace/
return json.loads(
File "/Library/
return _default_
File "/Library/
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/
raise JSONDecodeError
json.decoder.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/workspace/
raise JenkinsException(
jenkins.
``
Fix proposed to branch: master /review. opendev. org/c/jjb/ python- jenkins/ +/841640
Review: https:/