Title: The module has no attribute 'TCP_KEEPIDLE' · Issue #2605 · pythonnet/pythonnet · GitHub
Open Graph Title: The module has no attribute 'TCP_KEEPIDLE' · Issue #2605 · pythonnet/pythonnet
X Title: The module has no attribute 'TCP_KEEPIDLE' · Issue #2605 · pythonnet/pythonnet
Description: my environment: python 3.13 .net: 8 win 10 my c# test code is: using (Py.GIL()) { dynamic socket = Py.Import("socket"); _messageService.Message($"socket.SO_KEEPALIVE: {socket.SO_KEEPALIVE}"); // 8 try { var tcp_keepidle = socket.TCP_KEEP...
Open Graph Description: my environment: python 3.13 .net: 8 win 10 my c# test code is: using (Py.GIL()) { dynamic socket = Py.Import("socket"); _messageService.Message($"socket.SO_KEEPALIVE: {socket.SO_KEEPALIVE}"); // 8 ...
X Description: my environment: python 3.13 .net: 8 win 10 my c# test code is: using (Py.GIL()) { dynamic socket = Py.Import("socket"); _messageService.Message($"socket.SO_KEEPALIVE: {socket.SO_KEEP...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/2605
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The module has no attribute 'TCP_KEEPIDLE'","articleBody":"my environment:\n- python 3.13\n- .net: 8\n- win 10\n\nmy c# test code is:\n\n```\n using (Py.GIL())\n {\n dynamic socket = Py.Import(\"socket\");\n _messageService.Message($\"socket.SO_KEEPALIVE: {socket.SO_KEEPALIVE}\"); // 8\n\n try\n {\n var tcp_keepidle = socket.TCP_KEEPIDLE;\n }\n catch (Exception e)\n {\n Console.WriteLine($\"socket.TCP_KEEPIDLE error: {e.Message}\");\n\n }\n }\n```\n\nMy question is why it raise exception in` var tcp_keepidle = socket.TCP_KEEPIDLE`, which shows error `socket.TCP_KEEPIDLE error: The module has no attribute 'TCP_KEEPIDLE'`.\n\nbut if I test in ipython, there is no error here in getting socket.TCP_KEEPIDLE\n\n\nmy python environment setting is \n\n```\n string py_path = Path.Combine(XSPkgPythonPath) + Path.PathSeparator.ToString(); // my local python packages\n py_path += Path.Combine(PythonEmbededPath, \"DLLs\") + Path.PathSeparator.ToString();\n py_path += Path.Combine(PythonEmbededPath, \"Lib\") + Path.PathSeparator.ToString();\n py_path += PythonEmbededPath + Path.PathSeparator.ToString();\n py_path += Path.Combine(PythonEmbededPath, \"Lib\", \"site-packages\") + Path.PathSeparator.ToString();\n py_path += Path.Combine(PythonEmbededPath, \"Lib\", \"site-packages\", \"win32\") + Path.PathSeparator.ToString();\n py_path += Path.Combine(PythonEmbededPath, \"Lib\", \"site-packages\", \"win32\", \"lib\") + Path.PathSeparator.ToString();\n py_path += Path.Combine(PythonEmbededPath, \"Lib\", \"site-packages\", \"pythonwin\");\n\n Runtime.PythonDLL = Path.Combine(PythonEmbededPath, \"python313.dll\");\n PythonEngine.PythonHome = PythonEmbededPath; \n PythonEngine.PythonPath = py_path;\n PthonEngine.Initialize();\n PythonEngine.BeginAllowThreads();\n```\n\n","author":{"url":"https://github.com/wumin199","@type":"Person","name":"wumin199"},"datePublished":"2025-07-20T09:25:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2605/pythonnet/issues/2605"}
| 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:5926c828-494a-862b-415b-e9d09c853c11 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C172:67735:175AFD6:1FB129C:6970155D |
| html-safe-nonce | 39f568882d7be83ea0271bb6df728ce53041f7ed7dee862a31b473271bff7d13 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTcyOjY3NzM1OjE3NUFGRDY6MUZCMTI5Qzo2OTcwMTU1RCIsInZpc2l0b3JfaWQiOiI0NTk4NTk2MDU1MDk0NzkzNTY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e5fead7e3c034b3f11a4c07411b09cd5784758097fa26294fc4ea7b9b31b88a9 |
| hovercard-subject-tag | issue:3246191537 |
| 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/pythonnet/pythonnet/2605/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dac6902f78cc165fb53e4d52b76bbe6aed8aae7839bd4aedfc026b989a7a8815/pythonnet/pythonnet/issues/2605 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dac6902f78cc165fb53e4d52b76bbe6aed8aae7839bd4aedfc026b989a7a8815/pythonnet/pythonnet/issues/2605 |
| og:image:alt | my environment: python 3.13 .net: 8 win 10 my c# test code is: using (Py.GIL()) { dynamic socket = Py.Import("socket"); _messageService.Message($"socket.SO_KEEPALIVE: {socket.SO_KEEPALIVE}"); // 8 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wumin199 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043a09521e81f00c45482046b3f38390b8b292cf9a86ad665a632633a072c05c |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| 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 | 98881eadf8ae73000970c42161c094b0809b1330 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width