fohrloop / dash-uploader

The alternative upload component for python Dash applications.
MIT License
141 stars 29 forks source link

Dash-uploader adds empty line to files, seems a dependency issue #120

Closed sorenwacker closed 3 months ago

sorenwacker commented 1 year ago

I am running to a strange error. After uploading the files the files start with an empty line. I get this behaviour with the same version of dash-uploader.

Before:

"""
<?xml version="1.0" encoding="ISO-8859-1"?>
<mzXML xmlns="http://sashimi.sourceforge.net/schema_revision/mzXML_3.2"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://sashimi.sourceforge.net/schema_revision/mzXML_3.2 http://sashimi.sourceforge.net/schema_revision/mzXML_3.2/mzXML_idx_3.2.xsd">
  <msRun scanCount="989" startTime="PT0.57413S" endTime="PT721.539S">
    <parentFile fileName="file:///D:\QEHF\LRG\Thomas\2018_01_04TR/2017_12_22TR_HILICneg15_CLS_P5_2017_11_26_T4_I681.raw"
                fileType="RAWData"
                fileSha1="6fcdc80c069b7be9743a63a229e02fc3ec6447e2"/>
    <msInstrument msInstrumentID="1">
...
"""

After:

"""

<?xml version="1.0" encoding="ISO-8859-1"?>
<mzXML xmlns="http://sashimi.sourceforge.net/schema_revision/mzXML_3.2"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://sashimi.sourceforge.net/schema_revision/mzXML_3.2 http://sashimi.sourceforge.net/schema_revision/mzXML_3.2/mzXML_idx_3.2.xsd">
  <msRun scanCount="989" startTime="PT0.57413S" endTime="PT721.539S">
    <parentFile fileName="file:///D:\QEHF\LRG\Thomas\2018_01_04TR/2017_12_22TR_HILICneg15_CLS_P5_2017_11_26_T4_I681.raw"
                fileType="RAWData"
                fileSha1="6fcdc80c069b7be9743a63a229e02fc3ec6447e2"/>
    <msInstrument msInstrumentID="1">
...
"""

Versions, adding empty line after upload:

- dash==2.9.3
- dash-bootstrap-components==1.4.1
- dash-core-components==2.0.0
- dash-extensions==0.1.3
- dash-html-components==2.0.0
- dash-table==5.0.0
- dash-tabulator==0.4.2
- dash-uploader==0.7.0a1

Versions, files unchanged (expected behaviour):

- dash==2.8.1
- dash-bootstrap-components==1.4.0
- dash-core-components==2.0.0
- dash-extensions==0.1.3
- dash-html-components==2.0.0
- dash-table==5.0.0
- dash-tabulator==0.4.2
- dash-uploader==0.7.0a1

The behaviour might come from some other libraries installed.

sorenwacker commented 1 year ago

In addition, new lines are introduced inside the uploaded files:

            </binaryDataArray>
          </binaryDataArrayList>
        </spectrum>
        <sp
ectrum index="1154" id="controllerType=0 controllerNumber=1 scan=1155" defaultArrayLength="894">
          <cvParam cvRef="MS" accession="MS:1000511" name="ms level" value="1"/>
          <cvParam cvRef="MS" accession="MS:1000129" name="negative scan" value=""/>
          <cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value=""/>

Should be:

            </binaryDataArray>
          </binaryDataArrayList>
        </spectrum>
        <spectrum index="1154" id="controllerType=0 controllerNumber=1 scan=1155" defaultArrayLength="894">
          <cvParam cvRef="MS" accession="MS:1000511" name="ms level" value="1"/>
          <cvParam cvRef="MS" accession="MS:1000129" name="negative scan" value=""/>
          <cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value=""/>
sorenwacker commented 1 year ago

Setting the chunksize to 50 removes the empty lines within the files but keeps the empty line in the beginning. One file is around 10 - 20 MB.

sorenwacker commented 1 year ago

Using werkzeug==2.2.3 seems to fix it.

davidism commented 1 year ago

If you can find a minimal reproducing example with Werkzeug only, can you report it there? This is the second report I've seen of this, but I can't reproduce it with a simple example.

davidism commented 1 year ago

Reported at https://github.com/pallets/werkzeug/issues/2675