errno

Errno::ENOENT: No such file or directory ruby

匿名 (未验证) 提交于 2019-12-03 02:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting the following error: "Errno::ENOENT: No such file or directory" when I try to download a file into a directory that does not exist. For example: ftp = Net::FTP.new('example.com') ftp.login files = ftp.chdir('pub/lang/ruby/contrib') files = ftp.list('n*') ftp.getbinaryfile('nif.rb-0.91.gz', 'pub/lang/ruby/contrib/nif.gz', 1024) ftp.close However, for many of the files I will be downloading, the full directory path will not exist. For example, until the first file creates pub, it won't exist and this goes for lang/ruby/contrib too

Cannot connect to MongoDB errno:61

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I installed MongoDB using macports and tried running the mongo command in order to start the mongo shell. I received the following errors: warning: Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146 I then ran mongod and received the following error: $ [initandlisten] MongoDB starting : pid=11984 port=27017 dbpath=/data/db 64-bit host=Nikitas-MacBook-Air.local $ [initandlisten] $ [initandlisten] **

gaierror: [Errno 8] nodename nor servname provided, or not known (with macOS Sierra)

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: socket.gethostbyname(socket.gethostname()) worked well on OS X El Capitan. However, it's not working now after the Mac updated to macOS Sierra. Thanks! import socket socket.gethostbyname(socket.gethostname()) Traceback (most recent call last): File "<pyshell#26>", line 1, in <module> socket.gethostbyname(socket.gethostname()) gaierror: [Errno 8] nodename nor servname provided, or not known 回答1: There is an answer in OP's comments based on another question, which requires to edit /etc/hosts , i.e echo 127.0.0.1 $HOSTNAME >> /etc/hosts .

Python handling socket.error: [Errno 104] Connection reset by peer

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When using Python 2.7 with urllib2 to retrieve data from an API, I get the error [Errno 104] Connection reset by peer . Whats causing the error, and how should the error be handled so that the script does not crash? ticker.py def urlopen(url): response = None request = urllib2.Request(url=url) try: response = urllib2.urlopen(request).read() except urllib2.HTTPError as err: print "HTTPError: {} ({})".format(url, err.code) except urllib2.URLError as err: print "URLError: {} ({})".format(url, err.reason) except httplib.BadStatusLine as err:

IOError: [Errno 2] No such file or directory Python

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have this piece of code, trying to find *.vm files, and send them to another module i did, which supposed to read the lines. this is the main file: def VMTranslte(fileName): print "FILEOVER ",fileName from parser import Parser from codeWriter import CodeWriter if (fileName[-3:] == ".vm"): outputFile = fileName[:-3]+".asm" myWrite = CodeWriter(outputFile) myWrite.setFileName(fileName) myParser = Parser(fileName) myWrite.setFileName(fileName); translate(myParser,myWrite) else: if fileName[-1:] == "/": <===== CHECKS FOR DIRECTORY mystr =

Python on Windows: IOError: [Errno 2] No such file or directory

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: First of all, I'm very new to Python and programming in general. Currently I'm trying to create a script that will remove all files with random names, extensions and content in the folder according to the lines from the blacklist (search must be done in the files' content). Here is a code: import os black_list = [line for line in open("C:/path/to/blacklist.txt")] for filename in os.listdir("C:/path/to/files/"): content = open(filename).read() if any(line in content for line in black_list): os.remove(filename) I'm getting this error: IOError:

(python) [Errno 11001] getaddrinfo failed

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Can someone help me on how I can catch this error? import pygeoip gi = pygeoip.GeoIP('GeoIP.dat') print gi.country_code_by_name('specificdownload.com') Traceback (most recent call last): File "<module1>", line 14, in <module> File "build\bdist.win-amd64\egg\pygeoip\__init__.py", line 447, in country_code_by_name addr = self._gethostbyname(hostname) File "build\bdist.win-amd64\egg\pygeoip\__init__.py", line 392, in _gethostbyname return socket.gethostbyname(hostname) gaierror: [Errno 11001] getaddrinfo failed 回答1: Well, let’s ask Python what

Python socket.error: [Errno 13] Permission denied

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using Linux and Python, I want to send some data with broadcast: d = b'109u433279423423423' import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.sendto(d, 0, ('192.168.0.255', 9)) I launch this script under root and get this error: s.sendto(d, 0, ('192.168.0.255', 9)) socket.error: [Errno 13] Permission denied What is wrong? 回答1: You are trying to send to a broadcast address. It is not allowed, see manpage for sendto(2): EACCES (For UDP sockets) An attempt was made to send to a network/broadcast address as though it was a

Region: IOError: [Errno 22] invalid mode ('w') or filename

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm not sure why, but for some reason, whenever I have "region" in the file name of the output file, it gives me this error: IOError: [Errno 22] invalid mode ('w') or filename: 'path\regionlog.txt' It does this for "region.txt" , "logregion.txt" , etc. class writeTo : def __init__ ( self , stdout , name ): self . stdout = stdout self . log = file ( name , 'w' ) #here is where it says the error occurs output = os . path . abspath ( 'path\regionlog.txt' ) writer = writeTo ( sys . stdout , output ) #and here too Why is this? I really

requests.exceptions.SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have tried everything on this q&a to solve it but I still receive that error. My latest attempt is based on Lukasa's comment and my code looks like this: import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.poolmanager import PoolManager import ssl class MyAdapter(HTTPAdapter): def init_poolmanager(self, connections, maxsize, block=False): self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize, block=block, ssl_version=ssl.PROTOCOL_TLSv1) proxy = 'https://78.130.136.2:8080' g = 'https:/