AttributeError: 'long' object has no attribute 'encode'

Sentinel-2 Level 2A Prototype Processor (Sen2Cor), 2.3.0, created: 2016.11.18 started …
selected resolution is 60 m.
Syntax error in metadata, see report file for details.
Parsing error:
Schema file: S2-PDGS-TAS-DI-PSD-V14.2_Schema\S2_PDI_Level-2A_Datastrip_Metadata.xsd
Details: Element ‘{https://psd-14.sentinel2.eo.esa.int/PSD/S2_PDI_Level-2A_Datastrip_Metadata.xsd}Level-2A_DataStrip_ID’: No matching global declaration available for the validation root. (line 0)
Progress[%]: 1.45 : PID-20136, L2A_ProcessTile: processing with resolution 60 m, elapsed time[s]: 2.169
Progress[%]: 1.45 : PID-20136, L2A_ProcessTile: start of pre processing, elapsed time[s]: 0.001
Syntax error in metadata, see report file for details.
Parsing error:
Schema file: S2-PDGS-TAS-DI-PSD-V14.2_Schema\S2_PDI_Level-1C_Tile_Metadata.xsd
Details: Element ‘{https://psd-14.sentinel2.eo.esa.int/PSD/S2_PDI_Level-1C_Tile_Metadata.xsd}Level-1C_Tile_ID’: No matching global declaration available for the validation root. (line 0)
Progress[%]: 1.47 : PID-20136, L2A_Tables: start import, elapsed time[s]: 0.042
Process L2A_ProcessTile-1:
Traceback (most recent call last):
File “C:\Anaconda2\lib\multiprocessing\process.py”, line 258, in _bootstrap
self.run()
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\L2A_ProcessTile.py”, line 129, in run
if self.process_60() == False:
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\L2A_ProcessTile.py”, line 147, in process_60
return self.process()
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\L2A_ProcessTile.py”, line 196, in process
if(self.preprocess() == False):
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\L2A_ProcessTile.py”, line 289, in preprocess
if(self.tables.importBandList() == False):
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\L2A_Tables.py”, line 1017, in importBandList
res = self.importBand(i, os.path.join(sourceDir, filename))
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\L2A_Tables.py”, line 1643, in importBand
fullRes = indataset[:]
File “C:\Anaconda2\lib\site-packages\glymur\jp2k.py”, line 1043, in getitem
return self._read()
File “C:\Anaconda2\lib\site-packages\glymur\jp2k.py”, line 1131, in _read
img = self._read_openjp2(**kwargs)
File “C:\Anaconda2\lib\site-packages\glymur\jp2k.py”, line 1309, in _read_openjp2
stream = opj2.stream_create_default_file_stream(fptr, True)
File “C:\Anaconda2\lib\site-packages\glymur\lib\openjp2.py”, line 1301, in _stream_create_default_file_stream_2p1
file_argument = ctypes.c_char_p(fname.encode())
AttributeError: ‘long’ object has no attribute ‘encode’

I don’t know what to do with this …

Hallo Allen_victory,

why you are still working with Sen2Cor version 2.3 ? I recommend first update to version 2.5 which is now available. I hope then your problem will be solved.

Bdpg

Thanks a lot, i have used this version successfully, so i don’t know why it can’t work now, i would try the new version.
Great thanks!

May be, there had been any (small) product format changes which are not included in this old version - I don’t remember exactly when changes occured.
Nevertheless I strongly recommend working wiht the latest Sen2Cor version because there had been many performance improvements since version 2.3. You may look to the presentations at the S2VT-meeting for more information about Sen2Cor performance and its improvement.

bdpg

Alright, I’ll try it later to find out if it could work. Thanks! :blush: