Title: shutil.make_archive now fails with pathlib.Path object in Python 3.11.0b4 · Issue #94844 · python/cpython · GitHub
Open Graph Title: shutil.make_archive now fails with pathlib.Path object in Python 3.11.0b4 · Issue #94844 · python/cpython
X Title: shutil.make_archive now fails with pathlib.Path object in Python 3.11.0b4 · Issue #94844 · python/cpython
Description: Bug report This code works on Python 3.10 and Python 3.11.0a5 but raises a TypeError in Python 3.11.0b4: from pathlib import Path from shutil import make_archive path = Path.cwd().resolve() make_archive(path, 'zip', path.parent, path.nam...
Open Graph Description: Bug report This code works on Python 3.10 and Python 3.11.0a5 but raises a TypeError in Python 3.11.0b4: from pathlib import Path from shutil import make_archive path = Path.cwd().resolve() make_ar...
X Description: Bug report This code works on Python 3.10 and Python 3.11.0a5 but raises a TypeError in Python 3.11.0b4: from pathlib import Path from shutil import make_archive path = Path.cwd().resolve() make_ar...
Opengraph URL: https://github.com/python/cpython/issues/94844
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"shutil.make_archive now fails with pathlib.Path object in Python 3.11.0b4","articleBody":"**Bug report**\r\n\r\nThis code works on Python 3.10 and Python 3.11.0a5 but raises a `TypeError` in Python 3.11.0b4:\r\n\r\n```python\r\nfrom pathlib import Path\r\nfrom shutil import make_archive\r\npath = Path.cwd().resolve()\r\nmake_archive(path, 'zip', path.parent, path.name)\r\n```\r\n\r\nHere's the output I see in Python 3.11.0b4:\r\n\r\n```pycon\r\n\u003e\u003e\u003e from pathlib import Path\r\n\u003e\u003e\u003e from shutil import make_archive\r\n\u003e\u003e\u003e path = Path.cwd().resolve()\r\n\u003e\u003e\u003e make_archive(path, 'zip', path.parent, path.name)\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/home/trey/.pyenv/versions/3.11.0b4/lib/python3.11/shutil.py\", line 1130, in make_archive\r\n filename = func(base_name, base_dir, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/trey/.pyenv/versions/3.11.0b4/lib/python3.11/shutil.py\", line 977, in _make_zipfile\r\n zip_filename = base_name + \".zip\"\r\n ~~~~~~~~~~^~~~~~~~\r\nTypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'\r\n```\r\n\r\n**Your environment**\r\n\r\n- CPython versions tested on: Python 3.11.0b4\r\n- Operating system and architecture: 64-bit Ubuntu Linux 20.04","author":{"url":"https://github.com/treyhunner","@type":"Person","name":"treyhunner"},"datePublished":"2022-07-14T06:55:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/94844/cpython/issues/94844"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9e1c23d4-3009-7ad5-ad4c-ad5b3ed4c8e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8AE0:10DE44:2D19F:3C944:6969CA7C |
| html-safe-nonce | 80fb7ae86bb4e64ef051e3497c67eaf99147ae814bc468cbeb372249b3f92e60 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUUwOjEwREU0NDoyRDE5RjozQzk0NDo2OTY5Q0E3QyIsInZpc2l0b3JfaWQiOiI4ODU5NDgzNTkzMDU0NDcyODI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | aa3e9693f85cb29ee99fee89c5e6d80f654e8cc9d265b855ce9bedad8b6620b1 |
| hovercard-subject-tag | issue:1304344261 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/94844/issue_layout |
| twitter:image | https://opengraph.githubassets.com/97e97f796bccc654724cdcb6e978617fec3ea80d453de380acc76672d102f312/python/cpython/issues/94844 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/97e97f796bccc654724cdcb6e978617fec3ea80d453de380acc76672d102f312/python/cpython/issues/94844 |
| og:image:alt | Bug report This code works on Python 3.10 and Python 3.11.0a5 but raises a TypeError in Python 3.11.0b4: from pathlib import Path from shutil import make_archive path = Path.cwd().resolve() make_ar... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | treyhunner |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width