file_smart_open missing mode 'rb' caused error
See original GitHub issueLine 668 in def file_smart_open(fname, mode='rb', encoding=None, errors=DEFAULT_ERRORS)
in smart_open_lib.py
try: # TODO need to fix this place (for cases with r+ and so on)
raw_mode = {'r': 'rb', 'w': 'wb', 'a': 'ab'}[mode]
except KeyError:
raw_mode = mode
Should include r+ cases. Otherwise, when mode == ‘rb’, this will cause KeyError
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Rails, production-env, "Object is not missing constant"
When I've gotten this error, it's because there's an error in an inner class/module that's inside the class/module mentioned in the error.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I tried to reproduce this (for
py27
andpy36
versions), but I see no bug, everything is working fine.For this reason, I close this issue.
I was trying to load a pickle file from my local file system by using
model = KeyedVectors.load('input_model.p', mmap='r')
and then KeyError was caught, which prevents me from loading the model