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

Several AttributeError in zipfile seek() methods #78216

Closed
espdev mannequin opened this issue Jul 3, 2018 · 10 comments
Closed

Several AttributeError in zipfile seek() methods #78216

espdev mannequin opened this issue Jul 3, 2018 · 10 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes easy stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@espdev
Copy link
Mannequin

espdev mannequin commented Jul 3, 2018

BPO 34035
Nosy @vstinner, @serhiy-storchaka, @miss-islington, @remilapeyre, @BoboTiG, @espdev
PRs
  • bpo-34035: Fix several AttributeError in zipfile seek() methods #8527
  • [3.7] bpo-34035: Fix several AttributeError in zipfile seek() methods. (GH-8527) #8556
  • 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 2018-07-29.20:07:37.822>
    created_at = <Date 2018-07-03.18:24:34.712>
    labels = ['3.7', '3.8', 'type-bug', 'library', 'easy']
    title = 'Several AttributeError in zipfile seek() methods'
    updated_at = <Date 2018-10-17.14:10:33.534>
    user = 'https://github.com/espdev'

    bugs.python.org fields:

    activity = <Date 2018-10-17.14:10:33.534>
    actor = 'Dariush Azimi'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-07-29.20:07:37.822>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2018-07-03.18:24:34.712>
    creator = 'espdev'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34035
    keywords = ['patch', 'easy']
    message_count = 10.0
    messages = ['320996', '320999', '321038', '321042', '322540', '322639', '322642', '322643', '322785', '327899']
    nosy_count = 7.0
    nosy_names = ['vstinner', 'serhiy.storchaka', 'miss-islington', 'remi.lapeyre', 'Tiger-222', 'espdev', 'Dariush Azimi']
    pr_nums = ['8527', '8556']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue34035'
    versions = ['Python 3.7', 'Python 3.8']

    @espdev
    Copy link
    Mannequin Author

    espdev mannequin commented Jul 3, 2018

    The misprint in the file lib/zipfile.py in the line 704 leads to AttributeError: '_SharedFile' object has no attribute 'writing'

    "self.writing()" should be replaced by "self._writing()". I also think this code shold be covered by tests.

    @espdev espdev mannequin added type-crash A hard crash of the interpreter, possibly with a core dump 3.7 (EOL) end of life stdlib Python modules in the Lib dir labels Jul 3, 2018
    @serhiy-storchaka serhiy-storchaka added easy 3.8 only security fixes type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Jul 3, 2018
    @espdev
    Copy link
    Mannequin Author

    espdev mannequin commented Jul 3, 2018

    I think the line 1031 also contains the misprint and will raise NameError.

    self._decompressor = zipfile._get_decompressor(self._compress_type)

    "zipfile." is not correct code in this place.

    @remilapeyre
    Copy link
    Mannequin

    remilapeyre mannequin commented Jul 4, 2018

    Hi Evegeny, I was able to reproduce the issue, if it's all right for you I would like to post a PR to solve the issue and extend the test suite od this module.

    @espdev
    Copy link
    Mannequin Author

    espdev mannequin commented Jul 4, 2018

    Hi Rémi, it would be great if you posted a PR.

    @BoboTiG
    Copy link
    Mannequin

    BoboTiG mannequin commented Jul 28, 2018

    Little word to say I am working on at EuroPython 2018.

    @BoboTiG BoboTiG mannequin changed the title zipfile: AttributeError in "seek" method of "_SharedFile" class Several AttributeError in zipfile seek() methods Jul 28, 2018
    @serhiy-storchaka
    Copy link
    Member

    New changeset 3f8c691 by Serhiy Storchaka (Mickaël Schoentgen) in branch 'master':
    bpo-34035: Fix several AttributeError in zipfile seek() methods. (GH-8527)
    3f8c691

    @miss-islington
    Copy link
    Contributor

    New changeset ad4f64d by Miss Islington (bot) in branch '3.7':
    bpo-34035: Fix several AttributeError in zipfile seek() methods. (GH-8527)
    ad4f64d

    @serhiy-storchaka
    Copy link
    Member

    Thank you for your report Evgeny and for your PR Mickaël!

    @vstinner
    Copy link
    Member

    Note: the seek() method has been added by bpo-22908 (commit 066df4f), and Python 3.6 is not affected.

    @DariushAzimi
    Copy link
    Mannequin

    DariushAzimi mannequin commented Oct 17, 2018

    Had the same issue with python 3.7 and went back to python 3.6. There are no issues with python 3.6.4

    @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.7 (EOL) end of life 3.8 only security fixes easy stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants