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 clean does not remove pickle files #51231

Closed
drukker mannequin opened this issue Sep 23, 2009 · 7 comments
Closed

make clean does not remove pickle files #51231

drukker mannequin opened this issue Sep 23, 2009 · 7 comments
Assignees
Labels
build The build process and cross-build topic-2to3 type-bug An unexpected behavior, bug, or error

Comments

@drukker
Copy link
Mannequin

drukker mannequin commented Sep 23, 2009

BPO 6982
Nosy @mdickinson, @benjaminp
Files
  • clean-pickles.patch: add pickleremoval target to Makefile.pre.in
  • clean-grammar-pickles.patch
  • 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 = 'https://github.com/mdickinson'
    closed_at = <Date 2009-09-24.19:28:43.257>
    created_at = <Date 2009-09-23.20:31:39.383>
    labels = ['type-bug', 'expert-2to3', 'build']
    title = 'make clean does not remove pickle files'
    updated_at = <Date 2009-09-24.19:28:43.255>
    user = 'https://bugs.python.org/drukker'

    bugs.python.org fields:

    activity = <Date 2009-09-24.19:28:43.255>
    actor = 'mark.dickinson'
    assignee = 'mark.dickinson'
    closed = True
    closed_date = <Date 2009-09-24.19:28:43.257>
    closer = 'mark.dickinson'
    components = ['Build', '2to3 (2.x to 3.x conversion tool)']
    creation = <Date 2009-09-23.20:31:39.383>
    creator = 'drukker'
    dependencies = []
    files = ['14960', '14962']
    hgrepos = []
    issue_num = 6982
    keywords = ['patch']
    message_count = 7.0
    messages = ['93049', '93055', '93058', '93061', '93062', '93067', '93089']
    nosy_count = 3.0
    nosy_names = ['mark.dickinson', 'benjamin.peterson', 'drukker']
    pr_nums = []
    priority = 'low'
    resolution = 'accepted'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue6982'
    versions = ['Python 2.6', 'Python 3.1', 'Python 2.7', 'Python 3.2']

    @drukker
    Copy link
    Mannequin Author

    drukker mannequin commented Sep 23, 2009

    make clean and make distclean don't remove the grammar pickles generated
    by load_grammar in Lib/lib2to3/pgen2/driver.py
    (Lib/lib2to3/Grammar3.2.0.alpha.0.pickle,
    Lib/lib2to3/PatternGrammar3.2.0.alpha.0.pickle).

    Proposed patch attached. It removes all *.pickle files, which I assume
    is safe. (Patch also corrects a comment.)

    @drukker drukker mannequin added build The build process and cross-build topic-2to3 labels Sep 23, 2009
    @bitdancer bitdancer added the type-bug An unexpected behavior, bug, or error label Sep 24, 2009
    @mdickinson
    Copy link
    Member

    I don't think it is safe to remove all *.pickle files in the source
    directory; even if there aren't any other useful .pickle files right now,
    there could be in the future (e.g. for pickle testing).

    I'd prefer something more targeted.

    Are these .pickle files generated during the build process, or just during
    testing? Maybe it should be the responsibility of the 2to3 tests to clean
    up after themselves?

    @drukker
    Copy link
    Mannequin Author

    drukker mannequin commented Sep 24, 2009

    These .pickle files aren't created by the tests themselves, but they do
    show up after running 'make test', or more specifically after running
    './python Lib/test/regrtest.py -v test_lib2to3'.

    This is because a grammar generated from a .txt grammar file is cached
    as a pickle for faster access by load_grammar in
    Lib/lib2to3/pgen2/driver.py. A pickle file then ends up in the same
    directory as the .txt file.

    IMHO, though it may be preferable to remove just the pickle files in
    Lib/lib2to3, it should never be required for tests to have pickle files
    already available in the source tree. Instead, the test should create a
    temporary pickle file, e.g. from a bytes object. Furthermore, binary
    files shouldn't be versioned without good reason. Thus, removing all
    pickle files should be safe for the future.

    @mdickinson
    Copy link
    Member

    IMHO, though it may be preferable to remove just the pickle files in
    Lib/lib2to3,

    Sounds reasonable.

    it should never be required for tests to have pickle files
    already available in the source tree.

    Well, I don't know about 'should', but the current tests already do
    make use of pickle files in the source tree: see Lib/test/*.pck.
    So there are already versioned pickle files (but not .pickle files :-).

    @drukker
    Copy link
    Mannequin Author

    drukker mannequin commented Sep 24, 2009

    You are right. Guess I was being a little too dogmatic. :-)

    I hadn't found those .pck files, because I was only looking for binary
    files.

    Here's a new patch proposal.

    @mdickinson
    Copy link
    Member

    Thanks! I'll apply this later today, unless Benjamin gets there first. :)

    @mdickinson
    Copy link
    Member

    Committed in r75047 (trunk). Merged in r75048 (release26-maint), r75049
    (py3k) and r75050 (release31-maint).

    @mdickinson mdickinson self-assigned this Sep 24, 2009
    @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
    build The build process and cross-build topic-2to3 type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants