Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dl_bt_dukascopy.py: EOFError: Compressed file ended before the end-of-stream marker was reached #3

Open
kenorb opened this issue Sep 5, 2015 · 7 comments

Comments

@kenorb
Copy link
Member

kenorb commented Sep 5, 2015

Command:

./dl_bt_dukascopy.py -y 2013 -p EURUSD -c

Traceback:

Converting into CSV (download/EURUSD/2013-01-07--01h_ticks.csv)...
Traceback (most recent call last):
  File "./dl_bt_dukascopy.py", line 159, in <module>
    ds.bt5_to_csv()
  File "./dl_bt_dukascopy.py", line 102, in bt5_to_csv
    data = f.read()
  File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lzma.py", line 310, in read
    return self._read_all()
  File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lzma.py", line 251, in _read_all
    while self._fill_buffer():
  File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lzma.py", line 225, in _fill_buffer
    raise EOFError("Compressed file ended before the "
EOFError: Compressed file ended before the end-of-stream marker was reached

It happens randomly. In this case, it happens for: 2013-01-07--01h_ticks.bi5 specifically.

@kenorb kenorb added the bug label Sep 5, 2015
@kenorb
Copy link
Member Author

kenorb commented Sep 9, 2015

Fixed and merged.

@kenorb kenorb closed this as completed Sep 9, 2015
@kenorb kenorb reopened this Jan 8, 2016
@kenorb
Copy link
Member Author

kenorb commented Jan 8, 2016

Still there is a problem:

./dl_bt_dukascopy.py -c -p AUDJPY -y 2007 -m 10
Downloading http://www.dukascopy.com/datafeed/AUDJPY/2007/09/25/02h_ticks.bi5 into: download/dukascopy/AUDJPY/2007/10/2007-10-25--02h_ticks.bi5...
File (download/dukascopy/AUDJPY/2007/10/2007-10-25--02h_ticks.bi5) exists, so skipping.
Converting into CSV (download/dukascopy/AUDJPY/2007/10/2007-10-25--02h_ticks.csv)...
Traceback (most recent call last):
  File "./dl_bt_dukascopy.py", line 169, in <module>
    ds.bt5_to_csv()
  File "./dl_bt_dukascopy.py", line 110, in bt5_to_csv
    data = f.read()
  File "/usr/local/lib/python3.2/dist-packages/backports/lzma/__init__.py", line 287, in read
    return self._read_all()
  File "/usr/local/lib/python3.2/dist-packages/backports/lzma/__init__.py", line 236, in _read_all
    while self._fill_buffer():
  File "/usr/local/lib/python3.2/dist-packages/backports/lzma/__init__.py", line 223, in _fill_buffer
    raise EOFError("Compressed file ended before the "
EOFError: Compressed file ended before the end-of-stream marker was reached
$ python3 --version
Python 3.2.3

Any clues?

@kenorb kenorb assigned ghost Jan 8, 2016
@ghost
Copy link

ghost commented Jan 10, 2016

As I experienced, the ideal lzma._BUFFER_SIZE value (which doesn't cause EOFError exception) varies from Python version to Python version, so it's different for e.g. Python 3.2.x and 3.4.x. The solutions could be:

  1. try different values with different Python versions, or
  2. create a fix/workaround in upstream Python code.

@ghost
Copy link

ghost commented Jan 11, 2016

or
3. call lzma decompressor externally from the script until LZMA API is fixed in Python.

@kenorb
Copy link
Member Author

kenorb commented Feb 24, 2016

PR: #35

@kenorb kenorb closed this as completed Feb 24, 2016
@kenorb
Copy link
Member Author

kenorb commented May 23, 2016

@kenorb kenorb reopened this May 23, 2016
@kenorb kenorb assigned lu43n and unassigned ghost May 23, 2016
@kenorb kenorb added the on-hold label Jun 13, 2016
lucasbodek pushed a commit to lucasbodek/FX-BT-Scripts that referenced this issue Oct 30, 2016
MT now performs fully automatic EA simulation and creates proper report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants