From roger.demetrescu at gmail.com Fri Jan 11 12:16:54 2008 From: roger.demetrescu at gmail.com (Roger Demetrescu) Date: Fri, 11 Jan 2008 09:16:54 -0200 Subject: [ftputil] ftputil trac is down Message-ID: <581f62ff0801110316w266a977age7ead14ede37ab0d@mail.gmail.com> Hi, While trying to install ftputil on a new environment, I got this: ===== Searching for ftputil Reading http://pypi.python.org/simple/ftputil/ Reading http://ftputil.sschwarzer.net/ Reading http://www.sschwarzer.net/python/python_software.html Best match: ftputil 2.2.3 Downloading http://ftputil.sschwarzer.net/trac/attachment/wiki/Download/ftputil-2.2.3.tar.gz?format=raw error: Can't download http://ftputil.sschwarzer.net/trac/attachment/wiki/Download/ftputil-2.2.3.tar.gz?format=raw: 500 Internal Server Error ===== Looking at ftptuil wiki, I see its sqlite database is locked. Thanks, Roger From sschwarzer at sschwarzer.net Sat Jan 12 17:24:45 2008 From: sschwarzer at sschwarzer.net (Stefan Schwarzer) Date: Sat, 12 Jan 2008 17:24:45 +0100 Subject: [ftputil] ftputil trac is down In-Reply-To: <581f62ff0801110316w266a977age7ead14ede37ab0d@mail.gmail.com> References: <581f62ff0801110316w266a977age7ead14ede37ab0d@mail.gmail.com> Message-ID: <4788E9CD.7030001@sschwarzer.net> Hello Roger, Roger Demetrescu wrote: > While trying to install ftputil on a new environment, I got this: > > ===== > Searching for ftputil > Reading http://pypi.python.org/simple/ftputil/ > Reading http://ftputil.sschwarzer.net/ > Reading http://www.sschwarzer.net/python/python_software.html > Best match: ftputil 2.2.3 > Downloading http://ftputil.sschwarzer.net/trac/attachment/wiki/Download/ftputil-2.2.3.tar.gz?format=raw > error: Can't download > http://ftputil.sschwarzer.net/trac/attachment/wiki/Download/ftputil-2.2.3.tar.gz?format=raw: > 500 Internal Server Error > ===== Thanks for sending your notice. :-) The locking seems to happen from time to time. I don't know why, only that updating Trac from the current Debian version lessened the frequency of these lockups. Curiously, these locking problems seem to vanish on their own sometimes (or by means of Trac?). Actually, as I looked after the site, all I tested worked fine. If you can post the exact error message I'd google to find out if more is known since the last time I searched. Best regards, Stefan From roger.demetrescu at gmail.com Sat Jan 12 17:36:46 2008 From: roger.demetrescu at gmail.com (Roger Demetrescu) Date: Sat, 12 Jan 2008 13:36:46 -0300 Subject: [ftputil] ftputil trac is down In-Reply-To: <4788E9CD.7030001@sschwarzer.net> References: <581f62ff0801110316w266a977age7ead14ede37ab0d@mail.gmail.com> <4788E9CD.7030001@sschwarzer.net> Message-ID: <581f62ff0801120836n3b03a70fu317df842dd25c9bc@mail.gmail.com> On Jan 12, 2008 1:24 PM, Stefan Schwarzer wrote: > Hello Roger, > > Roger Demetrescu wrote: > > While trying to install ftputil on a new environment, I got this: > > > > ===== > > Searching for ftputil > > Reading http://pypi.python.org/simple/ftputil/ > > Reading http://ftputil.sschwarzer.net/ > > Reading http://www.sschwarzer.net/python/python_software.html > > Best match: ftputil 2.2.3 > > Downloading http://ftputil.sschwarzer.net/trac/attachment/wiki/Download/ftputil-2.2.3.tar.gz?format=raw > > error: Can't download > > http://ftputil.sschwarzer.net/trac/attachment/wiki/Download/ftputil-2.2.3.tar.gz?format=raw: > > 500 Internal Server Error > > ===== > > Thanks for sending your notice. :-) The locking seems to happen > from time to time. I don't know why, only that updating Trac > from the current Debian version lessened the frequency of > these lockups. Curiously, these locking problems seem to > vanish on their own sometimes (or by means of Trac?). Actually, > as I looked after the site, all I tested worked fine. Yes, I tried it again one hour later and everything run nice (I though you have fixed). > If you can post the exact error message I'd google to find > out if more is known since the last time I searched. Sorry, didn't save the whole message... But I'll do it if it happens again. :) > Best regards, > Stefan Thanks! []s Roger From Euro Tue Feb 5 02:13:22 2008 From: Euro (Euro) Date: Mon, 04 Feb 2008 19:13:22 -0600 Subject: [ftputil] =?iso-8859-1?q?Herzlichen_Gl=FCckwunsch=2C_Sie_haben_30?= =?iso-8859-1?q?0_Euro_gewonnen!?= Message-ID: <13851589.98418861@athwart.com> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/ftputil/attachments/20080204/b40d0bff/attachment-0001.htm From buccini.marco at alice.it Mon Mar 17 13:54:10 2008 From: buccini.marco at alice.it (Marco Buccini) Date: Mon, 17 Mar 2008 13:54:10 +0100 Subject: [ftputil] Problem with session_factory: __init__() takes at most 5 arguments (6 given) Message-ID: <47DE69F2.8090000@alice.it> Hi all!! This is my first message here, and I would compliment with you ;) However, I'm developing a little ftp client for personal use, using ftputil library, very simple and useful. But now I've a little problem: I've this class: class ActiveFTPSession(ftplib.FTP): def __init__(self, host, userid, password): ftplib.FTP.__init__(self) self.connect(host, port) self.login(userid, password) # see http://docs.python.org/lib/ftp-objects.html self.set_pasv(False) and this: class FTPConnection(object): def __init__(self, host, userid, password, port, session_factory): self.host = host self.userid = userid self.password = password self.port = port self.session_factory = session_factory try: self.connection = ftputil.FTPHost(self.host, self.userid, self.password, self.port, self.session_factory) except ftputil.FTPError, e: print "Errore" print e When I try to run the main: try: fc = FTPConnection(HOST, USERID, PASSWORD, PORT, ActiveFTPSession) except Exception, e: raise FTPConnectionError("Non e` stato possibile effettuare "\ "la connessione:\n%s" % e) quit() I receive this error: Traceback (most recent call last): File "main.py", line 37, in "la connessione:\n%s" % e) src.FTPConnection.FTPConnectionError: Non e` stato possibile effettuare la connessione: __init__() takes at most 5 arguments (6 given) It's saying me that I pass 6 arguments instead of 5. What's the matter? Thank you ;) From sschwarzer at sschwarzer.net Mon Mar 17 18:54:28 2008 From: sschwarzer at sschwarzer.net (Stefan Schwarzer) Date: Mon, 17 Mar 2008 18:54:28 +0100 Subject: [ftputil] Problem with session_factory: __init__() takes at most 5 arguments (6 given) In-Reply-To: <47DE69F2.8090000@alice.it> References: <47DE69F2.8090000@alice.it> Message-ID: <47DEB054.4010401@sschwarzer.net> On 2008-03-17 13:54, Marco Buccini wrote: > Hi all!! Hello Marco :-) > This is my first message here, and I would compliment with you ;) You're welcome. > But now I've a little problem: > > I've this class: > > class ActiveFTPSession(ftplib.FTP): > def __init__(self, host, userid, password): > ftplib.FTP.__init__(self) > self.connect(host, port) > self.login(userid, password) > # see http://docs.python.org/lib/ftp-objects.html > self.set_pasv(False) > > and this: > > class FTPConnection(object): > def __init__(self, host, userid, password, port, session_factory): > > self.host = host > self.userid = userid > self.password = password > self.port = port > self.session_factory = session_factory > > try: > self.connection = ftputil.FTPHost(self.host, self.userid, > self.password, self.port, self.session_factory) session_factory has to be a keyword argument, not a positional argument, i. e. change self.connection = ftputil.FTPHost(self.host, self.userid, self.password, self.port, self.session_factory) to self.connection = ftputil.FTPHost(self.host, self.userid, self.password, self.port, session_factory=self.session_factory) The ftputil documentation says: """ In fact, all positional and keyword arguments other than session_factory are passed to the factory to generate a new background session ... """ Since all positional arguments are passed directly to the session factory callable, the session_factory argument itself has to be a keyword argument. > except ftputil.FTPError, e: > print "Errore" > print e > > When I try to run the main: > > try: > > fc = FTPConnection(HOST, USERID, PASSWORD, PORT, ActiveFTPSession) > > except Exception, e: > raise FTPConnectionError("Non e` stato possibile effettuare "\ > "la connessione:\n%s" % e) > quit() > > I receive this error: > > Traceback (most recent call last): > File "main.py", line 37, in > "la connessione:\n%s" % e) > src.FTPConnection.FTPConnectionError: Non e` stato possibile effettuare > la connessione: > __init__() takes at most 5 arguments (6 given) > > It's saying me that I pass 6 arguments instead of 5. > What's the matter? Since the ftputil.FTPHost constructor can't recognize and "filter" the session_factory argument, it tries to stuff the extra argument in *args and passes this to the _default_ factory, ftplib.FTP. However, ftplib.FTP's constructor takes at most five arguments (including self), so you have passed in one argument too much. Have fun! :) Best regards, Stefan From =?koi8-r?B?NdTJIMTOxdfO2cogy9XS0yDQzyDw0s/GxdPTyc/OwczYzs/N1SDGyQ==?= Thu Mar 20 22:00:18 2008 From: =?koi8-r?B?NdTJIMTOxdfO2cogy9XS0yDQzyDw0s/GxdPTyc/OwczYzs/N1SDGyQ==?= (=?koi8-r?B?NdTJIMTOxdfO2cogy9XS0yDQzyDw0s/GxdPTyc/OwczYzs/N1SDGyQ==?=) Date: Thu, 20 Mar 2008 18:00:18 -0300 Subject: [ftputil] =?koi8-r?b?8MzBzi/mwcvU?= Message-ID: <154818684.36951783376965@credit-shop.ru> ?????? ??????? ????????? ??? 6000 ???????????. 2I - 25 ??r??? 2008 ?. ?????????????? ?? 5 ???? ?????? ???????? ???????? ? ??????? ?????????????? - ?????? ????????????????? ??????????? ???????????? ?? ??????????? ??????? ? ?????? ????????? ?????? ?????? ???????? ?????????????? ?????????? ???????????????? ???? ???????, ??????? ????? ?????????? ? ??????? ? ???????? ?? ????? ???????. ??? ????????? ???????? ????? ?? ?????????? ?????????? ????????? ?????? ???????????? ?????????. ? ??? ???????! ???? ???????? ?? 200. ?????????? ?????????? ????????????? ???????? ????? ???????? ?? ??????????? ????????? "Business Plan PL" Professional category ? ?????????????? ?????????? (?????????????? ????) "LOGICAL - J 3000" ? ???????? "??????????????". ?? ??????????? ??????? ?????????? 2 ?????????????? ?????: ?????? ???????? ????????; ????? ?????? ?? ??????? ? ????????. ??????? ???????? ? ???????????? ??????. ??????? ????????? ? ???? ??????? ?????. ??????? ???? ???????????? ??: ????????????? ???????????, ????????????? ???????-????????????? ?????, ???????????? ?? ?????????? ?????????, ?????????????, ??????????, ???????????? ????????? ??????????? ? ??????? ???????????????? ??????????. ????????????, ?????????????? ?????????? ? ???????? ???????, ????????? ? ???????????? ? ????????????? ????????????? ???????????, ???????????????, ??????? ?????????, ??????????? ?????????? ? ??????? ?????????? ????????????, ?????????? ????????????? ???????????? ???????????? ???????????. ??????? ????????? ???????????: ??? ?????????? ???????? ?????? ? ????????? ???????? ???????????? ? ???????? ?????????? ????? ?? ??????????? ??????????????? ????????? ????????? ???????????? ????????? ? ??: 1. ?????????????????? ????????? - ???????????????? ?????????? ????????????! ??????????? ??????? ???????? ?? ?????? ????????????? ?????????? ???????????? ?? ???????????????? ??????, ? ????? ?????? ??????????? ???????????? ??????????? ??? ???????????? ???????? ??????? ???????????. 2. ??????????? ??????? ??? ???????, ????????? ????????, ???????, ????????????????? ??????????. 3. ????????? ??? ????????, ?????????? ? ?????????? ????????????? ??????? ????????. ?????????? ??????????????? ?????????, ????????? ????/????, ?????????? ??????? ???????? ? ?????? ????????? ???????. ??????????? ????????? ??????????? ??????, ???????? ??????????? ???????, ???????????????????? ? ????????? ?????????. 4. ????????? ??? ?????????? ??????????? ???????, ????????? ???????? ??????????? ?????????? ?????? ???? ?? ?????????? ? ?????? ????? - ??????????? ?????????? ?? ?????????? ????????. ???? ????????? ????????????? ??????, ????????? ? ??????????? ?????????, ? ??????????? ??????, ?????????????? ?????????? MS Excel. 5. ??????????? ??????? ??? ?????????? ????????? ????? ??????? ???????????? (?????? ??????, ???, ?????????????? ???????? ? ?????? ?????????? ????????.) ? ???????????????? ????. 6. ????????? ???????? ?????????? ????????????? ????????????. ????????? ????? ?? ???? ????? ??????? ????? ????????? ?????? ? ????. 7. ????? ????????????? ????????? ????????? (????????????? ????? ?????????) ? ?????? ??? ??????????????? ?????????? ?????????? ????????. 8. ?? CD ????? ??????????? ?????? ?????. ????????? ??? ?????????? ?????????? ????????. 9. ?????????? ??????????????? ???????????? ? ???????????? ??????? ? ??????????? ? ???? ?????????????? ??????????? ???????. ????????? ???????? ???????? ? ????????? ????????. ??? ?????????? ????? ???????? ?????????????? ?????????? ???? ???????? ??????? ????????? ???????? ???????? ???????????????? ? ? ? ? ? ? ? ? ? ? ???????? ? ??????????? ????? ???????? ?? ???????? "??????????????" ? ?????? ????????? "????????? ?????????? ??????????????? ?????????". ?????? ????????????????? ???????????? ??????????? ?? ????? ???????? ? ????? ?????????????? ?? ?????? ??????? ? ??????? ????????????????? ???????. ??????? ?????????? ? ?.?????? ?? ???p?c?? p??uc??p??uu ??p??????c? ?? ???: ??? ?????? 792{2I22}, 967?????8_22 24NF78R -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/ftputil/attachments/20080320/6e399579/attachment.htm From buccini.marco at alice.it Sun Mar 23 17:48:32 2008 From: buccini.marco at alice.it (Marco Buccini) Date: Sun, 23 Mar 2008 17:48:32 +0100 Subject: [ftputil] Setting a passive/active connection during the same connection Message-ID: <47E689E0.10101@alice.it> Hi! Is there a way to set a modality passive/active during the connection and not only before the connection ? Infact with ftplib we have: ftp = ftplib.FTP(host,user,pass, port) #or some similar ftp.set_pasv(True|False) Instead in ftputil we have to define a class as in the example in the documentation. Can you help me? Bye. From sschwarzer at sschwarzer.net Sun Mar 23 18:36:39 2008 From: sschwarzer at sschwarzer.net (Stefan Schwarzer) Date: Sun, 23 Mar 2008 18:36:39 +0100 Subject: [ftputil] Setting a passive/active connection during the same connection In-Reply-To: <47E689E0.10101@alice.it> References: <47E689E0.10101@alice.it> Message-ID: <47E69527.3040605@sschwarzer.net> Hello Marco, On 2008-03-23 17:48, Marco Buccini wrote: > Is there a way to set a modality passive/active during the connection > and not only before the connection? > > Infact with ftplib we have: > > ftp = ftplib.FTP(host,user,pass, port) #or some similar > ftp.set_pasv(True|False) > > Instead in ftputil we have to define a class as in the example in the > documentation. Principally, the instantiated session object is accessible as FTPHost._session. Accessing it, for example via host._session.set_pasv(True) is not recommended: ftputil makes new sessions internally for child session objects which are used for file-like objects. So the recommended way is still to use a session factory callable - unless you are hundred percent sure you avoid use FTP file-like objects and want to risk compatibility problems with future ftputil versions. ;-) Note that the session_factory can by any callable, not necessarily a class. Thus, you could use def factory(host, user, pass, port): session = ftplib.FTP(host, user, pass, port) session.set_pasv(True) return session host = ftputil.FTPHost(host, user, pass, port, session_factory=factory) which is a bit shorter than using a class as the session factory. Best regards, Stefan From buccini.marco at alice.it Sun Mar 23 20:37:07 2008 From: buccini.marco at alice.it (Marco Buccini) Date: Sun, 23 Mar 2008 20:37:07 +0100 Subject: [ftputil] Setting a passive/active connection during the same connection In-Reply-To: <47E69527.3040605@sschwarzer.net> References: <47E689E0.10101@alice.it> <47E69527.3040605@sschwarzer.net> Message-ID: <47E6B163.3040807@alice.it> Stefan Schwarzer ha scritto: > Hello Marco, > > On 2008-03-23 17:48, Marco Buccini wrote: > >> Is there a way to set a modality passive/active during the connection >> and not only before the connection? >> >> Infact with ftplib we have: >> >> ftp = ftplib.FTP(host,user,pass, port) #or some similar >> ftp.set_pasv(True|False) >> >> Instead in ftputil we have to define a class as in the example in the >> documentation. >> > > Principally, the instantiated session object is accessible > as FTPHost._session. Accessing it, for example via > host._session.set_pasv(True) is not recommended: ftputil > makes new sessions internally for child session objects > which are used for file-like objects. > > I didn't thought of this method. But I think, as you say it's not a good method. > So the recommended way is still to use a session factory > callable - unless you are hundred percent sure you avoid > use FTP file-like objects and want to risk compatibility > problems with future ftputil versions. ;-) > > Note that the session_factory can by any callable, not > necessarily a class. Thus, you could use > > def factory(host, user, pass, port): > session = ftplib.FTP(host, user, pass, port) > session.set_pasv(True) > return session > > host = ftputil.FTPHost(host, user, pass, port, > session_factory=factory) > > which is a bit shorter than using a class as the session > factory. > > I've already used this method, but I've found a little (big) problem. Imagine you want to switch to active from passive or vice versa during an established connection. You've to instanciate another FTPConnection object, haven't you? So the previous connection is lost, and you've to create a new connection. It' s not a good way .. :( For example, if you use linux and open a ftp command line client, you can set passive/active at whatever time you want. What do you suggest me? Thank you for your helping me. Regards. From sschwarzer at sschwarzer.net Sun Mar 23 23:09:21 2008 From: sschwarzer at sschwarzer.net (Stefan Schwarzer) Date: Sun, 23 Mar 2008 23:09:21 +0100 Subject: [ftputil] Setting a passive/active connection during the same connection In-Reply-To: <47E6B163.3040807@alice.it> References: <47E689E0.10101@alice.it> <47E69527.3040605@sschwarzer.net> <47E6B163.3040807@alice.it> Message-ID: <47E6D511.7000100@sschwarzer.net> Hi Marco, On 2008-03-23 20:37, Marco Buccini wrote: > Stefan Schwarzer ha scritto: >> On 2008-03-23 17:48, Marco Buccini wrote: >> Note that the session_factory can by any callable, not >> necessarily a class. Thus, you could use >> >> def factory(host, user, pass, port): >> session = ftplib.FTP(host, user, pass, port) >> session.set_pasv(True) >> return session >> >> host = ftputil.FTPHost(host, user, pass, port, >> session_factory=factory) >> >> which is a bit shorter than using a class as the session >> factory. > > I've already used this method, but I've found a little (big) problem. > Imagine you want to switch to active from passive or vice versa during > an established connection. You've to instanciate another FTPConnection > object, haven't you? So the previous connection is lost, and you've to > create a new connection. It' s not a good way .. :( Is this an actual use case? If yes, could you describe the concrete application in more detail? Is it actually bad for performance (or otherwise) to open a new connection? > For example, if you use linux and open a ftp command line client, you > can set passive/active at whatever time you want. Again, I wonder whether this (changing at any time) is needed. I think, also in command line clients you _usually_ change active/passive mode not more than once per connection. > What do you suggest me? If you actually have an application which (according to measurements!) benefits from switching the mode on an established FTPHost instance please tell me. :-) You can compare the approaches by accessing FTPHost._session directly; just for tests, not production code, this should be ok. I can _imagine_ a use case for changing the mode of the session after establishing the connection: You try some commands, and if they fail, you retry after switching from active to passive (or vice versa). However, if you deal with a certain remote host, you will probably need this switching only one time and reuse the knowledge of active/ passive mode for multiple connections. So the loss of reopening a single connection for dealing with - in the end - several connections to a server for some time probably isn't critical, only a bit inconvenient. > Thank you for your helping me. You're welcome (as always). :-) Stefan From buccini.marco at alice.it Mon Mar 24 11:01:27 2008 From: buccini.marco at alice.it (Marco Buccini) Date: Mon, 24 Mar 2008 11:01:27 +0100 Subject: [ftputil] Setting a passive/active connection during the same connection In-Reply-To: <47E6D511.7000100@sschwarzer.net> References: <47E689E0.10101@alice.it> <47E69527.3040605@sschwarzer.net> <47E6B163.3040807@alice.it> <47E6D511.7000100@sschwarzer.net> Message-ID: <47E77BF7.1010305@alice.it> Stefan Schwarzer ha scritto: > Hi Marco, > > On 2008-03-23 20:37, Marco Buccini wrote: > >> Stefan Schwarzer ha scritto: >> >>> On 2008-03-23 17:48, Marco Buccini wrote: >>> Note that the session_factory can by any callable, not >>> necessarily a class. Thus, you could use >>> >>> def factory(host, user, pass, port): >>> session = ftplib.FTP(host, user, pass, port) >>> session.set_pasv(True) >>> return session >>> >>> host = ftputil.FTPHost(host, user, pass, port, >>> session_factory=factory) >>> >>> which is a bit shorter than using a class as the session >>> factory. >>> >> I've already used this method, but I've found a little (big) problem. >> Imagine you want to switch to active from passive or vice versa during >> an established connection. You've to instanciate another FTPConnection >> object, haven't you? So the previous connection is lost, and you've to >> create a new connection. It' s not a good way .. :( >> > > Is this an actual use case? If yes, could you describe the > concrete application in more detail? Is it actually bad for > performance (or otherwise) to open a new connection? > > No, but I thought: I estabilish a new connection object in passive mode. I do my work, change directory, etc etc... Then I disconnect this object to connect in active mode. I lose all my data (local directory, etc..) >> For example, if you use linux and open a ftp command line client, you >> can set passive/active at whatever time you want. >> > > Again, I wonder whether this (changing at any time) is > needed. I think, also in command line clients you _usually_ > change active/passive mode not more than once per > connection. > > If you try to connect, for example, to a host: ftp upload.sourceforge.net # you login ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. It's saying you that you are using active mode, and you've to set "passive" (because sourceforge works in this way). Than you set "passive" and it works well. I can see that once you 've changed to passive mode, you can't return to active mode. (maybe it depends on the server?) >> What do you suggest me? >> > > If you actually have an application which (according to > measurements!) benefits from switching the mode on an > established FTPHost instance please tell me. :-) You can > compare the approaches by accessing FTPHost._session > directly; just for tests, not production code, this should > be ok. > > No, I don't know any applications that do this. So the user should switch only one time to passive/active mode. > I can _imagine_ a use case for changing the mode of the > session after establishing the connection: You try some > commands, and if they fail, you retry after switching from > active to passive (or vice versa). However, if you deal > with a certain remote host, you will probably need this > switching only one time and reuse the knowledge of active/ > passive mode for multiple connections. So the loss of > reopening a single connection for dealing with - in the > end - several connections to a server for some time > probably isn't critical, only a bit inconvenient. > > Infact I'm thinking of estabilishing only one connection at time. Ok. I'll do so: def factory(host, user, pass, port): session = ftplib.FTP(host, user, pass, port) session.set_pasv(True) return session host = ftputil.FTPHost(host, user, pass, port, session_factory=factory) It's a good method Thank you!! :) From 1 Tue Mar 25 08:48:27 2008 From: 1 (1) Date: Tue, 25 Mar 2008 08:48:27 +0100 Subject: [ftputil] 1 Message-ID: <01c88e54$fe01ff80$b338aa57@fm130190> 1