[issue41357] pathlib.Path.resolve incorrect os.path equivalent
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41357> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41357] pathlib.Path.resolve incorrect os.path equivalent
Jeffrey Kintscher added the comment: I uploaded a script illustrating the differences between how Path.resolve(), os.path.abspath(), and os.path.realpath() handle symlinks. As noted by Jendrik, Path.resolve() and os.path.realpath() both resolve symlinks, while os.path.abspath() does not. The documentation needs to be updated. I will generate a pull request. Example run on the master branch: python version: 3.9.0a0 (heads/master-dirty:f69d5c6198, Jul 16 2019, 12:38:41) [Clang 10.0.1 (clang-1001.0.46.4)] tdir1: /var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1 creating tdir1 tdir2: /var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo2 creating tdir2 as symlink to tdir1 Path(tdir1).resolve(): /private/var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1 Path(tdir2).resolve(): /private/var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1 os.path.abspath(tdir1): /var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1 os.path.abspath(tdir2): /var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo2 os.path.realpath(tdir1): /private/var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1 os.path.realpath(tdir2): /private/var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1 -- Added file: https://bugs.python.org/file49333/bpo-41537-test.py ___ Python tracker <https://bugs.python.org/issue41357> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41357] pathlib.Path.resolve incorrect os.path equivalent
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +20735 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21596 ___ Python tracker <https://bugs.python.org/issue41357> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41368] Allow compiling Python with llvm-clang on Windows.
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41368> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37095] [Feature Request]: Add zstd support in tarfile
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue37095> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41350] Use of zipfile.Path causes attempt to write after ZipFile is closed
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41350> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41350] Use of zipfile.Path causes attempt to write after ZipFile is closed
Jeffrey Kintscher added the comment: It looks like a copy of the zip_file object is getting created, probably by the Path constructor: zip_path = Path(zip_file, "file-a") When return is invoked, the copy still has a reference to the now closed bytes_io object which causes the ValueError exception when ZipFile.__del__() calls ZipFile.close(). This is definitely a bug. I'll take a crack at fixing it. -- ___ Python tracker <https://bugs.python.org/issue41350> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41350] Use of zipfile.Path causes attempt to write after ZipFile is closed
Jeffrey Kintscher added the comment: I created a simpler test case that exercises the buggy code. The problem can be reproduced by passing ZipFile.__init__() a file-like object with the write flag (mode "w") and then closing the file-like object before calling ZipFile.close(). The exception being triggered by the call to ZipFile.__del__() is a side-effect because all ZipFile.__del__() does is call ZipFile.close(). import io from zipfile import ZipFile bytes_io = io.BytesIO() zip_file = ZipFile(bytes_io, mode="w") bytes_io.close() zip_file.close() # throws ValueError -- Added file: https://bugs.python.org/file49336/zipfile_close_bug.py ___ Python tracker <https://bugs.python.org/issue41350> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41350] Use of zipfile.Path causes attempt to write after ZipFile is closed
Change by Jeffrey Kintscher : -- versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issue41350> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41350] Use of zipfile.Path causes attempt to write after ZipFile is closed
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +20745 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21604 ___ Python tracker <https://bugs.python.org/issue41350> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41491] plistlib can't load macOS BigSur system LaunchAgent
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41491> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41489] HTMLParser : HTMLParser.error creating multiple errors.
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41489> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41477] test_genericalias fails if ctypes is missing
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41477> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41470] smtplib.SMTP should reset internal 'helo' and 'ehlo' state within 'connect()'
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41470> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41398] cgi module, parse_multipart fails
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41398> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41465] io.TextIOWrapper.errors not writable
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41465> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41465] io.TextIOWrapper.errors not writable
Jeffrey Kintscher added the comment: I looked at the implementation in Lib/_pyio.py. The only way to change the error handler is by calling TextIOWrapper.reconfigure() and supply the new error handler as the "errors" parameter. For example: >>> import io >>> s = io.TextIOWrapper(io.BytesIO()) >>> print(s.errors) strict >>> s.reconfigure(errors='replace') >>> print(s.errors) replace >>> -- ___ Python tracker <https://bugs.python.org/issue41465> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41458] Avoid overflow/underflow in math.prod()
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41458> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41450] OSError is not documented in ssl library, but still can be thrown
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41450> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41456] loop.run_in_executor creat thread but not destory it after the task run over
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41456> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26791] shutil.move fails to move symlink (Invalid cross-device link)
Jeffrey Kintscher added the comment: SilentGhost's analysis is correct. The provided example code causes the error because it is trying to move the symlink into its target when the target is a directory. Any cross-device moving issues are unrelated to this example code. Here is the relevant code in the master branch: if os.path.isdir(dst): if _samefile(src, dst): # We might be on a case insensitive filesystem, # perform the rename anyway. os.rename(src, dst) return shutil._samefile() considers the example link and its target to be the same. When _samefile() returns False, this code gets executed: real_dst = os.path.join(dst, _basename(src)) if os.path.exists(real_dst): raise Error("Destination path '%s' already exists" % real_dst) try: os.rename(src, real_dst) except OSError: if os.path.islink(src): linkto = os.readlink(src) os.symlink(linkto, real_dst) os.unlink(src) A simple fix is to check whether src is a symlink when _samefile() returns True. The "Destination path...already exists" error isn't a problem for our symlink case because the shell mv command also returns an error. $ ls -l /tmp/tmpdir/ total 0 lrwxr-xr-x 1 jeff staff 11 Aug 5 23:36 test_dir -> /tmp/tmpdir $ mv test_dir /tmp/tmpdir mv: test_dir and /tmp/tmpdir/test_dir are identical I will generate a pull request. -- ___ Python tracker <https://bugs.python.org/issue26791> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26791] shutil.move fails to move symlink (Invalid cross-device link)
Change by Jeffrey Kintscher : -- versions: +Python 3.10, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue26791> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22107] tempfile module misinterprets access denied error on Windows
Change by Jeffrey Kintscher : -- nosy: -Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue22107> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41456] loop.run_in_executor creat thread but not destory it after the task run over
Change by Jeffrey Kintscher : -- nosy: -Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41456> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26791] shutil.move fails to move symlink (Invalid cross-device link)
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +20904 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21759 ___ Python tracker <https://bugs.python.org/issue26791> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41419] Path.mkdir and os.mkdir don't respect setgid if its parent is g-s
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41419> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41238] Python 3 shelve.DbfilenameShelf is generating 164 times larger files than Python 2.7 when storing dicts
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41238> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37724] [[Errno 17] File exists: ] # Try create directories that are not part of the archive with
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue37724> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41169] socket.inet_pton raised when pass an IPv6 address like "[::]" to it
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41169> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41157] email.message_from_string() is unable to find the headers for the .msg files
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41157> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41168] Lack of proper checking in PyObject_SetAttr leads to segmentation fault
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41168> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41168] Lack of proper checking in PyObject_SetAttr leads to segmentation fault
Jeffrey Kintscher added the comment: Can you attach the Python source code for the PoC? -- ___ Python tracker <https://bugs.python.org/issue41168> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41419] Path.mkdir and os.mkdir don't respect setgid if its parent is g-s
Change by Jeffrey Kintscher : -- nosy: -Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41419> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37495] socket.inet_aton parsing issue on some libc versions
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue37495> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34360] urllib.parse doesn't fully comply to RFC 3986
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue34360> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5141] C API for appending to arrays
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue5141> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__
Jeffrey Kintscher added the comment: The workaround is to override _init(), which I agree is not desirable. This is the relevant code in PurePath, which is the super class of PurePosixPath: @classmethod def _from_parsed_parts(cls, drv, root, parts, init=True): self = object.__new__(cls) self._drv = drv self._root = root self._parts = parts if init: self._init() return self ... def _init(self): # Overridden in concrete Path pass To me, the clean way to get the desired behavior seems like it would be to have _init() call self.__init__(). def _init(self): # Overridden in concrete Path self.__init__() This fixes p.parent, but GithubPath() ends up calling GithubPath.__init__() twice – the first time by PurePath.__new__() calling PurePath._init() and the second time by the GithubPath object creation. -- ___ Python tracker <https://bugs.python.org/issue41109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__
Jeffrey Kintscher added the comment: Clarification: PurePath.__new__() calls PurePath._from_parts(), which then calls PurePath._init() -- ___ Python tracker <https://bugs.python.org/issue41109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32884] Adding the ability for getpass to print asterisks when password is typed
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue32884> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32884] Adding the ability for getpass to print asterisks when password is typed
Jeffrey Kintscher added the comment: This is easy to implement for Windows (as shown), but the unix implementation uses io.TextIOWrapper.readline() to get the password input. The unix implementation would have to be rewritten to provide the same functionality. -- ___ Python tracker <https://bugs.python.org/issue32884> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41097] confusing BufferError: Existing exports of data: object cannot be re-sized
Jeffrey Kintscher added the comment: The error message is found in three different locations in the source code. One is in the bytearray class, and the other two are in the BytesIO class. They are unrelated code paths. -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41097> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41097] confusing BufferError: Existing exports of data: object cannot be re-sized
Jeffrey Kintscher added the comment: >>> import io >>> b = io.BytesIO() >>> b.write(b'abc') 3 >>> buf = b.getbuffer() >>> b.seek(0) 0 >>> b.write(b'?') Traceback (most recent call last): File "", line 1, in BufferError: Existing exports of data: object cannot be re-sized >>> The problem is caused by the b.getbuffer() call. It increments a reference counter in the BytesIO object that causes the b.write() call to fail because the counter is > 0. The error message is misleading. The counter is decremented when the buffer view is deleted. >>> import io >>> b = io.BytesIO() >>> b.write(b'abc') 3 >>> buf = b.getbuffer() >>> b.seek(0) 0 >>> b.write(b'?') Traceback (most recent call last): File "", line 1, in BufferError: Existing exports of data: object cannot be re-sized >>> del buf >>> b.write(b'?') 1 >>> b.getvalue() b'?bc' >>> The documentation for io.BytesIO.getbuffer() says "Note: As long as the view exists, the BytesIO object cannot be resized or closed." Either this is a bug, or the documentation needs to be updated to say the io.BytesIO object is unwritable while any buffer views exist. -- ___ Python tracker <https://bugs.python.org/issue41097> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41097] confusing BufferError: Existing exports of data: object cannot be re-sized
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +20931 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/21792 ___ Python tracker <https://bugs.python.org/issue41097> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41518] incorrect printing behavior with parenthesis symbols
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41518> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41517] Enum multiple inheritance loophole
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41517> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__
Jeffrey Kintscher added the comment: The purpose of the _init() function in PurePath is to allow PurePath methods to call the Path subclass override _init() function when initializing a Path object. -- ___ Python tracker <https://bugs.python.org/issue41109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41518] incorrect printing behavior with parenthesis symbols
Change by Jeffrey Kintscher : -- nosy: -Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41518> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__
Jeffrey Kintscher added the comment: Adding __init__() to PurePath complicates things and doesn't provide any benefit. A subclass that calls super.__init__() ends up invoking object.__init__(), which is perfectly fine. I was able to find a solution by calling type(self)() instead of object.__new__() in most cases. I am working on a PR. -- ___ Python tracker <https://bugs.python.org/issue41109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__
Jeffrey Kintscher added the comment: The current implementation calls object.__new__(cls), where cls is the child class type, from within a class method (@classmethod). This is fine for Path.__new__() and PurePath.__new__(), which are called by the child class's __new__(), because we don't want them to recursively call the child class's __new__() when the child class is created. This all works as expected when the child class is instantiated outside of Path and PurePath, and the child's __init__() gets called as expected. I don't see any point in making changes to this behavior. When one of approximately 20 PurePath and Path functions and properties instantiate a new child class object the same way PurePath.__new__() and Path.__new__() do, the child class's __new__() and __init__() functions are not called. This is the problem we are trying to solve. My fix is to add normal functions (i.e. not decorated with @classmethod) to instantiate child class objects using obj = type(self)() This creates a child class instance, and the child's __new__() and __init__() functions get called. Once I have finished re-plumbing Path and PurePath to use the new functions and created the necessary unit tests (to make sure I didn't break anything), I will also look at adding a proper __init__() function to the two classes instead of having __new__() initialize the member variables. I didn't mean to imply that __init__() isn't useful. It is required to allow the child class to initialize its own variable. I just meant it isn't required to force calling __init__() and __new__() in the child class. -- ___ Python tracker <https://bugs.python.org/issue41109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41553] encoded-word abused for header line folding causes RFC 2047 violation
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41553> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41552] uuid.uuid1() on certain Macs does not generate unique IDs
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41552> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35786] get_lock() method is not present for Values created using multiprocessing.Manager()
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue35786> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +21034 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21920 ___ Python tracker <https://bugs.python.org/issue41109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__
Jeffrey Kintscher added the comment: I created a PR that should provide the desired behavior: __init__() and __new__() get called in subclass objects that are created by Path and PurePath. Also, Path and PurePath now have __init__() functions, and the __new__() functions only return new objects and rely upon __init__() to perform the object initialization. -- ___ Python tracker <https://bugs.python.org/issue41109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__
Change by Jeffrey Kintscher : -- components: +Library (Lib) ___ Python tracker <https://bugs.python.org/issue41109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41595] curses' window.chgat does not change color when specifying curses.A_COLOR
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41595> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41593] pathlib PermissionError problem
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41593> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41585] policy.max_line_length is incorrectly assumed to never be None
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41585> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41560] pathlib.Path.glob fails on empty string
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue41560> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41564] Cannot access member "hex" for type "ByteString"
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher status: pending -> open ___ Python tracker <https://bugs.python.org/issue41564> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41564] Cannot access member "hex" for type "ByteString"
Jeffrey Kintscher added the comment: hex.py works for me with CPython versions 3.5, 3.7, 3.8, and 3.9, and the master branch. -- ___ Python tracker <https://bugs.python.org/issue41564> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18060] Updating _fields_ of a derived struct type yields a bad cif
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +13285 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue18060> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file
Jeffrey Kintscher added the comment: I did some testing with BSD and GNU tar to compare with Python's behavior. jfoo:~ jeff$ tar --version bsdtar 2.8.3 - libarchive 2.8.3 jeff@albarino:~$ tar --version tar (GNU tar) 1.28 Both BSD tar and GNU tar can create an empty tar file that consists of all zero bytes. BSD tar creates a 1 KB file: jfoo:~ jeff$ tar -cf tarfilename.tar -T /dev/null jfoo:~ jeff$ hexdump tarfilename.tar 000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 400 jfoo:~ jeff$ tar -tf tarfilename.tar jfoo:~ jeff$ echo $? 0 while GNU tar creates a 10 KB file: jeff@albarino:~$ tar -cf tarfilename.tar -T /dev/null jeff@albarino:~$ hexdump tarfilename.tar 000 * 0002800 jeff@albarino:~$ tar -tf tarfilename.tar jeff@albarino:~$ echo $? 0 GNU tar will also leave a tar file with 10 KB of zeros when all contents have been deleted (BSD tar doesn't support deletion): jeff@albarino:~$ tar cf empty.tar tarfilename.tar jeff@albarino:~$ hexdump empty.tar 000 6174 6672 6c69 6e65 6d61 2e65 6174 0072 010 * 060 3030 3030 3636 0034 3030 3130 070 3537 0031 3030 3130 3537 0031 3030 3030 080 3030 3432 3030 0030 3331 3634 3637 3430 090 3331 0037 3130 3432 3637 2000 0030 0a0 * 100 7500 7473 7261 2020 6a00 6665 0066 110 120 6a00 6665 0066 130 * 0005000 jeff@albarino:~$ tar --delete -f empty.tar tarfilename.tar jeff@albarino:~$ hexdump empty.tar 000 * 0002800 jfoo:~ jeff$ tar -tf empty.tar jfoo:~ jeff$ echo $? 0 According to the POSIX.1 standard, "[t]he last physical block shall always be the full size, so logical records after the two zero logical records may contain undefined data." (http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#). It looks like any file starting with 1,024 bytes of zeros is a valid tar archive per BSD tar, GNU tar, and the POSIX.1 standard. However, BSD tar and GNU tar disagree about files starting with 512 bytes of zeros followed by 512 bytes of garbage. First, I constructed such a file for testing (zr.tar): jfoo:~ jeff$ dd if=/dev/zero of=zr.tar bs=512 count=1 1+0 records in 1+0 records out 512 bytes transferred in 0.60 secs (8521761 bytes/sec) jfoo:~ jeff$ dd if=/dev/random of=zr.tar bs=512 count=1 oseek=1 1+0 records in 1+0 records out 512 bytes transferred in 0.56 secs (9138228 bytes/sec) jfoo:~ jeff$ ls -l zr.tar -rw-r--r-- 1 jeff staff 1024 May 17 13:14 zr.tar jfoo:~ jeff$ hexdump zr.tar 000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 200 d7 56 a9 8d 26 11 a4 d8 9a 96 15 04 8d 4b 31 5d 210 33 2b 20 ae a2 23 09 8c 60 a1 73 12 a1 ab 73 61 220 69 eb 88 bf 8a 7d 6b 9a c5 79 b6 c9 9b a9 5a 6d 230 4b 4a 81 a7 71 da 90 24 3f 8f 43 a9 95 a0 20 bb 240 93 0f b2 be 7e 4d 80 49 aa 61 19 a2 6b b5 5c f4 250 e0 34 7f 99 a0 d3 29 08 9a 25 97 96 d4 d0 07 e4 260 90 1c 60 97 9a 23 d3 25 38 54 97 8b 71 a0 83 40 270 a6 f9 19 1b 3f 6e bc 5b 06 22 20 fc ff fe 7b eb 280 35 9b 52 57 14 83 90 7f d3 e8 f4 72 58 96 16 8c 290 09 ad 2a 2f ad fd 43 09 96 eb 7c 8f fc a6 14 d9 2a0 18 34 38 b6 6a 5a ff 66 6d 46 cb 77 7a 5c 1e 72 2b0 3e 27 05 3a b0 c4 52 7b c8 cc 26 b9 c3 5f 39 27 2c0 a3 49 9e f1 3f f8 7e 46 98 df 7c 9d e3 86 c3 72 2d0 e1 ef 98 7d a1 96 4e 4b 82 bb f4 2b f3 71 6f 16 2e0 fe 38 2d bc 2b 70 b3 e6 db 1b ad 44 13 06 28 e5 2f0 3d 05 07 3c 5f 09 5b 90 67 09 0b 5a db 79 b7 27 300 8a 4b e5 b3 66 f0 7a 9d a5 c4 e3 a8 b4 b2 d2 c8 310 5d d1 27 81 03 25 33 f4 fb 6f 77 b1 df 9d fa cf 320 01 a7 70 40 b4 7f 6b ac 04 70 5c 29 06 6a 73 64 330 4f 15 92 3b 5e a4 34 95 e0 4b 04 be ca 87 e9 73 340 1e 63 98 f3 f1 fd be 7a de fe 84 27 b7 e4 db e0 350 fb 04 7f 9d f0 ae af a3 8e 0f c2 a7 80 e0 32 38 360 17 1e 47 37 48 9b 99 35 58 9d d5 83 1b 67 d4 e8 370 15 0d 00 bb 79 f3 37 59 c3 5e e9 1d 87 79 96 de 380 6c 89 35 34 0b b1 12 b2 a8 2d 61 dd f5 9a 19 e7 390 c1 c5 24 46 fa 23 f0 db 72 7f a5 18 aa e2 db 04 3a0 1e cc a6 0f 9e 4e 00 d9 2d eb f9 fc c4 d5 8e 46 3b0 ab c3 ed 53 98 df a8 81 26 f4 b5 0f b4 7f 12 a4 3c0 4a aa 14 4c f5 aa dd ba 69 e5 a8 d5 b3 68 0b 9f 3d0 1a aa 34 a4 60 09 c2 30 22 32 72 dd 2e f9 7a 79 3e0 88 a3 6a 99 13 4f f4 27 db 02 2e cb a0 ec d8 4d 3f0 fe 68 44 0c 7b 3a 74 8d 8e cd ba 3e d8 ef cb 97 400 GNU tar outputs a warning message, but still returns zero: jeff@albarino:~$ tar -tvf zr.tar tar: A lone zero block at 1 jeff@albarino:~$ echo $? 0 while BSD tar silently accepts the file: jfoo:~ jeff$ tar -tvf zr.tar jfoo:~ jeff$ echo $? 0 Python also accepts the file as valid: >>> tarfile.open("zr.tar", "r") Personally, I t
[issue36630] failure of test_colors_funcs in test_curses with ncurses 6.1
Jeffrey Kintscher added the comment: The test fails because curses.pair_content(curses.COLOR_PAIRS-1) validates its parameter against the limits for signed short (max 32767) while curses.COLOR_PAIRS-1 has the value 65535. Unfortunately, re-plumbing curses.pair_content() to use signed integers instead of signed shorts and replacing the underlying ncurses API call from pair_content() to extended_pair_content() doesn't fix the problem because extended_pair_content() still fails when passed 65535. Tracing into the ncurses 6.1 source code, I found that start_color() clamps the maximum number of color pairs at SHRT_MAX (32767) regardless of the number of color pairs supported by the terminal. -- nosy: +websurfer5 Added file: https://bugs.python.org/file48338/extended_pair_content.c ___ Python tracker <https://bugs.python.org/issue36630> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36630] failure of test_colors_funcs in test_curses with ncurses 6.1
Jeffrey Kintscher added the comment: I posted a bug report to the bug-ncurses mailing list: https://lists.gnu.org/archive/html/bug-ncurses/2019-05/msg00022.html -- ___ Python tracker <https://bugs.python.org/issue36630> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36982] Add support for extended color functions in ncurses 6.1
New submission from Jeffrey Kintscher : ncurses 6.1 adds extended color functions to support terminals with 256 colors (e.g. xterm-256color). The extended functions take color pair values that are signed integers because the existing functions only take signed 16-bit values. My goal with this issue is to transparently use the ncurses extended color functions when compiling with ncurses 6.1 or newer. This should be straightforward and transparent to curses module users because the short int restrictions are in the ncurses library and not in the curses module API. This will fix the problems observed in issue #36630 but is broader, which is why I created a separete issue. I will work on this and post a PR whit it is ready. -- components: Library (Lib) messages: 342974 nosy: websurfer5 priority: normal severity: normal status: open title: Add support for extended color functions in ncurses 6.1 versions: Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue36982> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29699] shutil.rmtree should not fail with FileNotFoundError (race condition)
Change by Jeffrey Kintscher : -- nosy: +websurfer5 ___ Python tracker <https://bugs.python.org/issue29699> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36520] Email header folded incorrectly
Change by Jeffrey Kintscher : -- nosy: +websurfer5 ___ Python tracker <https://bugs.python.org/issue36520> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36422] tempfile.TemporaryDirectory() removes entire directory tree even if it's a mount-point
Change by Jeffrey Kintscher : -- nosy: +websurfer5 ___ Python tracker <https://bugs.python.org/issue36422> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36372] Flawed handling of URL redirect
Change by Jeffrey Kintscher : -- nosy: +websurfer5 ___ Python tracker <https://bugs.python.org/issue36372> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36979] ncurses extension uses wrong include path
Change by Jeffrey Kintscher : -- nosy: +websurfer5 ___ Python tracker <https://bugs.python.org/issue36979> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36758] configured libdir not correctly passed to Python executable
Change by Jeffrey Kintscher : -- nosy: +websurfer5 ___ Python tracker <https://bugs.python.org/issue36758> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36982] Add support for extended color functions in ncurses 6.1
Jeffrey Kintscher added the comment: A new function called curses.has_extended_color_support() will indicate whether the linked ncurses library provides extended color support. It returns true if curses.h defines NCURSES_EXT_COLORS and NCURSES_EXT_FUNCS, indicating that the extended color functions are available. This seems more useful to developers than using an indirect method like trying to set a color-pair greater than 0x7fff and checking for an exception to indicate lack of support. At first glance, has_extended_color() seems like a better name because it is similar to has_colors(), but the two functions have very different semantics that could confuse developers. has_extended_color_support() indicates available functionality in the underlying ncurses library that is set when the interpreter is compiled and linked, while has_curses() indicates available functionality of the current terminal at run-time. -- versions: -Python 3.9 ___ Python tracker <https://bugs.python.org/issue36982> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36982] Add support for extended color functions in ncurses 6.1
Jeffrey Kintscher added the comment: Corrected typos in msg343336 for clarity: At first glance, has_extended_colors() seems like a better name because it is similar to has_colors(), but the two functions have very different semantics that could confuse developers. has_extended_color_support() indicates available functionality in the underlying ncurses library that is set when the interpreter is compiled and linked, while has_colors() indicates available functionality of the current terminal at run-time. The name has_extended_colors() would imply that it indicates run-time terminal functionality and not static library functionality. -- ___ Python tracker <https://bugs.python.org/issue36982> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36630] failure of test_colors_funcs in test_curses with ncurses 6.1
Jeffrey Kintscher added the comment: I created issue #36982 to track the extended color changes since they broader than this issue. -- ___ Python tracker <https://bugs.python.org/issue36630> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36982] Add support for extended color functions in ncurses 6.1
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +13448 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36982> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36982] Add support for extended color functions in ncurses 6.1
Change by Jeffrey Kintscher : -- type: -> enhancement ___ Python tracker <https://bugs.python.org/issue36982> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36982] Add support for extended color functions in ncurses 6.1
Change by Jeffrey Kintscher : -- components: +Extension Modules -Library (Lib) ___ Python tracker <https://bugs.python.org/issue36982> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36979] ncurses extension uses wrong include path
Jeffrey Kintscher added the comment: This explains some of the build/linkage problems encountered in issue #36630, and that I encountered while working on issue #36982. -- nosy: +yan12125 ___ Python tracker <https://bugs.python.org/issue36979> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29699] shutil.rmtree should not fail with FileNotFoundError (race condition)
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +13487 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13580 ___ Python tracker <https://bugs.python.org/issue29699> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29699] shutil.rmtree should not fail with FileNotFoundError (race condition)
Jeffrey Kintscher added the comment: I created pull request bpo-29699 to fix this issue. It adds an additional exception handler to ignore FileNotFoundError for most of the try blocks that already handle OSError. I decided not to add it to the initial os.open() call. This should provide the same semantics as the "rm -r" shell command. It will fail with FileNotFoundError when foo is missing, which is the same behavior as "rm -r foo" returning "rm: foo: No such file or directory" when foo is missing. Similarly, "rm -rf foo" always succeeds and is equivalent to setting "ignore_errors=true" in the shutil.rmtree() call. -- ___ Python tracker <https://bugs.python.org/issue29699> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36520] Email header folded incorrectly
Jeffrey Kintscher added the comment: To aid with debugging the code, the Subject line can be simplified: >>> from email.message import EmailMessage >>> m = EmailMessage() >>> m['Subject'] = 'Hello >>> =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rld!?= Hello >>> Wörld!Hello Wörld!' >>> print(bytes(m)) b'Subject: Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rld!?=\n Hello =?utf-8?=?utf-8?q?q=3FW=3DC3=3DB6rld!Hello=3F=3D_W=C3=B6rld!?=\n\n' -- ___ Python tracker <https://bugs.python.org/issue36520> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36520] Email header folded incorrectly
Jeffrey Kintscher added the comment: I uploaded a test script with some test cases: The failure mode occurs when 1. line folding occurs 2. the first folded line has two or more words with UTF-8 characters 3. subsequent lines contain a word with UTF-8 characters located at a different offset than the last encoded substring in the first line For example, the first folded and encoded line of 'Hello Wörld! Hello Wörld! Hello Wörld! Hello Wörld!Hello Wörld!' is b'Subject: Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rld!?=' and the second line should be b' Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=' but instead, it is b' Hello =?utf-8?=?utf-8?q?q=3FW=3DC3=3DB6rld!Hello=3F=3D_W=C3=B6rld!?=' The function at fault is _refold_parse_tree() in Lib/email/_header_value_parser.py. In the first line, it encodes the first UTF-8 word and saves the starting offset in the output string (15). When it encounters the second UTF-8 word, it re-encodes the entire string starting at the saved offset. This is to help reduce the bloat added by multiple '=?utf-8?q?' start-of-encoding tokens. When it encodes the first UTF-8 word on the second line, it tries to store it at the saved offset into the second line output string, but that is past the end of the string so it just gets appended. When it encounter the second UTF-8 word in the second line, it re-encodes the entire second-line string starting at the saved offset (15), which is in the middle of the first encoded UTF-8 string. The failure mode is not triggered if there is at most one UTF-8 word in each folded line. It also is not triggered when folding occurs in the middle of a word instead of at whitespace because the code follows a different path. The solution is to set the saved starting offset to None when starting a new folded line when the fold-point is whitespace. I will submit a pull request soon with a fix. -- Added file: https://bugs.python.org/file48366/bpo-36520-test.py ___ Python tracker <https://bugs.python.org/issue36520> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36520] Email header folded incorrectly
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +13514 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13608 ___ Python tracker <https://bugs.python.org/issue36520> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36520] Email header folded incorrectly
Change by Jeffrey Kintscher : -- pull_requests: +13515 pull_request: https://github.com/python/cpython/pull/13610 ___ Python tracker <https://bugs.python.org/issue36520> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36520] Email header folded incorrectly
Jeffrey Kintscher added the comment: The pull request has been submitted with both the code fix and tests. -- ___ Python tracker <https://bugs.python.org/issue36520> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file
Jeffrey Kintscher added the comment: I recommend closing this issue since the behavior is the same as the BSD and GNU tar utilities. -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue36596> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35070] test_posix fails on macOS 10.14 Mojave
Change by Jeffrey Kintscher : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue35070> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37040] checking for membership in itertools.count enters infinite loop with no way to exit
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue37040> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37036] Iterating a text file by line should not implicitly disable tell
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue37036> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36411] Python 3 f.tell() gets out of sync with file pointer in binary append+read mode
Change by Jeffrey Kintscher : Added file: https://bugs.python.org/file48369/bpo-36411.c ___ Python tracker <https://bugs.python.org/issue36411> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36411] Python 3 f.tell() gets out of sync with file pointer in binary append+read mode
Jeffrey Kintscher added the comment: I adapted the test code on StackOverflow to show the expected and actual values. I get this output using Python 2.7.16: opening myfile with wb writing 3 bytes to file ('f.tell(): expecting 3, got', 3) closing myfile opening myfile with a+b ('f.tell(): expecting 3, got', 3) writing 3 bytes to file ('f.tell(): expecting 6, got', 6) ('f.seek(0): expecting 0, got', None) ('f.tell(): expecint 0, got', 0) writing 3 bytes to file ('f.tell(): expecting 9, got', 9) writing 3 bytes to file ('f.tell(): expecting 12, got', 12) ('f.seek(0, io.SEEK_CUR): expecting 12, got', None) ('f.tell(): expecting 12, got', 12) ('f.seek(0): expecting 0, got', None) ("f.read(): expecting b'abcdefghijkl', got", 'abcdefghijkl') closing file removing file As described, I get different results using Python 3.7.3 as well as the master branch (Python 3.8.0a4+): closing myfile opening myfile with a+b f.tell(): expecting 3, got 3 writing 3 bytes to file f.tell(): expecting 6, got 6 f.seek(0): expecting 0, got 0 f.tell(): expecint 0, got 0 writing 3 bytes to file f.tell(): expecting 9, got 3 writing 3 bytes to file f.tell(): expecting 12, got 6 f.seek(0, io.SEEK_CUR): expecting 12, got 12 f.tell(): expecting 12, got 12 f.seek(0): expecting 0, got 0 f.read(): expecting b'abcdefghijkl', got b'abcdefghijkl' closing file removing file I wrote an equivalent C program using the stream I/O functions and get the same results as Python 2.7.16: opening file with wb writing 3 bytes to file ftell(f): expecting 3, got 3 closing file opening file with a+b ftell(f): expecting 3, got 3 writing 3 bytes to filftell(f): expecting 6, got 6 fseek(f, 0, SEEK_SET): expecting 0, got 0 ftell(f): expecting 0, got 0 writing 3 bytes to file ftell(f): expecting 9, got 9 writing 3 bytes to file ftell(f): expecting 12, got 12 fseek(f, 0, SEEK_CUR): expecting 0, got 0 ftell(f): expecting 12, got 12 fseek(f, 0, SEEK_SET): expecting 0, got 0 fread(buf, 1, 256, f): expecting 12, got 12 expecting 'abcdefghijkl', got 'abcdefghijkl' closing file removing file I consider this behavior to be a bug because Python 2.7 and C agree, but Python 3.7 behaves differently. Requiring that developers know and work around non-standard quirky behavior leads to extra work and error-prone code. -- nosy: +Jeffrey.Kintscher Added file: https://bugs.python.org/file48368/bpo-36411.py ___ Python tracker <https://bugs.python.org/issue36411> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36411] Python 3 f.tell() gets out of sync with file pointer in binary append+read mode
Change by Jeffrey Kintscher : Removed file: https://bugs.python.org/file48369/bpo-36411.c ___ Python tracker <https://bugs.python.org/issue36411> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36411] Python 3 f.tell() gets out of sync with file pointer in binary append+read mode
Jeffrey Kintscher added the comment: I saw the bug in the C output after I hit submit. Here is the correct output: opening file with wb writing 3 bytes to file ftell(f): expecting 3, got 3 closing file opening file with a+b ftell(f): expecting 3, got 3 writing 3 bytes to file ftell(f): expecting 6, got 6 fseek(f, 0, SEEK_SET): expecting 0, got 0 ftell(f): expecting 0, got 0 writing 3 bytes to file ftell(f): expecting 9, got 9 writing 3 bytes to file ftell(f): expecting 12, got 12 fseek(f, 0, SEEK_CUR): expecting 0, got 0 ftell(f): expecting 12, got 12 fseek(f, 0, SEEK_SET): expecting 0, got 0 fread(buf, 1, 256, f): expecting 12, got 12 expecting 'abcdefghijkl', got 'abcdefghijkl' closing file removing file -- Added file: https://bugs.python.org/file48370/bpo-36411.c ___ Python tracker <https://bugs.python.org/issue36411> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37005] bz2 module doesn't write end-of-stream marker
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue37005> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36988] zipfile: string IndexError on extract
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue36988> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36976] email: AttributeError
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue36976> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36910] Certain Malformed email causes email.parser to throw AttributeError
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue36910> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36881] isinstance raises TypeError for metaclass with metaclass=ABCMeta
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker <https://bugs.python.org/issue36881> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com