Different image formats (06.12.2016), different errors

Hi,
I have a long python code that was working with Sentinel-2 single tile data format with long names (single tile data before 6.12.2016). After updating a few days ago to the recent versions of snappy, sen2cor, snap, etc, it is not working anymore. For the same code for data before 6.12.2016 error is :
AttributeError: 'NoneType' object has no attribute 'getSceneRasterWidth'
and for data after 6.12.2016 error is:
File "test4_3.py", line 180, in computeSnappyMasks b4.readValidMask(0, y, width, 1, v4) RuntimeError: java.lang.IllegalArgumentException: expression: Referenced rasters must be of same size

So, in my code I am using:
product = ProductIO.readProduct(filename) print product #testing width = product.getSceneRasterWidth()
and print function for long-name data gives result None, for short-name data I get org.esa.snap.core.datamodel.Product[name=S2A_MSIL2A_20170207T095151_N0204_R079_T35VLH_20170207T095148] which seems OK. Why is this so? What would be a solution for long name data? I’m sure that is the reason for the later error regarding getSceneRasterWidth.

And about the second error, relevant parts of code might be:
product = ProductIO.readProduct(filename) width = product.getSceneRasterWidth() b4 = product.getBand('B4') v4 = np.zeros(width, dtype=np.uint8) for y in range(height):

	b4.readValidMask(0, y, width, 1, v4)

I am wondering about this one because it was working before. I’ve never had a similar error.
filename is an absolute path to L2A product with extension .SAFE.

@obarrilero Do you have an idea what’s going wrong?

Hi @pandza,

what is exactly the value of ‘filename’ that you are using? I have tested some products and it is working for me…

Hi,
filename is string. In this case it is D:/S2A_MSIL2A_20170207T095151_N0204_R079_T35VLH_20170207T095148.SAFE

and for the long-name?

For long names it is also string, D:/S2A_USER_PRD_MSIL2A_PDMC_20161102T190225_R122_V20161102T100152_20161102T100152.SAFE

It seems to be right, and the code is working for me… Could you try to re-configure snappy by using "snappy-conf.bat "? Perhaps something is corrupted…