Files
galaxy/test
Nicola Soranzo 663b7931a1 Rewrite check_html() to read a chunk of each line
Fix the following traceback during upload of files with very long lines
(e.g. JSON from Ensembl):

```
Traceback (most recent call last):
  File "/srv/galaxy/tools/data_source/upload.py", line 326, in <module>
    __main__()
  File "/srv/galaxy/tools/data_source/upload.py", line 319, in __main__
    metadata.append(add_file(dataset, registry, output_path))
  File "/srv/galaxy/tools/data_source/upload.py", line 128, in add_file
    convert_spaces_to_tabs=dataset.space_to_tab,
  File "/srv/galaxy/lib/galaxy/datatypes/upload_util.py", line 54, in handle_upload
    convert_spaces_to_tabs=convert_spaces_to_tabs,
  File "/srv/galaxy/lib/galaxy/datatypes/sniff.py", line 749, in handle_uploaded_dataset_file_internal
    if not is_binary and check_content and check_html(converted_path):
  File "/srv/galaxy/lib/galaxy/util/checkers.py", line 42, in check_html
    line = util.unicodify(line)
  File "/srv/galaxy/lib/galaxy/util/__init__.py", line 1042, in unicodify
    raise Exception(msg)
Exception: Value '...' could not be coerced to Unicode: MemoryError('')
```

Also:
- Use `with` statement to open/close files inside archives
- Add tests
2020-06-26 03:08:27 +01:00
..