errno

OSError: [Errno 98] Address already in use

荒凉一梦 提交于 2019-11-28 19:25:10
场景:在linux主机上命令行运行flask项目 /data/dev/mjy/WWS/venv/bin/python3.5 -u /data/dev/mjy/WWS/WWSMGM/run.py runserver -h 0.0.0.0 -p 7001 然后报错:“OSError: [Errno 98] Address already in use” 解决方法: lsof -i:7001 kill -9 98005 98429 然后杀死查出的进程,再次用命令行运行程序,成功 来源: https://www.cnblogs.com/We612/p/11422636.html

How to catch Errno::ECONNRESET class in “case when”?

偶尔善良 提交于 2019-11-28 19:11:57
My application (Ruby 1.9.2) may raise different exceptions, including net-connection breaks. I rescue Exception => e , then do case/when to handle them in defferent ways, but several errors go through my cases straight to else . rescue Exception => e p e.class case e.class when Errno::ECONNRESET p 1 when Errno::ECONNRESET,Errno::ECONNABORTED,Errno::ETIMEDOUT p 2 else p 3 end end Prints: Errno::ECONNRESET 3 This is because of how the === operator works on the class Class The case statement internally calls the === method on the object you are evaluating against. If you want to test for e class,

Python_报错:PermissionError: [Errno 13] Permission denied: 'XXXXX.xlsx'

ⅰ亾dé卋堺 提交于 2019-11-28 18:52:10
Python_报错: D:\Python36\python.exe D:/test_excel/excel_001.py Traceback (most recent call last): File "D:/test_excel/excel_001.py", line 14, in <module> wb.save("e:\\sample.xlsx") File "D:\Python36\lib\site-packages\openpyxl\workbook\workbook.py", line 367, in save save_workbook(self, filename) File "D:\Python36\lib\site-packages\openpyxl\writer\excel.py", line 282, in save_workbook archive = ZipFile(filename, 'w', ZIP_DEFLATED, allowZip64=True) File "D:\Python36\lib\zipfile.py", line 1090, in __init__ self.fp = io.open(file, filemode) PermissionError: [Errno 13] Permission denied: 'e:\\sample

Is &errno legal C?

ぃ、小莉子 提交于 2019-11-28 17:21:49
问题 Per 7.5, [errno] expands to a modifiable lvalue175) that has type int, the value of which is set to a positive error number by several library functions. It is unspecified whether errno is a macro or an identifier declared with external linkage. If a macro definition is suppressed in order to access an actual object, or a program defines an identifier with the name errno, the behavior is undefined. 175) The macro errno need not be the identifier of an object. It might expand to a modifiable

MySQL: Error dropping database (errno 13; errno 17; errno 39)

纵饮孤独 提交于 2019-11-28 15:56:10
问题 I failed to drop a database: mysql> drop database mydb; ERROR 1010 (HY000): Error dropping database (can't rmdir './mydb', errno: 39) Directory db/mydb exists in mysql tree but has no table: # ls -l db/mydb -rw-rw---- mysql mysql HIS_STAT.MYD -rw-rw---- mysql mysql HIS_STAT.MYI What should I do? 回答1: Quick Fix If you just want to drop the database no matter what (but please first read the whole post: the error was given for a reason , and it might be important to know what the reason was!),

epoll完整例子

会有一股神秘感。 提交于 2019-11-28 13:45:48
#include <deque> #include <map> #include <vector> #include <pthread.h> #include <semaphore.h> #include <time.h> #include <sys/time.h> #include <sys/shm.h> #include <errno.h> #include <sys/types.h> #include <fcntl.h> #include <stdio.h> #include <string> #include <cstdio> #include <unistd.h> #include <signal.h> #include <sys/types.h> #include <sys/stat.h> #include <cstdlib> #include <cctype> #include <sstream> #include <utility> #include <stdexcept> #include <sys/socket.h> #include <sys/epoll.h> #include <netinet/in.h> #include <arpa/inet.h> #include <iostream> #include <signal.h> using

mkdir fails with tilde on OS X in C?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 11:00:13
问题 I'm porting a C library to OSX which haven't given me much of a headache until now. In the next function: int createDirectory( char *directory ){ int error; error = mkdir(directory, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); if( error < 0 ){ if( errno != EEXIST ){ return errno; } } return error; } No matter what directory is, mkdir() always fails with EPERM (Operation not permitted). I'm not sure if the xcode executable is sandboxed or if I'm missing something, but every path I pass to the

errno set in child process after fork - OSX

筅森魡賤 提交于 2019-11-28 08:47:17
问题 here's a weird thing I found today on Mac OSX. After a fork, which has succeeded, errno is set at 0 in the father's process (as expected), but set at 22 in the child process. Here's the source-code : #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> int main(int nbArgs, char** args){ int pid; errno = 0; printf("Errno value before the call to fork : %d.\n", errno); if ((pid = fork()) == -1){ perror("Fork failed."); exit(1); } if (pid == 0){ printf("Child : errno

Python [Errno 13] Permission denied:

戏子无情 提交于 2019-11-28 08:32:50
问题 I'm attempting to write a quick python script to iterate through all csv files in the current folder and remove the header row from them then store them in a separate folder. The current working directory has four sample csv files and the python script. Once executed the script creates the HeaderRemoved directory. It appears that once the folder is created the code that is attempting to read the files is trying to access the folder but looking at the code I'm not sure why it would be. I'm on