pyexiftool icon indicating copy to clipboard operation
pyexiftool copied to clipboard

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

Open AJFeng opened this issue 6 years ago • 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.

AJFeng avatar Jan 23 '19 15:01 AJFeng

same problem to me

DoZh avatar Feb 07 '19 03:02 DoZh

I'm also hitting this error.

chazmorantz avatar Mar 14 '19 06:03 chazmorantz

same here...

I manually replaced "exiftool.py" with this version here from a pull request: https://github.com/smarnach/pyexiftool/pull/25/commits/8738ae963afc784fcef76de6bcebf277a58379ab

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

I suggest to merge this change to the repository.

best regards

clemens-holleis avatar Mar 20 '19 04:03 clemens-holleis

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!!!!!!!

AJFeng avatar Jun 14 '19 16:06 AJFeng

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

brandonmaul avatar Jun 24 '19 02:06 brandonmaul

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 https://github.com/sylikc/pyexiftool/commit/03a8595a2eafc61ac21deaa1cf5e109c6469b17c

sylikc avatar Jul 31 '19 01:07 sylikc

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.

LKirst avatar Jul 06 '20 19:07 LKirst

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)

goocy avatar Sep 27 '20 09:09 goocy

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

mchaptel avatar Feb 11 '21 10:02 mchaptel