smarnach/pyexiftool

OSError: [WinError 10038] An operation was attempted on something that is not a socket

Opened this issue · 9 comments

When I run the test_exiftool.py

ERROR: test_get_metadata (main.TestExifTool)

Traceback (most recent call last):
File "C:/Users/af3bd/Downloads/pyexiftool-master/pyexiftool-master/test/test_exiftool.py", line 67, in test_get_metadata
actual_data = self.et.get_metadata_batch(source_files)
File "C:\ProgramData\Anaconda3\lib\site-packages\exiftool.py", line 264, in get_metadata_batch
return self.execute_json(*filenames)
File "C:\ProgramData\Anaconda3\lib\site-packages\exiftool.py", line 256, in execute_json
return json.loads(self.execute(b"-j", *params).decode("utf-8"))
File "C:\ProgramData\Anaconda3\lib\site-packages\exiftool.py", line 227, in execute
inputready,outputready,exceptready = select.select([fd],[],[])
OSError: [WinError 10038] An operation was attempted on something that is not a socket


Ran 4 tests in 1.850s

FAILED (errors=1)

Could any one help me with this error? Thanks.

DoZh commented

same problem to me

I'm also hitting this error.

same here...

I manually replaced "exiftool.py" with this version here from a pull request:
8738ae9

it works for me now
OS: WIN 10x64
Python: Python 3.6

I suggest to merge this change to the repository.

best regards

same here...

I manually replaced "exiftool.py" with this version here from a pull request:
8738ae9

it works for me now
OS: WIN 10x64
Python: Python 3.6

I suggest to merge this change to the repository.

best regards

Wow, this works!!!!!!!

This worked for me as well. Thank you @clemens-holleis

So for those who had this fixed just by using one revision or another... it's because windows does not support the select() the way linux variants do.

Reference my fork commit to see what the fix is for your version of pyexiftool. There's a few floating around, but basically it's going to do the select.select() on non-windows platforms, but revert to the original code for win32 platforms sylikc@03a8595

same here...

I manually replaced "exiftool.py" with this version here from a pull request:
8738ae9

it works for me now
OS: WIN 10x64
Python: Python 3.6

I suggest to merge this change to the repository.

best regards

This solved the issue for me as well.

goocy commented

In case this pull request ever deviates from the main branch, you want to find %PythonDir%/lib/site-packages/exiftool.py and replace

while not output[-32:].strip().endswith(sentinel):
inputready,outputready,exceptready = select.select([fd],[],[])
for i in inputready:
if i == fd:
output += os.read(fd, block_size)

with

while not output[-32:].strip().endswith(sentinel):
if sys.platform == 'win32':
# windows does not support select() for anything except sockets
# https://docs.python.org/3.7/library/select.html
output += os.read(fd, block_size)
else:
inputready,outputready,exceptready = select.select([fd],[],[])
for i in inputready:
if i == fd:
output += os.read(fd, block_size)

Same issue for me, it would be good to merge this @smarnach, even though this lib is 9 years old