➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 RomainGeissler1A
收信人 Kevin.Harms, RomainGeissler1A, brett.cannon, dmalcolm, docs@python, eric.araujo, jankratochvil, meador.inge, ncoghlan, r.david.murray
日期 2018-10-28.18:50:52
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1540752652.48.0.788709270274.issue14956@psf.upfronthosting.co.za>
In-reply-to
内容
Hi,

Just updating this 6 year old bug report. The last comment says it's not possible to ignore environment when using the C-API. I don't know back then, but today it is possible. I have just built gdb 8.2 against python 3.7.1, and patched gdb with this simple patch, which apparently works:

--- gdb/python/python.c
+++ gdb/python/python.c
@@ -1726,6 +1726,9 @@
 #endif
 #endif

+  // Force using the toolchain python without being troubled by $PYTHONHOME or $PYTHONPATH.
+  Py_IgnoreEnvironmentFlag = 1;
+
   Py_Initialize ();
   PyEval_InitThreads ();

Cheers,
Romain
历史
日期 用户 动作 参数
2018-10-28 18:50:52RomainGeissler1A修改recipients: + RomainGeissler1A, brett.cannon, ncoghlan, eric.araujo, r.david.murray, dmalcolm, meador.inge, jankratochvil, docs@python, Kevin.Harms
2018-10-28 18:50:52RomainGeissler1A修改messageid: <1540752652.48.0.788709270274.issue14956@psf.upfronthosting.co.za>
2018-10-28 18:50:52RomainGeissler1A链接issue14956 messages
2018-10-28 18:50:52RomainGeissler1A创建