Skip to content
Snippets Groups Projects
  1. Oct 26, 2024
  2. Oct 24, 2024
  3. Oct 25, 2024
    • Matt Harbison's avatar
      wireprototypes: fix exception handling code with a bad pytype suppression · 5ad5f0853a0a
      Matt Harbison authored
      This goes back to f5fcf7123a92, and I suspect it was a misread of the error
      message is describes- the LHS of `.sorted()` is always bytes, and bytes didn't
      have this method in py2 either.  The invalid names were already handled like
      this a few lines above.
      
      PyCharm flagged this, and it stood out after converting the zope interfaces to
      Protocol classes (which hasn't been published yet).
      5ad5f0853a0a
  4. Jan 11, 2024
  5. Jul 22, 2024
  6. Jun 27, 2023
    • kiilerix's avatar
      utils: avoid using internal _imp.is_frozen() · c5d6a66092e8
      kiilerix authored
      imp has been deprecated for a long time, and were removed in Python 3.12 . As a
      workaround, we started using the internal _imp. That is ugly and risky.
      
      It seems less risky to get the functionality in some other way. Here, we just
      inspect if 'origin' of the '__main__' module is set and 'frozen'. That seems to
      work and do the same, and might be better than using the internal _imp
      directly.
      
      This way of inspecting module attributes seems to work in some test cases, but
      it is a risky change. This level of importlib doesn't have much documentation,
      a complicated implementation, and we are dealing with some odd use cases.
      c5d6a66092e8
  7. Jan 11, 2024
    • kiilerix's avatar
      cext: use sys.executable instead of deprecated Py_GetProgramFullPath · 5ac506ee6690
      kiilerix authored
      Fix warning with Python 3.13:
      
          mercurial/cext/parsers.c: In function 'check_python_version':
          mercurial/cext/parsers.c:1243:30: warning: 'Py_GetProgramFullPath' is deprecated [-Wdeprecated-declarations]
           1243 |                              Py_GetProgramFullPath());
                |                              ^~~~~~~~~~~~~~~~~~~~~
          In file included from /usr/include/python3.13/Python.h:119,
                           from mercurial/cext/parsers.c:11:
          /usr/include/python3.13/pylifecycle.h:43:43: note: declared here
             43 | Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
                |                                           ^~~~~~~~~~~~~~~~~~~~~
      
      At this point in time, the PyConfig struct memory has been released and the PyConfig API can't be used.
      
      https://docs.python.org/3.13/c-api/init.html#c.Py_GetProgramFullPath recommands
      using sys.executable instead. Let's assume that will work in all versions.
      
      It would perhaps be better to use PySys_GetObject, but I prefer to stay
      consistent with how the same function is retrieving sys.hexversion.
      5ac506ee6690
    • kiilerix's avatar
      subrepoutil: pass re.sub 'count' argument by name · c6e4fec01775
      kiilerix authored
      Python 3.13 started warning:
      
        DeprecationWarning: 'count' is passed as positional argument
      c6e4fec01775
    • kiilerix's avatar
      tests: pass re.MULTILINE to re.sub as 'flags' - not in 'count' position · 4fbee56e854a
      kiilerix authored
      This bug was caught by the new Python 3.13 warning:
      
        DeprecationWarning: 'count' is passed as positional argument
      4fbee56e854a
  8. Jun 29, 2023
    • kiilerix's avatar
      tests: use packaging from setuptools instead of deprecated distutils · a26a05199070
      kiilerix authored
      When invoking StrictVersion in 3.12 we got:
          DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      
      distutils is dead in the standard library, and we have to move towards using
      `setuptools` as general extern dependency. Instead of also requiring the extern
      `packaging`, we will just use the packaging that is vendored in setuptools.
      a26a05199070
  9. Jun 26, 2023
    • kiilerix's avatar
      tests: drop test-demandimport.py distutils test that failed with warnings · f38be04f9616
      kiilerix authored
      The test would fail because warnings:
        /usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
          warnings.warn(
        /usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
          warnings.warn("Setuptools is replacing distutils.")
      
      The test for distutils.msvc9compiler comes from 2205d00b6d2b. But since then,
      distutils is going away, and this test must change somehow. It is unclear exactly
      how setuptools depended on msvc9compiler, but setuptools also moved forward,
      and this exact test no longer seems relevant. It thus seems like a fair
      solution to remove the test while keeping the demandimport blacklist of
      distutils.msvc9compiler.
      f38be04f9616
  10. Jun 29, 2023
  11. Oct 25, 2024
  12. Oct 24, 2024
    • Raphaël Gomès's avatar
      zope-interface: add compatibility with 3.13 compiler attributes · 7862a5ac35cf
      Raphaël Gomès authored
      We could follow-up with an actual vendoring update from the newest version
      of zope-interface in the new cycle since we're dropping 3.7 and down.
      
      However we are also in the process of replacing zope-interface with Protocol, so
      hopefully we can simply drop the zope-interface vendoring.
      7862a5ac35cf
    • Raphaël Gomès's avatar
      0b17a0578a48
    • Raphaël Gomès's avatar
      py-3-13: stabilize the docstring output across all supported Python versions · 51057ab0dffa
      Raphaël Gomès authored
      Python 3.13 now trims indents from docstrings at compilation time
      (to save space in .pyc), so all of our helptext is affected.
      The indentation has never served a user-facing purpose and was more here
      because nobody cared enough to remove it: we gain some screen space this way.
      Rather than undo the transformation (which isn't really possible since the
      transform also deletes leading/trailing whitespace), we align the behavior
      of older Python versions with that of 3.13.
      
      Unfortunately, this means breaking some of the translations. I've only
      touched the ones that need to work for some tooling tests to pass, but
      I do not have the time to fix the rest of them across all languages, since
      they cannot be done in an automated way. i18n updates have been basically
      abandonned for a good while now, hopefully someone cares enough to bring them
      back.
      51057ab0dffa
    • Raphaël Gomès's avatar
      test-lfs-serve-access: vastly simplify the error output check · 888e00b2c3ee
      Raphaël Gomès authored
      The traceback differences between all supported Python versions is about to
      become insane to handle, so let's check what we're actually looking to check.
      888e00b2c3ee
  13. Mar 31, 2024
    • Felipe Resende's avatar
      subrepo: propagate non-default path on outgoing · fb15ba66c702
      Felipe Resende authored
      There was already a fix made in 5dbff89cf107 for pull and push commands. I did
      the same for the outgoing command.
      
      The problem I identified is that when the parent repository has multiple paths,
      the outgoing command was not respecting the parent path used and was always
      using the default path for subrepositories.
      fb15ba66c702
  14. Oct 24, 2024
  15. Jun 11, 2024
  16. Oct 23, 2024
  17. Oct 16, 2024
  18. Oct 14, 2024
  19. Oct 15, 2024
  20. Oct 07, 2024
    • kiilerix's avatar
      hgdemandimport: add collections.abc to the ignore list because Python 3.13 rc3 · 141ed0bf72a1
      kiilerix authored
      It worked in Python 3.13 rc2, but something changed for rc3.
      
      Now, when i18n.py imports typing and it touches collections.abc.Hashable , we
      get:
      
        ValueError: module object for collections.abc substituted in sys.modules during a lazy load
      
      This seems to be a general problem, released in the final Python 3.13 . I have
      not analyzed the problem in details.
      
      We *could* work around the problem by disabling demand import of typing. But
      that would effectively disable demand import of collections.abc too. Instead,
      just disable demand import for collections.abc .
      141ed0bf72a1
  21. Oct 08, 2024
  22. Sep 27, 2024
  23. Sep 17, 2024
  24. Sep 11, 2024
  25. Sep 10, 2024
  26. Sep 05, 2024
Loading