GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-47217: add name attribute to bz2 fileobject by ellaellela · Pull Request #32311 · python/cpython

Conversation

@ellaellela

@ellaellela ellaellela commented Apr 4, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

https://bugs.python.org/issue47217

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ellaellela
add name attribute to bz2 fileobject
8a284ec
@bedevere-bot bedevere-bot added the awaiting review label Apr 4, 2022
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Apr 4, 2022
@blurb-it
📜🤖 Added by blurb_it.
47d3993
merwok
merwok reviewed Apr 18, 2022
View reviewed changes
Comment thread Lib/bz2.py
self._pos = 0

if not isinstance(filename, (str, bytes)):
self.name = ''

@merwok merwok Apr 18, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be some recognizable sentinel (<stream> or something better) rather than empty string?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ellaellela ellaellela Apr 23, 2022

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed the easiest way of doing it without complicating the logic and the tests. Also, I couldn't find a uniform way of dealing with a lack of "name" for BytesIO() objects in other libraries, so I did not want to introduce anything "new and specific".
Do you have an example (or an idea) of a sentinel use that would fit here? In that case, we could do a similar change for gzip, bz2, lzma, ... libraries to have a bit more standardized way of dealing with this situation when we have BytesIO() objects.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
MaxwellDupre
MaxwellDupre approved these changes Apr 24, 2022
View reviewed changes

@MaxwellDupre MaxwellDupre left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran 98 tests in 11.650s
OK
Looks ok.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Apr 24, 2022
@ellaellela ellaellela mannequin mentioned this pull request Apr 10, 2022
adding name to BZ2File #91373
Closed
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
@serhiy-storchaka

serhiy-storchaka commented Feb 26, 2024

Copy link
Copy Markdown
Member

Thank you for your PR @ellaellela, but this is a part of more complex issue #115961. It is better to solve it all in one place.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka serhiy-storchaka closed this Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merwok merwok merwok left review comments
+1 more reviewer
@MaxwellDupre MaxwellDupre MaxwellDupre approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@ellaellela @serhiy-storchaka @merwok @MaxwellDupre @the-knights-who-say-ni @ezio-melotti @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.