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

Normalise file encodings in Lib/sqlite3/test/ #87013

Closed
erlend-aasland opened this issue Jan 6, 2021 · 5 comments
Closed

Normalise file encodings in Lib/sqlite3/test/ #87013

erlend-aasland opened this issue Jan 6, 2021 · 5 comments
Labels
3.10 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@erlend-aasland
Copy link
Contributor

BPO 42847
Nosy @gvanrossum, @berkerpeksag, @erlend-aasland
PRs
  • bpo-42847: Normalise Lib/sqlite3/test/* file encodings #24147
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-01-07.00:38:06.263>
    created_at = <Date 2021-01-06.23:41:04.122>
    labels = ['type-feature', 'tests', '3.10']
    title = 'Normalise file encodings in Lib/sqlite3/test/'
    updated_at = <Date 2021-01-07.00:40:15.219>
    user = 'https://github.com/erlend-aasland'

    bugs.python.org fields:

    activity = <Date 2021-01-07.00:40:15.219>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-01-07.00:38:06.263>
    closer = 'erlendaasland'
    components = ['Tests']
    creation = <Date 2021-01-06.23:41:04.122>
    creator = 'erlendaasland'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42847
    keywords = ['patch']
    message_count = 5.0
    messages = ['384543', '384544', '384545', '384548', '384549']
    nosy_count = 3.0
    nosy_names = ['gvanrossum', 'berker.peksag', 'erlendaasland']
    pr_nums = ['24147']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue42847'
    versions = ['Python 3.10']

    @erlend-aasland
    Copy link
    Contributor Author

    GitHub does not play well with other file encodings than UTF-8. For example, when the "suggestion" in #20538 (comment) was applied, GitHub silently converted Lib/sqlite3/test/types.py from ISO-8859 to UTF-8, as seen in the resulting commit fd4f651. Apart from being annoying, this created an inconsistency between the #-*- coding: iso-8859-1 -*- header in Lib/sqlite3/test/types.py and its actual encoding (now UTF-8).

    I suggest to convert Lib/sqlite3/test/* to UTF-8 encoding for consistency.

    $ file Lib/sqlite3/test/*.py
    Lib/sqlite3/test/backup.py:        Python script text executable, ASCII text
    Lib/sqlite3/test/dbapi.py:         Python script text executable, ISO-8859 text
    Lib/sqlite3/test/dump.py:          Python script text executable, ASCII text
    Lib/sqlite3/test/factory.py:       Python script text executable, ISO-8859 text
    Lib/sqlite3/test/hooks.py:         Python script text executable, ISO-8859 text
    Lib/sqlite3/test/regression.py:    Python script text executable, ISO-8859 text
    Lib/sqlite3/test/transactions.py:  Python script text executable, ISO-8859 text
    Lib/sqlite3/test/types.py:         Python script text executable, ISO-8859 text
    Lib/sqlite3/test/userfunctions.py: Python script text executable, UTF-8 Unicode text

    @erlend-aasland erlend-aasland added stdlib Python modules in the Lib dir 3.10 only security fixes labels Jan 6, 2021
    @gvanrossum
    Copy link
    Member

    SGTM, the use of ISO-8859 is surely a legacy issue.

    @erlend-aasland
    Copy link
    Contributor Author

    Indeed it is. I'll create a PR as soon as #64737 is merged.

    @berkerpeksag
    Copy link
    Member

    New changeset deab1e5 by Erlend Egeberg Aasland in branch 'master':
    bpo-42847: Normalise Lib/sqlite3/test/* file encodings (GH-24147)
    deab1e5

    @berkerpeksag
    Copy link
    Member

    iso-8859-1 is still commonly used in some parts of Nordic countries, but I don't see a reason not to change it here :) Thank you, Erlend!

    @berkerpeksag berkerpeksag added tests Tests in the Lib/test dir type-feature A feature request or enhancement and removed stdlib Python modules in the Lib dir labels Jan 7, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants