thegooglecodearchive / pydicom

Automatically exported from code.google.com/p/pydicom
0 stars 0 forks source link

Recursion error when printing out a DICOM file contents #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This error has been introduced between v0.9.3 and v0.9.4, with the changes
made in the __getitem__ and __setitem__ methods of the Dataset dictionary
object.

When I'm opening all my DICOM files and if I'm printing out their contents,
I get a recursion error -- see the simple test attached.

I've replaced line 255 (dataset.py) by the following:

dict.__setitem__(self, tag, DataElement_from_raw(data_elem))

but I really didn't have the time to look further -- it could be a
nonsense. However, it's quite clear that when you assign the value with
'self[tag] = value', you will call the method __setitem__ leading to an
infinite loop in this case.

Original issue reported on code.google.com by pierre.raybaut on 12 Apr 2010 at 11:35

Attachments:

GoogleCodeExporter commented 9 years ago
Update: please ignore the second error in traceback* (it's related to Spyder's
external console and it has nothing to do with this bug -- I've also tested this
outside any IDE, in a simple Python interpreter).

(*) This error has to be ignored in the attached file:
  File "D:\Python\spyder\spyderlib\widgets\externalshell\sitecustomize.py",
line 43, in displayhook
    sys.__displayhook__(obj)

Original comment by pierre.raybaut on 12 Apr 2010 at 11:42

GoogleCodeExporter commented 9 years ago
Hi Pierre, 
Julien Lamy has apparently fixed this recursion error in a personal clone [1] 
-- just by adding a check for the 
private_creator tag in __setitem__. I'm working on merging this and the other 
changes in that clone with the 
mainline code. Once that is done, I'll push it up to the repository.

[1] http://code.google.com/r/lamy-pydicom/source/detail?r=f54d9aa6b3

Original comment by darcymason@gmail.com on 13 Apr 2010 at 4:37

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 14894de0a4.

Original comment by darcymason@gmail.com on 14 Apr 2010 at 1:42