errno

How to fix OSError: [Errno 22] Invalid argument

How to fix OSError: [Errno 22] Invalid argument Question: Problem: Getting an error code OSError: [Errno 22] Invalid argument: when running my code. Intended purpose of the code: Download all attachements from one sender in gmail using python. Type of files beeing downloaded: .DBF files ACTUAL names of the files: C:SOMETHINGSOMETHING.DBF (old path is part …

Total answers: 2

OSError: [Errno 22] Invalid argument: 'The Game (John Smith)n.txt'

OSError: [Errno 22] Invalid argument: 'The Game (John Smith)n.txt' Question: Line 37: with open("{}.txt".format(cb), ‘w’, encoding="utf8") as wrt: OSError: [Errno 22] Invalid argument: ‘The Game (John Smith)n.txt’ I am trying to write files and name them according to the book title. I believe I get the error above because of the "n" in the title, …

Total answers: 2

Python recursive file renaming

Python recursive file renaming Question: I am pretty new to python and I am attempting to create a python script that is able to recursively rename every file in a directory including subdirectories. But every time I run the script I’m getting the error OSError: [Errno 2] No such file or directory The directory contains …

Total answers: 2

Python socket.error: [Errno 111] Connection refused

Python socket.error: [Errno 111] Connection refused Question: I am trying to write a program for file transfer using sockets. The server end of the code is running fine. However, in the client side I get the following error Traceback (most recent call last): File “client.py”, line 54, in <module> uploadFiles(directory) File “client.py”, line 36, in …

Total answers: 1

Python [Errno 98] Address already in use

Python [Errno 98] Address already in use Question: In my Python socket program, I sometimes need to interrupt it with Ctrl-C. When I do this, it does close the connection using socket.close(). However, when I try to reopen it I have to wait what seems like a minute before I can connect again. How does …

Total answers: 16