Skip to content

Conversation

dimpase
Copy link
Member

@dimpase dimpase commented Sep 25, 2025

FancyURL has been long deprecated, since Python 3.3.
It's finally gone in 3.14, so we need this to move forward, e.g. on Fedora 43,
as reported on sage-support

This will fix #40886

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@dimpase
Copy link
Member Author

dimpase commented Sep 25, 2025

Downloading works, but uncompressing downloaded tarballs does not work on Python 3.14.

https://mirrors.mit.edu/sage/spkg/upstream/brial/brial-1.2.14.tar.bz2
[......................................................................]
Setting up build directory /home/dp/sage/local/var/tmp/sage/build/brial-1.2.14
Traceback (most recent call last):
  File "/home/dp/sage/build/bin/sage-uncompress-spkg", line 23, in <module>
    run()
    ~~~^^
  File "/home/dp/sage/build/bin/../sage_bootstrap/uncompress/cmdline.py", line 67, in run
    unpack_archive(archive, dirname)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/dp/sage/build/bin/../sage_bootstrap/uncompress/action.py", line 67, in unpack_archive
    archive.extractall(members=archive.names)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dp/sage/build/bin/../sage_bootstrap/uncompress/tar_file.py", line 99, in extractall
    return super(SageBaseTarFile, self).extractall(path=path,
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
                                                   members=members,
                                                   ^^^^^^^^^^^^^^^^
                                                   **kwargs)
                                                   ^^^^^^^^^
  File "/usr/lib64/python3.14/tarfile.py", line 2453, in extractall
    self.chmod(tarinfo, dirpath)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/dp/sage/build/bin/../sage_bootstrap/uncompress/tar_file.py", line 75, in chmod
    tarinfo.mode &= ~self.umask
TypeError: unsupported operand type(s) for &=: 'NoneType' and 'int'
************************************************************************
Error: failed to extract /home/dp/sage/upstream/brial-1.2.14.tar.bz2

Copy link

github-actions bot commented Sep 25, 2025

Documentation preview for this PR (built with commit b197437; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

See https://docs.python.org/3.14/library/tarfile.html#tarfile-extraction-filter

  Changed in version 3.14: The default filter is set to data. Previously,
  the default was equivalent to fully_trusted.
@enriqueartal
Copy link
Contributor

For me, with #40882 and #40892, together with the patches in #40890, both downloading and uncompressing worked with python 3.14; testing now with 3.13 it seems to work also. Something special to be checked?

@dimpase
Copy link
Member Author

dimpase commented Sep 27, 2025

I think this should suffice for a positive review

@dimpase
Copy link
Member Author

dimpase commented Sep 27, 2025

perhaps check with some old Python 3, e.g. 3.8

@enriqueartal
Copy link
Contributor

perhaps check with some old Python 3, e.g. 3.8

I do not have access to systems working with these versions. Is it a problem for a positive review?

@dimpase
Copy link
Member Author

dimpase commented Sep 28, 2025

perhaps check with some old Python 3, e.g. 3.8

I do not have access to systems working with these versions. Is it a problem for a positive review?

Well, I tested with Python 3.8 as a "system" Python. (Actually, using uv, and running the build in an uv-managed venv, with ./configure --with-python3=python3.13, while python3 was 3.8.20). It all worked.
(downloading and untarring, two things affected by this PR)

I think it's good enough, you can turn this to a positive review.

PS. An additional, complete cleanup of these python2/3 old features can be done later.

vbraun pushed a commit to vbraun/sage that referenced this pull request Sep 30, 2025
sagemathgh-40888: replace gone in python3.14 FancyURL
    
FancyURL has been long deprecated, since Python 3.3.
It's finally gone in 3.14, so we need this to move forward, e.g. on
Fedora 43,
as reported on [sage-support](https://groups.google.com/g/sage-
support/c/12GaUYfAbD0/m/1RcOQypjAwAJ)

This will fix sagemath#40886

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#40888
Reported by: Dima Pasechnik
Reviewer(s): Enrique Manuel Artal Bartolo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove the usage of FancyURLopener
2 participants