Opened 14 years ago

Closed 14 years ago

#3204 closed defect (fixed)

Python wrapper is incorrectly trimming metadata’s leading white space

Reported by: thchiou Owned by: Even Rouault
Priority: normal Milestone: 1.7.0
Component: PythonBindings Version: unspecified
Severity: normal Keywords:
Cc:

Description

Problem is identified while working with NITF files. Basically some of the NITF data in “TRE” domain can contain leading white space. However, if you read those data in Python use “GetMetadata(“TRE”)”, the returned data has leading white space trimmed. Moreover, if you use “GetMetadata(“an item”,”TRE”), the correct result with leading white space is returned.

A fix based on ticket:3088’s fix r17559 is attached. The fix basically parses the buffer itself instead of using “CPLParseNameValue”, which removes leading spaces.

Attachments (2)

gdal_wrap.cpp (600.5 KB ) - added by thchiou 14 years ago.
gdal_wrap.cpp under swig/python/extensions
gdal_wrap.diff (651 bytes ) - added by thchiou 14 years ago.
diff file

Download all attachments as: .zip

Change History (4)

by thchiou, 14 years ago

Attachment: gdal_wrap.cpp added

gdal_wrap.cpp under swig/python/extensions

by thchiou, 14 years ago

Attachment: gdal_wrap.diff added

diff file

comment:1 by Even Rouault, 14 years ago

Owner: changed from hobu to Even Rouault
Status: newassigned

comment:2 by Even Rouault, 14 years ago

Milestone: 1.7.0
Resolution: fixed
Status: assignedclosed

Fixed in trunk (r17951). Test adapted in r17952

Note: See TracTickets for help on using tickets.