← Back to team overview

python-jenkins-developers team mailing list archive

[Bug 1762361] [NEW] reconfig_job 'bytes' object has no attribute 'encode'

 

Public bug reported:

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.

** Affects: python-jenkins
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Python
Jenkins Developers, which is subscribed to Python Jenkins.
https://bugs.launchpad.net/bugs/1762361

Title:
  reconfig_job 'bytes' object has no attribute 'encode'

Status in Python Jenkins:
  New

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 manage notifications about this bug go to:
https://bugs.launchpad.net/python-jenkins/+bug/1762361/+subscriptions