[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2015-03-03 Thread Jan Kratochvil

Jan Kratochvil added the comment:

It even crashes applications due to pollution of dynamic symbols namespace by 
application symbols as seen in:
  https://bugzilla.redhat.com/show_bug.cgi?id=1198158

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10112
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14956] custom PYTHONPATH may break apps embedding Python

2012-05-30 Thread Jan Kratochvil

Jan Kratochvil jan.kratoch...@redhat.com added the comment:

While it should be documented this is not only a docs issue.  It should be 
solved in some way during runtime.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14956] custom PYTHONPATH breaks Python-embedded apps

2012-05-29 Thread Jan Kratochvil

New submission from Jan Kratochvil jan.kratoch...@redhat.com:

People use custom Python builds setting PYTHONHOME and PYTHONPATH to these 
custom builds. This may be expected to break running system Python binary but 
it also unexpectedly breaks various applications which also embed Python:

$ echo foo site.py; export PYTHONPATH=.
$ gdb
Traceback (most recent call last):
  File ./site.py, line 1, in module
foo
NameError: name 'foo' is not defined
$ _

It is not obvious to the user who even already forgot about custom PYTHONPATH 
why GDB breaks.

Standard Fedora applications may link with system libpython incompatible with 
the PYTHONHOME/PYTHONPATH files for the other Python version. Python does not 
keep the scripts too compatible across Python versions.

This issues was discussed first for GDB upstream:
[RFA] ignore PYTHONHOME environment variable.
http://sourceware.org/ml/gdb-patches/2010-11/msg00328.html
http://sourceware.org/ml/gdb-patches/2010-12/msg00214.html
http://sourceware.org/ml/gdb-patches/2011-01/msg00307.html
http://sourceware.org/ml/gdb-patches/2012-05/msg00710.html
(first mail of the thread in each month)
Then also in Fedora:
https://fedorahosted.org/fesco/ticket/858
This Python issue would not be filed by the user if it gets resolved:
Issue12140

Exactly the same problem exists for many other apps, yum for all

$ echo foo site.py; PYTHONPATH=. yum list bash
Traceback (most recent call last):
  File ./site.py, line 1, in module
foo
NameError: name 'foo' is not defined
$ _

Various proposal have been, applicable possibly in some combination together:

 * Ignore PYTHONHOME/PYTHONPATH for embedded applications. (dot)
 * Ignore PYTHONHOME, use only GDB_PYTHONHOME (if set). This proposal is not 
applicable for all applications in general.
 * Print warning if PYTHONHOME/PYTHONPATH is set.
 * Recover from Python startup failure and suppress the environment vars.
   or Recover from Python startup failure and disable the Python support, if 
possible.
 * Should the special care affect PYTHONHOME? Differently for PYTHONPATH? What 
about PYTHONVERBOSE and other PYTHON* settings? 

How should get PYTHONHOME/PYTHONPATH inherited into child processes, if any 
(debuggees in the GDB case).

Another question is whether the behavior should be the same if upstream 
application has been linked with non-system libpython location.

--
components: Interpreter Core
messages: 161906
nosy: dmalcolm, jankratochvil
priority: normal
severity: normal
status: open
title: custom PYTHONPATH breaks Python-embedded apps
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14956] custom PYTHONPATH breaks Python-embedded apps

2012-05-29 Thread Jan Kratochvil

Jan Kratochvil jan.kratoch...@redhat.com added the comment:

This site.py is only an example how it can happen.  In reality it is due to .py 
files intended for incompatible version of Python.  I am not a Python 
programmer to have some appropriate incompatible code at hand.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14956] custom PYTHONPATH may break apps embedding Python

2012-05-29 Thread Jan Kratochvil

Jan Kratochvil jan.kratoch...@redhat.com added the comment:

I fully agree with site.py/os.py/spam.py but I find it offtopic for this Issue.

I do not find too important if some unsetenv/setenv gets called by the app or 
by libpython.  But the rules should apply for every embedded app the same, the 
Fedora ticket is suggesting new PEP (Informational) for it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2012-02-19 Thread Jan Kratochvil

Jan Kratochvil jan.kratoch...@redhat.com added the comment:

There was a bug for non-shared build of Python, thanks.

This patch is an improvement on its but it is not yet complete.
One should also replace -Xlinker -export-dynamic by -Wl,--dynamic-list so 
that linking application with libpython is no longer intrusive.

But I found out GDB does not need to be affected by this Bug.  When I use 
-fvisibility=hidden for GDB .c files then -Xlinker -export-dynamic has no 
longer any negative effect (GDB was using only -Wl,--dynamic-list now which 
works without libpython but not with libpython). Therefore I no longer mind 
much about this Bug.

Still at least:
1771024 libpython2.7.so.1.0
-
1757776 libpython2.7.so.1.0

Even with clean tree the upstream build generates for me:
Python build finished, but the necessary bits to build these modules were not 
found:
_bsddb _ssl   bsddb185
dl imageopsunaudiodev

(so sunaudiodev.c was changed without any testing of it)

--
Added file: http://bugs.python.org/file24575/hidden4.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10112
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2012-02-19 Thread Jan Kratochvil

Changes by Jan Kratochvil jan.kratoch...@redhat.com:


Removed file: http://bugs.python.org/file24221/hidden.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10112
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2012-02-15 Thread Jan Kratochvil

Jan Kratochvil jan.kratoch...@redhat.com added the comment:

What more can be done to get it fixed?  I do not mind Python but GDB linking is 
broken due to it.  And while I can workaround it in GDB I am not used for 
workarounding one Free package in another Free package.  Free software has the 
advantage problems can be fixed at the right place.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10112
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2012-01-12 Thread Jan Kratochvil

