| | |
FTP problem.
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Problem: I keep getting this error when I press the button to trigger Publish from 2nd time and on.
Error:
The error is caused basically by every server.(any ftp host action)
I say this because the function the button called said:
Then I changed that line to the function to connect to the server (that initializes automatically) because I thought the error was caused because we asked the server to go to the directory it was already in, but later, the error said that was caused by:
So I don't really know what is happening.
Error:
Python Syntax (Toggle Plain Text)
AttributeError: 'NoneType' has no attribute 'sendall'
The error is caused basically by every server.(any ftp host action)
I say this because the function the button called said:
Python Syntax (Toggle Plain Text)
server.cwd(blogfiledir)
Then I changed that line to the function to connect to the server (that initializes automatically) because I thought the error was caused because we asked the server to go to the directory it was already in, but later, the error said that was caused by:
Python Syntax (Toggle Plain Text)
server.storbinary blah blah blah
So I don't really know what is happening.
_______
woli
woli
•
•
Join Date: Jul 2006
Posts: 608
Reputation:
Solved Threads: 150
Without seeing the code, I'm just guessing. But that error often happens when a method mistakenly assigns a None return value to the object that called it. Here's an example:
The problem is that .sort() operates directly on the mutable list mylist, and returns None. So the fatal line
mylist = mylist.sort()
causes mylist to become None.
So I don't know, but I'm guessing, that somewhere in there, you assign server or blogfiledir to None by mistake.
Jeff
python Syntax (Toggle Plain Text)
>>> mylist = [3,1,2] >>> mylist = mylist.sort() >>> len(mylist) Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> len(mylist) TypeError: object of type 'NoneType' has no len() >>> # Whaaa...?
The problem is that .sort() operates directly on the mutable list mylist, and returns None. So the fatal line
mylist = mylist.sort()
causes mylist to become None.
So I don't know, but I'm guessing, that somewhere in there, you assign server or blogfiledir to None by mistake.
Jeff
![]() |
Similar Threads
- ftp problem in winxp system (Windows NT / 2000 / XP)
- FTP problem (PHP)
- ftp problem in win xp pc (Networking Hardware Configuration)
- Ftp Problem Please Help (Community Introductions)
- FTP problem with IIS (Windows Servers and IIS)
- ftp problem...major please help (*nix Software)
Other Threads in the Python Forum
- Previous Thread: file menu history
- Next Thread: Python beginner, need help with Celsius converter
| Thread Tools | Search this Thread |
alarm assignment avogadro beginner bluetooth character cmd code customdialog cx-freeze data decimals dictionary directory dynamic error examples exe file float format function generator getvalue gnu graphics gui halp homework http ideas import input itunes java leftmouse line linux list lists logging loop maintain maze millimeter module mouse number numbers output parsing path port prime programming projects push py2exe pygame pyglet pyqt python queue random recursion schedule screensaverloopinactive script scrolledtext slicenotation sqlite ssh stdout string strings sudokusolver table terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode urllib urllib2 variable ventrilo verify vigenere web webservice wikipedia windows wxpython xlib





