Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AJFeng opened this issue Jan 23, 2019 · 9 comments

Comments

@AJFeng
Copy link

AJFeng commented Jan 23, 2019

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
Copy link

DoZh commented Feb 7, 2019

same problem to me

@chazmorantz
Copy link

I'm also hitting this error.

@clemens-holleis
Copy link

clemens-holleis commented Mar 20, 2019

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

@AJFeng
Copy link
Author

AJFeng commented Jun 14, 2019

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

@brandonmaul
Copy link

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

@sylikc
Copy link

sylikc commented Jul 31, 2019

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

@LKirst
Copy link

LKirst commented Jul 6, 2020

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
Copy link

goocy commented Sep 27, 2020

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)

@mchaptel
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants