OIDv4_ToolKit icon indicating copy to clipboard operation
OIDv4_ToolKit copied to clipboard

OSError: The handle is Invalid

Open silent-j opened this issue 4 years ago • 6 comments

Using the Toolkit to download a single class of images on Windows 10, Python version 3.7.6

Running the downloader commands results in a WinError 6. The traceback points towards Lines 25 of the downloader file

Traceback (most recent call last):
  File "C:\Users\James\Documents\OIDv4_ToolKit\modules\downloader.py", line 25, in download
    columns, rows = os.get_terminal_size(0)
OSError: [WinError 6] The handle is invalid

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "OIDv4_ToolKit/main.py", line 37, in <module>
    bounding_boxes_images(args, DEFAULT_OID_DIR)
  File "C:\Users\James\Documents\OIDv4_ToolKit\modules\bounding_boxes.py", line 62, in bounding_boxes_images
    download(args, df_val, folder[0], dataset_dir, class_name, class_code)
  File "C:\Users\James\Documents\OIDv4_ToolKit\modules\downloader.py", line 27, in download
    columns, rows = os.get_terminal_size(1)
OSError: [WinError 6] The handle is invalid

silent-j avatar Jan 16 '21 13:01 silent-j

i get the same error

simonm3 avatar Mar 23 '21 20:03 simonm3

Seems to work in a powershell terminal but not a bash terminal

simonm3 avatar Mar 23 '21 20:03 simonm3

I also get the same error in windows 10

dhirajkchoudhary avatar May 31 '21 10:05 dhirajkchoudhary

I can confirm that this will work in a powershell terminal but not a bash terminal.

JamesMcCullochDickens avatar Jan 04 '22 18:01 JamesMcCullochDickens

I can also confirm that you need to use Powershell in order to make it work. Bash terminal like Git Bash doesn't work. Bash terminal stops working after downloading the .csv files.

reh1548 avatar Nov 29 '22 03:11 reh1548

Me too. It works on Powershell

83Rafa avatar Jan 27 '23 17:01 83Rafa