Title: GitHub · Where software is built
Open Graph Title: python/cpython
X Title: python/cpython
Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.
Open Graph Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.
X Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.
Opengraph URL: https://github.com/python/cpython
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python 3.12 breaks backwards compatibility for logging configuration","articleBody":"# Bug report\n\n### Bug description:\n\nThis worked fine on previous versions:\n\n```python\nimport logging\nimport logging.config\nimport logging.handlers\nimport multiprocessing as mp\n\n\ndef main():\n config = {\n 'version': 1,\n 'handlers': {\n 'sink': {\n 'class': 'logging.handlers.QueueHandler',\n 'queue': mp.get_context('spawn').Queue(),\n },\n },\n 'root': {\n 'handlers': ['sink'],\n 'level': 'DEBUG',\n },\n }\n logging.config.dictConfig(config)\n\n\nif __name__ == '__main__':\n main()\n```\n\nWith Python 3.12, it drops an error:\n\n```\nTraceback (most recent call last):\n File \"/home/egor/.pyenv/versions/3.12-dev/lib/python3.12/logging/config.py\", line 581, in configure\n handler = self.configure_handler(handlers[name])\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/egor/.pyenv/versions/3.12-dev/lib/python3.12/logging/config.py\", line 786, in configure_handler\n raise ValueError('No handlers specified for a QueueHandler')\nValueError: No handlers specified for a QueueHandler\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/home/egor/workspace/personal/cimple/../test.py\", line 25, in \u003cmodule\u003e\n main()\n File \"/home/egor/workspace/personal/cimple/../test.py\", line 21, in main\n logging.config.dictConfig(config)\n File \"/home/egor/.pyenv/versions/3.12-dev/lib/python3.12/logging/config.py\", line 912, in dictConfig\n dictConfigClass(config).configure()\n File \"/home/egor/.pyenv/versions/3.12-dev/lib/python3.12/logging/config.py\", line 588, in configure\n raise ValueError('Unable to configure handler '\nValueError: Unable to configure handler 'sink'\n```\n\nMore than that, even the example in the Logging Cookbook is broken now: https://docs.python.org/3/howto/logging-cookbook.html#a-more-elaborate-multiprocessing-example (fails with the same error).\n\nVersion info:\n\n```\n# python -VV\nPython 3.12.0+ (heads/3.12:f108785, Nov 1 2023, 19:47:19) [GCC 13.2.1 20230801]\n```\n\n### CPython versions tested on:\n\n3.12\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-111638\n* gh-113507\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/egor-tensin","@type":"Person","name":"egor-tensin"},"datePublished":"2023-11-01T19:34:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/111615/cpython/issues/111615"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:3762a449-0582-b8a0-f773-32be99c09f54 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D292:2ABCA7:300B13:42E484:696A70B9 |
| html-safe-nonce | f8469a8fde9b29fab4a9ef37c1f8b8b551e0579e4ba49e7ec366ed5cf665a6fc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjkyOjJBQkNBNzozMDBCMTM6NDJFNDg0OjY5NkE3MEI5IiwidmlzaXRvcl9pZCI6Ijg5MDMyMTg1MTQ4ODUyNDMwNjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fffeeb317191b8e5bc0b2d792a7e25ea104bd47b8533c0045aa005cdbd607b94 |
| hovercard-subject-tag | repository:81598961 |
| 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/python/cpython/issues/111615 |
| twitter:image | https://opengraph.githubassets.com/bae45de93c0dca324def05fc117effb4be6bd50c119df55de80fc7b3741f7c77/python/cpython |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bae45de93c0dca324def05fc117effb4be6bd50c119df55de80fc7b3741f7c77/python/cpython |
| og:image:alt | The Python programming language. Contribute to python/cpython development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cfa223d62d272274e0b68350b4bd7741f3ca7498b8c4b8b1bc1e6deabbdbc09d |
| turbo-cache-control | no-cache |
| 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 | 6a0b6893c221f98f607598e939299fdf5763435d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width