Jan Kratochvil jan.kratoch...@redhat.com added the comment:

Here is the implementation.

Python/getargs.c was modified for:
ImportError: /usr/lib64/python2.7/lib-dynload/fcntlmodule.so: undefined symbol: 
_PyArg_ParseTuple_SizeT
but I guess that patch part should be different.  There is no need to do #ifdef 
HAVE_DECLSPEC_DLL as PyAPI_FUNC is properly defined even without it.  So the 
declaration+export block should be unified there.

The Modules/ files were modified for:
*** WARNING: renaming _ctypes_test since importing it failed: dynamic module 
does not define init function (init_ctypes_test)
*** WARNING: renaming _elementtree since importing it failed: dynamic module 
does not define init function (init_elementtree)
*** WARNING: renaming _hotshot since importing it failed: dynamic module does 
not define init function (init_hotshot)
*** WARNING: renaming _json since importing it failed: dynamic module does 
not define init function (init_json)
*** WARNING: renaming ossaudiodev since importing it failed: dynamic module 
does not define init function (initossaudiodev)

without this patch:
-rw-r--r-- 1 jkratoch jkratoch 5775829 Jan 12 17:42 
python-libs-2.7.2-18.fc17.x86_64.rpm
-r-xr-xr-x 1 jkratoch jkratoch 1738264 Jan 12 17:44 
./clean/python-libs-2.7.2-18.fc17.x86_64/usr/lib64/libpython2.7.so.1.0*
1226 libpython2.7.so.1.0 .dynsym exports
+
-rw-r--r-- 1 jkratoch jkratoch 1986161 Jan 12 17:48 
gdb-7.4.50.20120103-8.fc17.x86_64.rpm
-rwxr-xr-x 1 jkratoch jkratoch 5018800 Jan 12 19:13 
clean/gdb-7.4.50.20120103-8.fc17.x86_64/usr/bin/gdb*

with this patch:
-rw-r--r-- 1 jkratoch jkratoch 5762537 Jan 12 19:04 
python-libs-2.7.2-18hidden3.fc17.x86_64.rpm
-r-xr-xr-x 1 jkratoch jkratoch 1720920 Jan 12 19:06 
./hidden3/python-libs-2.7.2-18hidden3.fc17.x86_64/usr/lib64/libpython2.7.so.1.0*
1046 libpython2.7.so.1.0 .dynsym exports
+
-rw-r--r-- 1 jkratoch jkratoch 1886781 Jan 12 19:11 
gdb-7.4.50.20120103-8.fc17.x86_64.rpm
-rwxr-xr-x 1 jkratoch jkratoch 4732080 Jan 12 19:13 
hidden3/gdb-7.4.50.20120103-8.fc17.x86_64/usr/bin/gdb*

--
keywords: +patch
versions: +Python 2.7 -Python 3.2
Added file: http://bugs.python.org/file24221/hidden.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10112
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2010-10-15 Thread Jan Kratochvil

New submission from Jan Kratochvil jan.kratoch...@redhat.com:

FSF GDB (and future Fedora GDBs) became 250KB smaller than before.  Python 
recently disabled this GDB build optimization so GDB is 250KB larger again.

-rwxr-xr-x 1 4524488 gdb-7.1-19.fc13.x86_64/usr/bin/gdb
-rwxr-xr-x 1 4266728 gdb-7.1-19dynamiclist.fc13.x86_64/usr/bin/gdb
-rw-r--r-- 1 2364656 gdb-7.1-19.fc13.x86_64.rpm
-rw-r--r-- 1 2274300 gdb-7.1-19dynamiclist.fc13.x86_64.rpm

Some Python binaries/libraries could probably also benefit from smaller 
pageable code image.

GDB regressed due to /usr/lib*/python*/config/Makefile contains:
  LINKFORSHARED=-Xlinker -export-dynamic

and GDB thus has to use it even for its own link, effectively disabling its:
  -Wl,--dynamic-list=./proc-service.list

AFAIK Python already contains the required exports list but it is used only on 
MS-Windows.  It should be utilized even for GNU/Linux builds.

--
components: Library (Lib)
messages: 118756
nosy: dmalcolm, jankratochvil
priority: normal
severity: normal
status: open
title: Use -Wl,--dynamic-list=x.list, not -Xlinker -export-dynamic
type: resource usage
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10112
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10057] Unclear if exception should be set

2010-10-09 Thread Jan Kratochvil

New submission from Jan Kratochvil jan.kratoch...@redhat.com:

http://docs.python.org/py3k/c-api/object.html
PyObject_GetItem
Return element [...] or NULL on failure.

Found element = return its pointer.
Found no element = return NULL (with no exception set).

But it is unclear whether the function can also:
Error happened = return NULL with an exception set.

It affects multiple versions of the doc, did not check which all.

--
assignee: d...@python
components: Documentation
messages: 118281
nosy: d...@python, jankratochvil
priority: normal
severity: normal
status: open
title: Unclear if exception should be set
versions: Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10057
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10057] Unclear if exception should be set

2010-10-09 Thread Jan Kratochvil

Jan Kratochvil jan.kratoch...@redhat.com added the comment:

OK, I am not used to Python, thanks.

--
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10057
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4434] Embedding into a shared library fails

2010-06-05 Thread Jan Kratochvil

Changes by Jan Kratochvil jan.kratoch...@redhat.com:


--
nosy: +jankratochvil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4434
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7015] Getting call trace while executing modules spam at help prompt

2009-09-30 Thread Jan Kratochvil

Changes by Jan Kratochvil jan.kratoch...@redhat.com:


--
nosy: +jankratochvil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7015
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com