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.

Author Ronny.Pfannschmidt
Recipients Ronny.Pfannschmidt
Date 2013-11-19.21:25:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384896343.05.0.723899962428.issue19658@psf.upfronthosting.co.za>
In-reply-to
Content
got:
>>> l = {}
>>> import inspect
>>> exec(compile('def fun(): pass', '', 'exec'), l, l)
>>> inspect.getsource(l['fun'])
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/private/.local/lib/python3.3/inspect.py", line 726, in getsource
    lines, lnum = getsourcelines(object)
  File "/home/private/.local/lib/python3.3/inspect.py", line 715, in getsourcelines
    lines, lnum = findsource(object)
  File "/home/private/.local/lib/python3.3/inspect.py", line 553, in findsource
    if not sourcefile and file[0] + file[-1] != '<>':
IndexError: string index out of range


expected:
>>> l = {}
>>> import inspect
>>> exec(compile('def fun(): pass', '', 'exec'), l, l)
>>> inspect.getsource(l['fun'])
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/private/.local/lib/python3.3/inspect.py", line 726, in getsource
    lines, lnum = getsourcelines(object)
  File "/home/private/.local/lib/python3.3/inspect.py", line 715, in getsourcelines
    lines, lnum = findsource(object)
  File "/home/private/.local/lib/python3.3/inspect.py", line 563, in findsource
    raise IOError('could not get source code')
OSError: could not get source code

this is a extraction, it appears that python in certein circumstances creates code objects with that setup on its own,
im still further investigating
History
Date User Action Args
2013-11-19 21:25:43Ronny.Pfannschmidtsetrecipients: + Ronny.Pfannschmidt
2013-11-19 21:25:43Ronny.Pfannschmidtsetmessageid: <1384896343.05.0.723899962428.issue19658@psf.upfronthosting.co.za>
2013-11-19 21:25:43Ronny.Pfannschmidtlinkissue19658 messages
2013-11-19 21:25:42Ronny.Pfannschmidtcreate