Skip to content

gh-89004: add attribute filemode in zipinfo#120999

Closed
Akasurde wants to merge 33 commits intopython:mainfrom
Akasurde:zip_filemode
Closed

gh-89004: add attribute filemode in zipinfo#120999
Akasurde wants to merge 33 commits intopython:mainfrom
Akasurde:zip_filemode

Conversation

@Akasurde
Copy link
Contributor

@Akasurde Akasurde commented Jun 25, 2024

Add attribute zipfile.ZipInfo.filemode.

Fixes: #89004


📚 Documentation preview 📚: https://cpython-previews--120999.org.readthedocs.build/

Add attribute zipfile.ZipInfo.filemode.

Fixes: python#89004

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Copy link
Contributor

@eendebakpt eendebakpt left a comment

Choose a reason for hiding this comment

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

@Akasurde Two more comments, but the overall approach looks good.

Please do not use force push on the branch, it makes it hard for other reviewers the follow the history.

self.external_attr = 0 # External file attributes
self.compress_size = 0 # Size of the compressed file
self.file_size = 0 # Size of the uncompressed file
self.file_mode = b"" # External attributes of the uncompressed file
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this line needed?

def _compresslevel(self, value):
self.compress_level = value

@property
Copy link
Contributor

Choose a reason for hiding this comment

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

The new property needs unit testing for different modes

kumaraditya303 and others added 21 commits July 2, 2024 17:16
…python#121126)

asyncio earlier relied on subprocess module to send signals to the process, this has some drawbacks one being that subprocess module unnecessarily calls waitpid on child processes and hence it races with asyncio implementation which internally uses child watchers. To mitigate this, now asyncio sends signals directly to the process without going through the subprocess on non windows systems. On Windows it fallbacks to subprocess module handling but on windows there are no child watchers so this issue doesn't exists altogether.
…ython#119816)

1. Use pkg-config to check for ncursesw/panelw. If that fails, use 
   pkg-config to check for ncurses/panel.
2. Regardless of pkg-config output, search for curses/panel headers, so
   we're sure we have all defines in pyconfig.h.
3. Regardless of pkg-config output, check if libncurses or libncursesw
   contains the 'initscr' symbol; if it does _and_ pkg-config failed
   earlier, add the resulting -llib linker option to CURSES_LIBS.
   Ditto for 'update_panels' and PANEL_LIBS.
4. Wrap the rest of the checks with WITH_SAVE_ENV and make sure we're 
   using updated LIBS and CPPFLAGS for those.

Add the PY_CHECK_CURSES convenience macro.
…121195)

When creating the JUnit XML file, regrtest now escapes characters
which are invalid in XML, such as the chr(27) control character used
in ANSI escape sequences.
)

Use the _Py__has_attribute() macro in timemodule.c and
bootstrap_hash.c to fix a build error on old GCC versions (GCC 4.8.5
on s390x).
…hon#120894)

Example:

```pycon
>>> import ctypes
>>> ctypes.__STDC_IEC_559_COMPLEX__
1
>>> libm = ctypes.CDLL('libm.so.6')
>>> libm.clog.argtypes = [ctypes.c_double_complex]
>>> libm.clog.restype = ctypes.c_double_complex
>>> libm.clog(1+1j)
(0.34657359027997264+0.7853981633974483j)
```

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
…ython#121191)

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().
Use subTest() to log the pwd entry in test_expanduser_pwd2() of
test_posixpath to help debugging.
…621 in /Tools (python#121215)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1216)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
….20240627 in /Tools (python#121217)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…HANDSHAKE (pythonGH-117785)

With this change, builds with OpenSSL forks that don't have this functionalty
(like AWS-LC or BoringSSL) will require less patching.
…vy (python#121221)

Mark test_threaded_weak_value_dict_copy() and
test_threaded_weak_key_dict_copy() of test_weakref as
CPU-heavy tests
…#121228)

Call getpwnam() to get pw_dir, since it can be different than
getpwall() pw_dir.
Soft deprecate os.popen() and os.spawn*() functions.
…set_each (pythongh-121236)

This will allow Py_TRACE_REFS builds to pass the test suite, until the underlying issue can be resolved.
…ython#120914)

Refactor the fast Unicode hash check into `_PyObject_HashFast` and use relaxed
atomic loads in the free-threaded build.

After this change, the TSAN doesn't report data races for this method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

filemode in repr of ZipInfo, but is not a ZipInfo attribute