Closed Bug 1924022 Opened 1 year ago Closed 1 year ago

TypeError: urlopen() got an unexpected keyword argument 'cafile'

Categories

(Firefox Build System :: Bootstrap Configuration, defect)

defect

Tracking

(firefox-esr128 fixed, firefox133 fixed)

RESOLVED FIXED
133 Branch
Tracking Status
firefox-esr128 --- fixed
firefox133 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(2 files, 1 obsolete file)

The bootstrap tasks (they run bootstrap and build) fail on fedora 41 and 42, which have already upgraded to python 3.13.

Error running mach:
    mach --no-interactive bootstrap --application-choice browser
The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke ``./mach busted`` to check if this issue is already on file. If it
isn't, please use ``./mach busted file bootstrap`` to report it. If ``./mach busted`` is
misbehaving, you can also inspect the dependencies of bug 1543241.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
TypeError: urlopen() got an unexpected keyword argument 'cafile'
  File "/mozilla-unified/python/mozboot/mozboot/mach_commands.py", line 50, in bootstrap
    bootstrapper.bootstrap(command_context.settings)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mozilla-unified/python/mozboot/mozboot/bootstrap.py", line 455, in bootstrap
    self.instance.ensure_rust_modern()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/mozilla-unified/python/mozboot/mozboot/base.py", line 633, in ensure_rust_modern
    self.install_rust()
    ~~~~~~~~~~~~~~~~~^^
  File "/mozilla-unified/python/mozboot/mozboot/base.py", line 702, in install_rust
    http_download_and_save(url, rustup_init, checksum)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mozilla-unified/python/mozboot/mozboot/util.py", line 37, in http_download_and_save
    f = urlopen(url, cafile=certifi.where())

The urlopen documentation for python 3.13 says:

Changed in version 3.13: Remove cafile, capath and cadefault parameters: use the context parameter instead.

The context parameter was added to python 3.4.3, so we can safely switch.

Assignee: nobody → mh+mozilla

The latter was removed in python 3.13.

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::Bootstrap Configuration' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Bootstrap Configuration
Component: Bootstrap Configuration → General
Component: General → Bootstrap Configuration
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/d369655cf80a Use urlopen's context parameter instead of cafile. r=firefox-build-system-reviewers,jcristau,ahochheiden
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch

The latter was removed in python 3.13.

Original Revision: https://phabricator.services.mozilla.com/D225318

Attachment #9430940 - Flags: approval-mozilla-esr128?

The latter was removed in python 3.13.

Original Revision: https://phabricator.services.mozilla.com/D225318

Attachment #9430941 - Flags: approval-mozilla-esr128?
Attachment #9430940 - Attachment is obsolete: true
Attachment #9430940 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128-

esr128 Uplift Approval Request

  • User impact if declined: Failure do build with python 3.13 downstream or for local developers
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: N/A
  • Risk associated with taking this patch: Low
  • Explanation of risk level: Build only
  • String changes made/needed: N/A
  • Is Android affected?: no
Attachment #9430941 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: