Title: AttributeError when copying flags in the `re` module. · Issue #93820 · python/cpython · GitHub
Open Graph Title: AttributeError when copying flags in the `re` module. · Issue #93820 · python/cpython
X Title: AttributeError when copying flags in the `re` module. · Issue #93820 · python/cpython
Description: Bug report In CPython 3.11, I've noticed that an attempt to copy (combined) regular expression flags fails with an attribute error; like so: >>> import copy, re >>> copy.copy(re.A | re.I) Traceback (most recent call last): File "
Open Graph Description: Bug report In CPython 3.11, I've noticed that an attempt to copy (combined) regular expression flags fails with an attribute error; like so: >>> import copy, re >>> copy.copy(re.A | re.I) Traceback...
X Description: Bug report In CPython 3.11, I've noticed that an attempt to copy (combined) regular expression flags fails with an attribute error; like so: >>> import copy, re >>> copy.copy(...
Opengraph URL: https://github.com/python/cpython/issues/93820
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AttributeError when copying flags in the `re` module.","articleBody":"**Bug report**\r\n\r\nIn CPython 3.11, I've noticed that an attempt to copy (combined) regular expression flags fails with an attribute error; like so:\r\n\r\n```\r\n\u003e\u003e\u003e import copy, re\r\n\u003e\u003e\u003e copy.copy(re.A | re.I)\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"lib/python3.11/copy.py\", line 102, in copy\r\n return _reconstruct(x, None, *rv)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"lib/python3.11/copy.py\", line 265, in _reconstruct\r\n y = func(*args)\r\n ^^^^^^^^^^^\r\n File \"lib/python3.11/enum.py\", line 862, in __getattr__\r\n raise AttributeError(name) from None\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\nAttributeError: ASCII|IGNORECASE\r\n```\r\n\r\n**Your environment**\r\n\r\n- CPython versions tested on: 3.11.0b3\r\n- Operating system and architecture: macOS 10.15.7\r\n\r\n\r\n**Background**\r\n\r\nThis behavior was detected from a [CrossHair test failure here](https://github.com/pschanely/CrossHair/blob/4abaac436f383abf3bcc705a4a521d9cd824d4e5/crosshair/libimpl/relib_test.py#L220), in which we realize possibly symbolic arguments prior to regex compilation. (it's an esoteric use case, and I expect not very high priority)","author":{"url":"https://github.com/pschanely","@type":"Person","name":"pschanely"},"datePublished":"2022-06-14T18:01:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/93820/cpython/issues/93820"}
| 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:97077cd6-c8c7-dcf2-c3eb-a6967557e825 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFBA:339E6E:3844D8:4B420A:6969AD1E |
| html-safe-nonce | 67b23ca9b0279ae4572079e631f3d214f15ef97454363975bfb35d234f4f85ee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkJBOjMzOUU2RTozODQ0RDg6NEI0MjBBOjY5NjlBRDFFIiwidmlzaXRvcl9pZCI6IjMzMDYzNjg3ODk0ODAzMjAyODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f037d9c20124f941a386b371455ed1d30666277545d099521ecec0cdcca825e1 |
| hovercard-subject-tag | issue:1271158688 |
| 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/93820/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ff90c855003a5ca46cf7d93ddd8faf0344c9a7c47a3a8ac07ede959c7a8b2b69/python/cpython/issues/93820 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ff90c855003a5ca46cf7d93ddd8faf0344c9a7c47a3a8ac07ede959c7a8b2b69/python/cpython/issues/93820 |
| og:image:alt | Bug report In CPython 3.11, I've noticed that an attempt to copy (combined) regular expression flags fails with an attribute error; like so: >>> import copy, re >>> copy.copy(re.A | re.I) Traceback... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pschanely |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| 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 | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width