This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author roysmith
Recipients Hasan Diwan, hrik2001, jcd, jojko.sivek, nadeem.vawda, roysmith, stestagg
Date 2021-04-27.13:05:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619528723.76.0.994509240222.issue24258@roundup.psfhosted.org>
In-reply-to
Content
The https://bitbucket.org/cliff/cpython#python24258 URL 404's

Looking at the attached bz2.py diff, I would change:

         if isinstance(filename, (str, bytes, os.PathLike)):
             self._fp = _builtin_open(filename, mode)
+            self.filename = filename
             self._closefp = True
             self._mode = mode_code

to special-case os.PathLike and do:

            self.filename = str(filename)

I would expect BZ2File.name to be a string.   Returning a PathLike means lots of legitimate string methods will not work on it.  Also, it should be "name" as an attribute, not "name()" as a method, to match other existing interfaces.
History
Date User Action Args
2021-04-27 13:05:23roysmithsetrecipients: + roysmith, nadeem.vawda, jcd, jojko.sivek, Hasan Diwan, stestagg, hrik2001
2021-04-27 13:05:23roysmithsetmessageid: <1619528723.76.0.994509240222.issue24258@roundup.psfhosted.org>
2021-04-27 13:05:23roysmithlinkissue24258 messages
2021-04-27 13:05:23roysmithcreate