You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The print() function of a zipfile.Path failed if the ZipFile is based on a bytes stream.
More generally, every try to display or build a path based on bytes stream ZipFile path seems to fail.
A zip file is needed for playing this use case.
The mine is composed like this :
folder_root
├── folder_depth1
│ ├── folder_depth2
│ │ ├── folder_depth3
│ │ │ └── Python-Logo.png
│ │ └── Python-Logo.png
│ └── Python-Logo.png
└── Python-Logo.png
and is named "my_package.zip"
In the first case (zipfile path based on a bytes stream), the Path-like objects have 'None' as root when the root is the name of the package in the second case (zipfile path made based on the file).
My though is that a path is not intended to bring a NoneType element and so a path.join failed when a transformation into a string is needed.
What about change this "None" by an empty string ?
CPython versions tested on:
3.8, 3.9
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered:
Bug report
Bug description:
Hi,
The print() function of a zipfile.Path failed if the ZipFile is based on a bytes stream.
More generally, every try to display or build a path based on bytes stream ZipFile path seems to fail.
A zip file is needed for playing this use case.
The mine is composed like this :
folder_root
├── folder_depth1
│ ├── folder_depth2
│ │ ├── folder_depth3
│ │ │ └── Python-Logo.png
│ │ └── Python-Logo.png
│ └── Python-Logo.png
└── Python-Logo.png
and is named "my_package.zip"
To trigger the problem I type these commands :
Here is my output:
To have more information I wrote this function
and then, launch it, like this
Here is my output:
In the first case (zipfile path based on a bytes stream), the Path-like objects have 'None' as root when the root is the name of the package in the second case (zipfile path made based on the file).
My though is that a path is not intended to bring a NoneType element and so a path.join failed when a transformation into a string is needed.
What about change this "None" by an empty string ?
CPython versions tested on:
3.8, 3.9
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered: