File tree Expand file tree Collapse file tree 8 files changed +44
-19
lines changed Expand file tree Collapse file tree 8 files changed +44
-19
lines changed Original file line number Diff line number Diff line change 11Change log
22================================================================================
33
4+ 0.5.17 - 04.04.2019
5+ --------------------------------------------------------------------------------
6+
7+ updated
8+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9+
10+ #. `#68 <https://github.com/pyexcel/pyexcel-io/issues/68 >`_: Raise IOError when
11+ the data file does not exist
12+
4130.5.16 - 19.03.2019
514--------------------------------------------------------------------------------
615
Original file line number Diff line number Diff line change 11name : pyexcel-io
22organisation : pyexcel
33releases :
4+ - changes :
5+ - action : updated
6+ details :
7+ - ' `#68`: Raise IOError when the data file does not exist'
8+ version : 0.5.17
9+ date : 04.04.2019
410- changes :
511 - action : updated
612 details :
Original file line number Diff line number Diff line change 2020copyright = 'copyright 2015-2019 Onni Software Ltd.'
2121author = 'C.W.'
2222# The short X.Y version
23- version = '0.5.16 '
23+ version = '0.6.0 '
2424# The full version, including alpha/beta/rc tags
25- release = '0.5.16 '
25+ release = '0.5.17 '
2626
2727# -- General configuration ---------------------------------------------------
2828
Original file line number Diff line number Diff line change 1010:Source code: http://github.com/pyexcel/pyexcel-io.git
1111:Issues: http://github.com/pyexcel/pyexcel-io/issues
1212:License: New BSD License
13+ :Development: |release |
1314:Released: |version |
1415:Generated: |today |
1516
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ overrides: "pyexcel.yaml"
22project : " pyexcel-io"
33name : pyexcel-io
44nick_name : io
5- version : 0.5.16
6- current_version : 0.5.16
7- release : 0.5.16
5+ version : 0.6.0
6+ current_version : 0.6.0
87copyright_year : 2015-2019
8+ release : 0.5.17
99dependencies :
1010 - ordereddict;python_version<"2.7"
1111 - lml>=0.0.4
Original file line number Diff line number Diff line change 77 :copyright: (c) 2014-2017 by Onni Software Ltd.
88 :license: New BSD License, see LICENSE for more details
99"""
10+ import os
1011import warnings
1112from types import GeneratorType
1213
13- import pyexcel_io .constants as constants
14+ from pyexcel_io ._compact import isstream , PY2
1415from pyexcel_io .plugins import READERS , WRITERS
15- from pyexcel_io ._compact import PY2 , isstream
16+ from pyexcel_io .exceptions import NoSupportingPluginFound
1617
1718
1819def iget_data (afile , file_type = None , ** keywords ):
@@ -166,7 +167,15 @@ def load_data(
166167 except AttributeError :
167168 raise Exception ("file_name should be a string type" )
168169
169- reader = READERS .get_a_plugin (file_type , library )
170+ try :
171+ reader = READERS .get_a_plugin (file_type , library )
172+ except NoSupportingPluginFound :
173+ if file_name :
174+ if not os .path .exists (file_name ):
175+ raise IOError ("%s does not exist" % file_name )
176+ else :
177+ raise
178+
170179 if file_name :
171180 reader .open (file_name , ** keywords )
172181 elif file_content :
Original file line number Diff line number Diff line change 2929
3030NAME = 'pyexcel-io'
3131AUTHOR = 'C.W.'
32- VERSION = '0.5.16 '
33- EMAIL = 'wangc_2011@hotmail.com '
32+ VERSION = '0.6.0 '
33+ EMAIL = 'info@pyexcel.org '
3434LICENSE = 'New BSD'
3535DESCRIPTION = (
3636 'A python library to read and write structured data in csv, zipped csv' +
3737 'format and to/from databases'
3838)
3939URL = 'https://github.com/pyexcel/pyexcel-io'
40- DOWNLOAD_URL = '%s/archive/0.5.16 .tar.gz' % URL
40+ DOWNLOAD_URL = '%s/archive/0.5.17 .tar.gz' % URL
4141FILES = ['README.rst' , 'CHANGELOG.rst' ]
4242KEYWORDS = [
4343 'python' ,
8181# You do not need to read beyond this line
8282PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi' .format (
8383 sys .executable )
84- GS_COMMAND = ('gs pyexcel-io v0.5.16 ' +
85- "Find 0.5.16 in changelog for more details" )
84+ GS_COMMAND = ('gs pyexcel-io v0.5.17 ' +
85+ "Find 0.5.17 in changelog for more details" )
8686NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
8787 'Please install gease to enable it.' )
8888UPLOAD_FAILED_MSG = (
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ def test_force_file_type():
2323 eq_ (expected , data [test_file ])
2424
2525
26+ @raises (IOError )
27+ def test_invalid_file ():
28+ load_data ('/something/does/not/exist' )
29+
30+
2631@raises (IOError )
2732def test_no_valid_parameters ():
2833 load_data ()
@@ -83,7 +88,7 @@ def test_write_xlsx_data_to_memory():
8388 eq_ (str (e ), msg )
8489
8590
86- @raises (exceptions . NoSupportingPluginFound )
91+ @raises (IOError )
8792def test_load_unknown_data ():
8893 get_data ("test.unknown" )
8994
@@ -108,11 +113,6 @@ def test_write_xlsx_data():
108113 get_data ("test.xlsx" )
109114
110115
111- @raises (exceptions .NoSupportingPluginFound )
112- def test_write_unknown_data ():
113- get_data ("test.unknown" )
114-
115-
116116@raises (Exception )
117117def test_writer_csvz_data_from_memory ():
118118 if not PY2 :
You can’t perform that action at this time.
0 commit comments