reconfig_job 'bytes' object has no attribute 'encode'

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

Bug Description

Hi,
My python development environment:

Python-jenkins: 0.4.16
Python: 3.6.4

When i am using reconfig_job, i got a failure.(but i use python 2.7, it's ok. )

The error message:
WARNING 'bytes' object has no attribute 'encode'

This error occurred on :

    def reconfig_job(self, name, config_xml):
        '''Change configuration of existing Jenkins job.

        To create a new job, see :meth:`Jenkins.create_job`.

        :param name: Name of Jenkins job, ``str``
        :param config_xml: New XML configuration, ``str``
        '''
        folder_url, short_name = self._get_job_folder(name)
        reconfig_url = self._build_url(CONFIG_JOB, locals())
        self.jenkins_open(Request(reconfig_url, config_xml.encode('utf-8'),
                                  DEFAULT_HEADERS))

When i delete "encode('utf-8')", it's ok.

However, I can't use pip to install Python-jenkins.

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.