Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tests run on py3 #398

Merged
merged 48 commits into from
Jan 22, 2020
Merged

Make tests run on py3 #398

merged 48 commits into from
Jan 22, 2020

Commits on Jan 21, 2020

  1. Cleanup: remove gettext functions override

    This was used for live translation, a feature which ceased to exist long
    time ago.
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    bcf95ae View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    571d3e1 View commit details
    Browse the repository at this point in the history
  3. py3: __unicode__ -> __str__

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    6216567 View commit details
    Browse the repository at this point in the history
  4. py3: use except ... as ...

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    da8df5c View commit details
    Browse the repository at this point in the history
  5. py3: use print function

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    ee05d35 View commit details
    Browse the repository at this point in the history
  6. py3: unicode -> str

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    b05729a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    db856cd View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    22ded4e View commit details
    Browse the repository at this point in the history
  9. py3: compare bytes to bytes

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    619b93a View commit details
    Browse the repository at this point in the history
  10. py3: encode str to bytes when writing

    We need to do this because the file has been open in binary mode.
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    471863a View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e8f663d View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    00a32ae View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    6a2fb00 View commit details
    Browse the repository at this point in the history
  14. url_trim: encoding name is 'unicode' as a string

    The `tostring` API only accepts strings, and this didn't break in py2
    because `unicode` exists as a constructor. So while it didn't break, it
    was encoding strings as ASCII.
    
    Refs.
    https://github.com/lxml/lxml/blob/6beef451a6690796d13fc3d2a19321434b880d16/src/lxml/html/__init__.py#L1790-L1793
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    753e575 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    a938dea View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    75654c9 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    2c9ccbb View commit details
    Browse the repository at this point in the history
  18. py3: .next() -> next(...)

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    1c39237 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    8ae732f View commit details
    Browse the repository at this point in the history
  20. py3: string type is now 'str'

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    de492dc View commit details
    Browse the repository at this point in the history
  21. py3: xrange -> range

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    9716203 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    415c2b3 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    f873c1e View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    900238c View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    297fecb View commit details
    Browse the repository at this point in the history
  26. py3: execfile was removed

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    e9e5d02 View commit details
    Browse the repository at this point in the history
  27. py3: func_code -> __code__

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    816a784 View commit details
    Browse the repository at this point in the history
  28. py3: L suffix is not allowed in numeric literals

    int and long are now contained within int.
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    57e1db5 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    bb92c96 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    002d6ce View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    b7a2f3a View commit details
    Browse the repository at this point in the history
  32. py3: drop redundant re.U flag for re.compile

    From the Python docs:
    "for backward compatibility, the re.U flag still exists (as well as its
    synonym re.UNICODE and its embedded counterpart (?u)), but these are
    redundant in Python 3 since matches are Unicode by default for strings"
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    81051c5 View commit details
    Browse the repository at this point in the history
  33. py3: make sure serialization returns bytes

    Previously the `__str__` method would perform the conversion step, and
    the `serialize` method was relying on that behavior. When we merged
    `__unicode__` and `__str__` methods though, that behavior ceased to
    exist.
    
    At the same time, we need to serialize to bytes (which was str in PY2),
    so that change is needed too.
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    7451f09 View commit details
    Browse the repository at this point in the history
  34. py3: open test files in binary mode

    By default, files will be open in text mode under py3 (py2 was str,
    hence bytes). In order to keep the previous behavior, we need to force
    reading to bytes by specifying the extra 'b' flag to `open`.
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    3e01065 View commit details
    Browse the repository at this point in the history
  35. py3: make sure to compare numbers against numbers

    `last_sync_revision` and `source_revision` can be `None`, and in such
    cases comparisons and even logging would fail, because py3 is stricter
    on what operations can be done across data types.
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    b374028 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    3e9c8f4 View commit details
    Browse the repository at this point in the history
  37. py3: filter/map now return iterators

    We convert filter/map to list comprehensions only when we actually need
    a list. No changes have been made in cases where an iterator can be used
    (e.g. for post-processing with `any`, `sorted`, `list`, or just
    iterating).
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    1b2c7e9 View commit details
    Browse the repository at this point in the history
  38. py3: convert keys() and items() to list

    Because now `keys()` and `items()` return iterators, in some cases we
    need to convert them to lists.
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    9394906 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    7e7b4fa View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    0a7a333 View commit details
    Browse the repository at this point in the history
  41. py3: convert QuerySet result to list

    The QuerySet returned by `values()` is not subscriptable, so we need to
    convert it to a list.
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    54f80d0 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    af3b279 View commit details
    Browse the repository at this point in the history
  43. Travis: switch to python 3.7

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    9977130 View commit details
    Browse the repository at this point in the history
  44. Reqs: use pylint 2.4.4

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    5522e69 View commit details
    Browse the repository at this point in the history
  45. py3: logging.warn is deprecated

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    ce94dc8 View commit details
    Browse the repository at this point in the history
  46. py3: fix file io in runner

    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    54bc7fd View commit details
    Browse the repository at this point in the history
  47. Fix SQLite test

    The reported DB name string is different now.
    julen committed Jan 21, 2020
    Configuration menu
    Copy the full SHA
    d47a758 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2020

  1. py3: use raw strings for regexes

    Fixes linting issues and simplifies some patterns by removing unneeded
    escaping.
    julen committed Jan 22, 2020
    Configuration menu
    Copy the full SHA
    6637ada View commit details
    Browse the repository at this point in the history