Closed hwreeves-USGS closed 7 years ago
I can't reproduce the problem on python 2.7. Could you send the files you are having a problem with.
Added conditional to test if python version is less than 3 and if windows os - if this is the case using io.open
instead of open
. This change should close the issue.
in pakbase.py, there is a section of code that tests if the version is 'nwt' and the package is "WEL". It uses f.tell() and f.seek() to check if there is a 'specify' keyword for NWT input.
With Windows and Python 2.7; the f.tell(), f.seek() does not return to the same line and I am getting a load error for a simple well file. Brian tested MacOS python 3.6 and 2.7, and Windows python 3.6 and 2.7 - only 2.7 has trouble. Evidently it might be associated with using the f = open(file) as an iterator.
I'm not sure if there is a straightforward approach that would take care of the issue for Windows and 2.7 or if that techniques is used in other places in the code.
Note that if I change the if statement so I don't check for "nwt" and skip this section, then the files I have are read in fine and the model runs.
Here is the block of code: ``if "nwt" in model.version.lower() and 'flopy.modflow.mfwel.modflowwel'.lower() in str(pack_type).lower():