Re: ANN: psutil 5.3.0 with full unicode support is out

2017-09-04 Thread Giampaolo Rodola'
reasoning makes sense? I mean returning str all the time and provide a strategy to convert the string to unicode in Python 2? On Mon, Sep 4, 2017 at 2:54 PM, eryk sun wrote: > On Sun, Sep 3, 2017 at 11:09 PM, Giampaolo Rodola' > wrote: > > > > This is an example which fil

Re: ANN: psutil 5.3.0 with full unicode support is out

2017-09-03 Thread Giampaolo Rodola'
unky characters, so "practicality beats purity" in this case. On Sun, Sep 3, 2017 at 11:38 PM, eryk sun wrote: > On Sun, Sep 3, 2017 at 9:58 AM, Giampaolo Rodola' > wrote: > > > > - #1040: all strings are encoded by using OS fs encoding

ANN: psutil 5.3.0 with full unicode support is out

2017-09-03 Thread Giampaolo Rodola'
Hello all, I'm glad to announce the release of psutil 5.3.0: https://github.com/giampaolo/psutil A blogpost describing the main changes is available here: http://grodola.blogspot.com/2017/09/psutil-530-with-full-unicode-support-is.html About = psutil (process and system utilities) is a cross-

ANN: released psutil 5.0.0, introducing a 2x speedup for process methods

2016-11-06 Thread Giampaolo Rodola'
Hello all, I'm glad to announce the release of psutil 5.0.0: https://github.com/giampaolo/psutil This release introduces important speedups making psutil from 2x to 6x faster depending on what platform you're on. A full blog post can be found here: http://grodola.blogspot.com/2016/11/psutil-500-is-

ANN: psutil 4.2.0 with Windows service support is out

2016-05-15 Thread Giampaolo Rodola'
Full blog post: http://grodola.blogspot.com/2016/05/psutil-420-windows-services-and-python.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

ANN: psutil 4.2.0 with Windows service support is out

2016-05-15 Thread Giampaolo Rodola'
Full blog post: http://grodola.blogspot.com/2016/05/psutil-420-windows-services-and-python.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

ANN: psutil 4.0.0 released - how to get "real" process memory and environ in Python

2016-02-17 Thread Giampaolo Rodola'
Full blog post: http://grodola.blogspot.com/2016/02/psutil-4-real-process-memory-and-environ.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

ANN: released psutil 3.3.0 with OpenBSD support

2015-11-24 Thread Giampaolo Rodola'
Full story here: http://grodola.blogspot.com/2015/11/openbsd-support-for-psutil.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

ANN: psutil 3.0.0 is out

2015-06-13 Thread Giampaolo Rodola'
Hi there folks, I'm pleased to announce release 3.0.0 release of psutil: http://grodola.blogspot.com/2015/06/psutil-30.html === About === psutil (python system and process utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, d

ANN: psutil 2.2.0 released

2015-01-06 Thread Giampaolo Rodola'
Hello all, I'm glad to announce the release of psutil 2.2.0. In this new release I decided to drop support for Python 2.4 and 2.5 for good. Whoever is still on Python 2.4 and 2.5 can use old 2.1.3 version: https://pypi.python.org/pypi?name=psutil&version=2.1.3&:action=files Main features and bugfi

Re: Python 2.x and 3.x use survey, 2014 edition

2014-12-13 Thread Giampaolo Rodola'
On Thu, Dec 11, 2014 at 10:32 PM, Ben Finney wrote: > > "Giampaolo Rodola'" writes: > > > I still think the only *real* obstacle remains the lack of important > > packages such as twisted, gevent and pika which haven't been ported > > yet. > >

Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-11 Thread Giampaolo Rodola'
On Wed, Dec 10, 2014 at 5:59 PM, Bruno Cauet wrote: > Hi all, > Last year a survey was conducted on python 2 and 3 usage. > Here is the 2014 edition, slightly updated (from 9 to 11 questions). > It should not take you more than 1 minute to fill. I would be pleased if > you took that time. > > Her

Re: [Python-Dev] [RELEASED] Python 3.4.0

2014-03-17 Thread Giampaolo Rodola'
The what's new looks truly amazing, with pathlib and asyncio being my favourite additions. Thanks for all the hard work. On Mon, Mar 17, 2014 at 5:57 PM, Ryan Gonzalez wrote: > YES!!! +1 to the authors of the statistics and pathlib modules. > > > On Mon, Mar 17, 2014 at 1:29 AM, Larry Hastings

Re: which async framework?

2014-03-11 Thread Giampaolo Rodola'
On Tue, Mar 11, 2014 at 11:17 AM, Sturla Molden wrote: > Chris Withers wrote: > > Hi All, > > > > I see python now has a plethora of async frameworks and I need to try > > and pick one to use from: > > > > - asyncio/tulip > > - tornado > > - twisted > > Looking at Tornado's examples on the web I

ANN: psutil 2.0.0 released

2014-03-10 Thread Giampaolo Rodola'
Hi there folks, I'm pleased to announce the 2.0.0 release of psutil: http://code.google.com/p/psutil/ === About === psutil (python system and process utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Pyth

Re: proposal: bring nonlocal to py2.x

2014-01-13 Thread Giampaolo Rodola'
On Mon, Jan 13, 2014 at 3:47 PM, Neal Becker wrote: > py3 includes a fairly compelling feature: nonlocal keywork > But backward compatibility is lost. It would be very helpful > if this was available on py2.x. > > -- > https://mail.python.org/mailman/listinfo/python-list > It's not gonna happe

Re: [ANN] ftputil 3.0a1 released

2013-09-30 Thread Giampaolo Rodola'
Glad to hear there's someone else other than me who still cares about the almost forgotten FTP protocol! =) --- Giampaolo https://code.google.com/p/pyftpdlib/ https://code.google.com/p/psutil/ https://code.google.com/p/pysendfile/ On Sun, Sep 29, 2013 at 8:00 PM, Stefan Schwarzer wrote: > ftpu

ANN: psutil 1.1.0 released

2013-09-28 Thread Giampaolo Rodola'
ps://pypi.python.org/pypi?:action=display&name=psutil#downloads * API Reference: http://code.google.com/p/psutil/wiki/Documentation Please try out this new release and let me know if you experience any problem by filing issues on the bug tracker. All the best, --- Giampaolo Rodola' http://code.google.com/p/pyftpdlib/ http://code.google.com/p/psutil/ http://code.google.com/p/pysendfile/ -- https://mail.python.org/mailman/listinfo/python-list

Upload Windows binaries on pypi from Linux

2013-09-26 Thread Giampaolo Rodola'
I have a Python extension module (psutil) written in C which I compile for different Python versions (from 2.4 to 3.3) and want to upload them on pypi. The Windows machine is not connected to internet so after I generate the Windows binaries (via setup.py bdist_wininst) I move the .exe files from

Re: ANN: psutil 1.0.0 released

2013-07-11 Thread Giampaolo Rodola'
> Congratulations on the 1.0.0 release! Thanks a lot. =) > Btw. any change you can put up a prebuilt installer for a 64-bit built > with Python 3.3? You have one for Python 3.2 > (http://code.google.com/p/psutil/downloads/list), but the version for Python > 3.3 is not there. Unfortunately I'm

ANN: psutil 1.0.0 released

2013-07-10 Thread Giampaolo Rodola'
.0.0.tar.gz * API Reference: http://code.google.com/p/psutil/wiki/Documentation Please try out this new release and let me know if you experience any problem by filing issues on the bug tracker. Thanks in advance and hooray for the new Solaris support! ;-) All the best, --- Giampaolo Rodola&#x

Re: python process accounting

2013-04-30 Thread Giampaolo Rodola'
2013/4/30 Rita : > Hi, > > I was wondering if it possible to write a python wrapper which will account > my processes. I would like to account for all the children processes (fork) > by looking at their /proc/ info. Such as memory, io, open files, stats. > > So, instead of me running "/bin/sleep 10

Re: when should I explicitely close a file?

2010-04-13 Thread Giampaolo Rodola'
What about open('foo', 'w').close(). Does it have the same problems? --- Giampaolo http://code.google.com/p/pyftpdlib http://code.google.com/p/psutil -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not allow a variable named "pass"

2010-04-11 Thread Giampaolo Rodola'
On 11 Apr, 15:40, BJ Swope wrote: > I am trying to automate access to a web page that has forms based > authentication.  The password field is named "pass" which python is > not going to like. > > Other than asking the website owner to change the name of the field > how can I go about passing that

Re: ftp and python

2010-04-11 Thread Giampaolo Rodola'
On 8 Apr, 07:24, John Nagle wrote: > Tim Chase wrote: > > Matjaz Pfefferer wrote: > >> What would be the easiest way to copy files from one ftp > >> folder to another without downloading them to local system? > > > As best I can tell, this isn't well-supported by FTP[1] which doesn't > > seem to h

ANN: psutil 0.1.3 released

2010-03-04 Thread Giampaolo Rodola'
http://code.google.com/p/psutil/wiki/Documentation Thanks --- Giampaolo Rodola' http://code.google.com/p/pyftpdlib http://code.google.com/p/psutil/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to monitor memory usage within Python? (Linux)

2010-02-25 Thread Giampaolo Rodola'
On 24 Feb, 23:35, kj wrote: > Is there some standard module for getting info about the process's > memory usage, in a Linux/Unix system? > > (I want to avoid hacks that involve, e.g., scraping ps's output.) > > Thanks! > > ~K http://code.google.com/p/psutil >>> import psutil >>> p = psutil.Proce

setuptools/distutil and pywin32

2010-02-08 Thread Giampaolo Rodola'
Hi, I have a program which requires pywin32 as a dependancy and I'd like to make setuptools automatically retrieve it from internet and install it. My setup.py script looks like this: from setuptools import setup setup( ... ... install_requires = ['pywin32']

Re: asyncore based port splitter code questions

2010-01-08 Thread Giampaolo Rodola'
On 4 Gen, 18:58, George Trojan wrote: > asyncore based code is supposed to be simple, > but I need while loops and a lot of try/except clauses. First of all: you DON'T have to use while loops or anything which is blocking where by "blocking" I mean anything like time.sleep(). asyncore, just like

Re: Python 2.6 ftplib has timeout parameter, but how to detect a timeout

2009-12-30 Thread Giampaolo Rodola'
On 30 Dic, 18:52, MrJean1 wrote: > Brendan, > > The timeout argument of the FTP class (and the connect method) is used > only to establish the connection to FTP sockets.  If the timeout > expires, an error called socket.timeout is raised. > > AFAIK, the timeout argument does not limit FTP transfer

Re: Python 2.6 ftplib has timeout parameter, but how to detect a timeout

2009-12-30 Thread Giampaolo Rodola'
On 14 Dic, 20:08, Brendan wrote: > I was quite happy to see that ftplib in Python 2.6 now has a timeout > parameter. With large file downloads my script would often hang, > presumably from timing out. Now that there is a timeout parameter, how > would I detect when a timeout occurs? The socket ob

Porting pyftpdlib to Python 3.x: question about tarball naming convention

2009-12-09 Thread Giampaolo Rodola'
Hi, I've started the (hard) process of porting pyftpdlib [1] to Python 3. In order to do that I'm working on a separate SVN branch and I plan to maintain two different releases of my software, one for 2.x and another one for 3.x. My doubts are about the naming convention I have to use for the tarb

ANN: Python FTP Server library (pyftpdlib) 0.5.2 released

2009-09-13 Thread Giampaolo Rodola'
/wiki/RFCsCompliance * Issue tracker: http://code.google.com/p/pyftpdlib/issues/list * Mailing list: http://groups.google.com/group/pyftpdlib Thanks, --- Giampaolo Rodola' < g.rodola [at] gmail [dot] com > http://code.google.com/p/pyftpdlib/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Survey: Does your company use Python? Do you know a company that uses Python?

2009-08-08 Thread Giampaolo Rodola'
On 7 Ago, 21:15, VanL wrote: > This is a survey to find as many companies using Python as we can. You > can see the survey below: > > > > You don't need to work at the company to add it to this list! We will > filter for

Re: "Deprecated sets module" with Python 2.6

2009-07-29 Thread Giampaolo Rodola'
What about this? import warnings warnings.simplefilter('ignore', DeprecationWarning) import the_module_causing_the_warning warnings.resetwarnings() --- Giampaolo http://code.google.com/p/pyftpdlib http://code.google.com/p/psutil -- http://mail.python.org/mailman/listinfo/python-list

Re: Python implmenentation of finding process's command line parameters.

2009-07-03 Thread Giampaolo Rodola'
On 3 Lug, 21:50, Tim Golden wrote: > Sorry. Exactly what I meant. (Should have checked for > the exact post rather than trusting to my memory) No prolem. > dudeja.ra...@gmail.com wrote: > > I have had a look at psutil, however, this only works with Python 2.6.x and > > above. We are using Pytho

Re: Python implmenentation of finding process's command line parameters.

2009-07-03 Thread Giampaolo Rodola'
On 3 Lug, 21:15, Tim Golden wrote: > dudeja.ra...@gmail.com wrote: > > I'm looking for some python implementation of finding the command line > > parameters of a process on Windows XP SP3 machine. I found some links but > > they all point me to the direction of c/c++ implememtations. > > > I've se

Re: Open source python projects

2009-06-22 Thread Giampaolo Rodola'
On 22 Giu, 21:40, saurabh wrote: > Hi There, > I am an experienced C programmer and recently dived into python, > I have developed an instant love for it. > I have been doing some routine scripting for day to day admin tasks,also > have done some Tkinter and socket programming using python. > > I

Re: command line of a process.exe on another host

2009-06-12 Thread Giampaolo Rodola'
On 12 Giu, 13:02, Tim Golden wrote: > Giampaolo Rodola' wrote: > > On 12 Giu, 00:18, "Harry" wrote: > >> HI , > >> I have number of process run on different windows servers which run's with > >> different command line parameters. > >

Re: command line of a process.exe on another host

2009-06-12 Thread Giampaolo Rodola'
On 12 Giu, 00:18, "Harry" wrote: > HI , > I have number of process run on different windows servers which run's with > different command line parameters. for example "process.exe -input > statusurl:http://sss.com";., These parameters can vary from host to host. > using Psexec I know the PID and pr

Re: ANN: Python process utility (psutil) 0.1.2 released

2009-05-10 Thread Giampaolo Rodola'
On 9 Mag, 11:30, Nick Craig-Wood wrote: > Giampaolo Rodola' wrote: > >  psutil is a module providing an interface for retrieving information > >  on running processes and system utilization (CPU, memory) in a > >  portable way by using Python, implementing many funct

Re: Call a function when a thread exits

2009-05-08 Thread Giampaolo Rodola'
On 8 Mag, 03:33, Carl Banks wrote: > On May 7, 6:12 pm, "Giampaolo Rodola'" wrote: > > > > > > > Hi, > > I'm searching for a smooth way to call a certain function when a > > thread has finished its job. > > I guess I can keep callin

Call a function when a thread exits

2009-05-07 Thread Giampaolo Rodola'
Hi, I'm searching for a smooth way to call a certain function when a thread has finished its job. I guess I can keep calling isAlive() in a loop and call my function when it returns False but it's not very elegant. Actually I'm a bit surprised it doesn't exists an "atexit" function. Something like:

ANN: Python process utility (psutil) 0.1.2 released

2009-05-07 Thread Giampaolo Rodola'
ogle.com/p/psutil/wiki/Documentation Thanks --- Giampaolo Rodola' http://code.google.com/p/pyftpdlib http://code.google.com/p/psutil/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python needs leaning stuff from other language

2009-04-04 Thread Giampaolo Rodola'
On 4 Apr, 04:19, Steven D'Aprano wrote: > On Fri, 03 Apr 2009 18:52:52 -0700, Giampaolo Rodola' wrote: > > If "there should be one-- and preferably only one --obvious way to do > > it" then my_list.clear() is more obvious than del my_list[:]. Honestly > >

Re: python needs leaning stuff from other language

2009-04-03 Thread Giampaolo Rodola'
If "there should be one-- and preferably only one --obvious way to do it" then my_list.clear() is more obvious than del my_list[:]. Honestly I'm a little surprised that such a topic hasn't been raised before. --- Giampaolo http://code.google.com/p/pyftpdlib -- http://mail.python.org/mailman/listi

Re: How can I know if a date is prior to today?

2009-03-25 Thread Giampaolo Rodola'
On 25 Mar, 14:51, Tim Chase wrote: > > I have a date expressed in seconds. > > I'd want to pretty print it as "%H:%M" if the time refers to today and > > "%b%d" (month, day) if it's of yesterday or before. > > > I managed to do that with the code below but I don't like it too much. > > Is there a

How can I know if a date is prior to today?

2009-03-25 Thread Giampaolo Rodola'
Hi, I have a date expressed in seconds. I'd want to pretty print it as "%H:%M" if the time refers to today and "%b%d" (month, day) if it's of yesterday or before. I managed to do that with the code below but I don't like it too much. Is there a better way to do that? Thanks in advance. import ti

Re: monitoring/restarting an application

2009-03-06 Thread Giampaolo Rodola'
On 5 Mar, 15:37, Ghirai wrote: > Hello list, > > I need to keep x number of instances of an external applications > running, say /bin/x, but also kill and restart each one after y seconds. > > What would be the best way to do this (with python 2.5.x)? > > I'm thinking of having a list of running p

Re: How can I know when a sub-process is effectively initialized?

2009-02-27 Thread Giampaolo Rodola'
On 26 Feb, 21:59, Jean-Paul Calderone wrote: > On Thu, 26 Feb 2009 12:27:26 -0800 (PST), Giampaolo Rodola' > wrote: > >Hi, > >I'm working on a Python module called psutil [1] for reading process > >information in a cross-platform way. > >I'm havin

How can I know when a sub-process is effectively initialized?

2009-02-26 Thread Giampaolo Rodola'
Hi, I'm working on a Python module called psutil [1] for reading process information in a cross-platform way. I'm having a problem with psutil test suite. Almost all the test cases we implemented so far look like this: def test_foo(self): test_process = subprocess.Popen(sys.executable, stdout=

Re: How to verify whether a process got hanged or still alive.

2009-02-16 Thread Giampaolo Rodola'
On 16 Gen, 00:04, neel wrote: > Hi There, > > I want to check the health of IEprocessusing python. I am running an > application on IE. I have to verify that the application is not > crashing the IE. Is there any module which can help me in getting > theprocessstatus? > > Thanks, > Neel By proc

Re: Problem building Python extension

2009-02-13 Thread Giampaolo Rodola'
On Feb 13, 10:53 am, David Cournapeau wrote: > On Fri, Feb 13, 2009 at 6:30 PM,   wrote: > > Hi all, > > > I'm trying to build my first python extensionon a win32 system. I > > followed the description > > inhttp://starship.python.net/crew/mwh/toext/your-first-extension.html, > > but after runnin

Re: ANN: Python 2.6 Quick Reference available

2009-02-11 Thread Giampaolo Rodola'
On Feb 10, 8:38 pm, Richard Gruet <"rgruet at free dot fr"> wrote: > The Python 2.6 Quick Reference is available in HTML and PDF formats > athttp://rgruet.free.fr/#QuickRef. > > This time I was helped by Josh Stone for the update. > > As usual, your feedback is welcome (pqr at rgruet.net). > > Che

Re: Upgrade 2.6 to 3.0

2009-02-04 Thread Giampaolo Rodola'
On 5 Feb, 01:18, Tim Rowe wrote: > 2009/2/4 Scott David Daniels : > > > joviyach wrote: > > >> I am fairly new to Python, the first version I loaded was 2.6. I have > >> since downloaded 3.0 and I was wondering what the best practice for > >> upgrading is? I am using Windows XP Pro for my OS. > >

Re: Monitor Internet connections in XP/Vista

2009-02-02 Thread Giampaolo Rodola'
On 2 Feb, 10:05, pranav wrote: > Hi Folks, > > I am designing a project for Windows XP/Vista, one part of which is a > background process that monitors internet connections. If the user > tries to connect to any particular site, say myDummySite.com in then > some actions are taken, based on fixed

Re: Where to host a (Python) project?

2009-01-31 Thread Giampaolo Rodola'
On 31 Gen, 12:46, andrew cooke wrote: > Hi, > > I have a new project, that I just released in beta > (http://www.acooke.org/lepl- a recursive decent parser with full > backtracking).  At the moment I am using pypi and setuptools for > distribution (it's a pure python package) and I am happy with

Re: 'Address already in use' ... with TCPServer

2009-01-30 Thread Giampaolo Rodola'
On 30 Gen, 10:16, "Gabriel Genellina" wrote: > En Fri, 30 Jan 2009 05:43:33 -0200, Mabooka-Mabooka Mbe-Mbe   > escribió: > > >   setsockopt(REUSEADDR)... > > > What I came up with so far is this: > from SocketServer import * > s = TCPServer( ('', 32123), None) > dir(s) > > ['Reques

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread Giampaolo Rodola'
> Where are the community projects supporting Python? -- besides the > core devlopment. http://pypi.python.org/pypi ...which accidentally says "There are currently 5597 packages here." Not bad uh? --- Giampaolo http://code.google.com/p/pyftpdlib -- http://mail.python.org/mailman/listinfo/pytho

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Giampaolo Rodola'
On 26 Gen, 19:16, jefm wrote: > Hi, > while checking out Python 3, I read that all text strings are now > natively Unicode. > In the Python language reference (http://docs.python.org/3.0/reference/ > lexical_analysis.html) I read that I can show Unicode character in > several ways. > "\u" supp

Re: Monitor a FTP site for arrival of new/updated files

2009-01-26 Thread Giampaolo Rodola'
On 25 Gen, 21:11, Steve Holden wrote: > pyt...@bdurham.com wrote: > >  Any suggestions on a best practice way to monitor a remote FTP site for > > the arrival of new/updated files? I don't need specific code, just some > > coaching on technique based on your real-world experience including > > sug

[ANN] Python FTP Server library (pyftpdlib) 0.5.1 released

2009-01-21 Thread Giampaolo Rodola'
http://code.google.com/p/pyftpdlib/wiki/Tutorial * FAQs: http://code.google.com/p/pyftpdlib/wiki/FAQ * RFCs compliance paper: http://code.google.com/p/pyftpdlib/wiki/RFCsCompliance * Issue tracker: http://code.google.com/p/pyftpdlib/issues/list * Mailing list: http://groups.google.com/group/pyftpdlib

Re: vb2py status?

2009-01-17 Thread Giampaolo Rodola'
On 17 Gen, 11:05, Vito De Tullio wrote: > axtens wrote: > > So is vb2py dead? If not, any idea when it'll support python 3? > > I don't know this vb2py, but you can do a 2 pass conversion > > [vb] -> (vb2py) -> [py2] -> (2to3) -> [py3] > > -- > By ZeD ...and presumibly get something which doesn't

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-17 Thread Giampaolo Rodola'
On 17 Gen, 05:26, John Machin wrote: > On Jan 17, 3:08 pm, Steve Holden wrote: > > > Giampaolo Rodola' wrote: > > > On 17 Gen, 04:43, Terry Reedy wrote: > > >> Giampaolo Rodola' wrote: > > >>> That would help to avoid replacing "&qu

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Giampaolo Rodola'
On 17 Gen, 04:43, Terry Reedy wrote: > Giampaolo Rodola' wrote: > > That would help to avoid replacing "" with b"" almost everywhere in my > > code. > > Won't 2to3 do that for you? I used 2to3 against my code but it didn't cover the "

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Giampaolo Rodola'
On 17 Gen, 03:40, Steve Holden wrote: > Giampaolo Rodola' wrote: > > On 17 Gen, 02:24, MRAB wrote: > > >> If you're truly working with strings of _characters_ then > >> 'str' is what you need, but if you're working with strings of _bytes

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Giampaolo Rodola'
On 17 Gen, 03:09, Steven D'Aprano wrote: > On Fri, 16 Jan 2009 17:32:17 -0800, Giampaolo Rodola' wrote: > > On 17 Gen, 02:24, MRAB wrote: > > >> If you're truly working with strings of _characters_ then 'str' is what > >> you need, but if

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Giampaolo Rodola'
On 17 Gen, 02:24, MRAB wrote: > If you're truly working with strings of _characters_ then > 'str' is what you need, but if you're working with strings of _bytes_ > then 'bytes' is what you need. I work with string of characters but to convert bytes into string I need to specify an encoding and t

Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Giampaolo Rodola'
Hi, I'm sure the message I'm going to write will seem quite dumb to most people but I really don't understand the str/bytes/unicode differences introduced in Python 3.0 so be patient. What I'm trying to do is porting pyftpdlib to Python 3.x. I don't want to support Unicode. I don't want pyftpdlib

Re: download timeout vs. socket timeout

2009-01-10 Thread Giampaolo Rodola'
I'm sorry. I realized they had already replied when it was too late. --- Giampaolo http://code.google.com/p/pyftpdlib -- http://mail.python.org/mailman/listinfo/python-list

Re: download timeout vs. socket timeout

2009-01-10 Thread Giampaolo Rodola'
On 10 Gen, 03:07, "p." wrote: > i'm using urllib2 in python 2.4 > > wondering how people typically deal with the case in which a download > is too slow. setting the socket timeout only covers those cases where > there is no response in the socket for whatever the timeout period is. > what if, howe

Re: ssl module - how can I accept SSLv3 and TLSv1 protocols only?

2009-01-07 Thread Giampaolo Rodola'
On 7 Gen, 14:21, Jean-Paul Calderone wrote: > On Tue, 6 Jan 2009 19:01:48 -0800 (PST), Giampaolo Rodola' > wrote: > >Hi, > >I'm trying to add TLS/SSL support to pyftpdlib. > >Since various defects have been found in the SSLv2 protocol many FTPS > >serv

ssl module - how can I accept SSLv3 and TLSv1 protocols only?

2009-01-06 Thread Giampaolo Rodola'
Hi, I'm trying to add TLS/SSL support to pyftpdlib. Since various defects have been found in the SSLv2 protocol many FTPS servers (i.e. proftpd and vsftpd) decided to support SSLv3 and TLSv1 only and sistematically reject any client attempting to use SSLv2. Is there a way to tell ssl.wrap_socket()

Re: Why not Ruby?

2008-12-31 Thread Giampaolo Rodola'
On 31 Dic, 18:55, Xah Lee wrote: > Just spent 3 hours looking into Ruby today. Here's my short impression > for those interested. > > * Why Not Ruby? > http://xahlee.org/UnixResource_dir/writ/why_not_Ruby.html > > plain text version follows: > -- > > Why Not Ru

Re: How to "kill" orphaned threads at program exit

2008-12-28 Thread Giampaolo Rodola'
On 28 Dic, 18:47, Roy Smith wrote: > In article > , > "Giampaolo Rodola'" wrote: > > > Hi, > > I know that it's not possible to "kill" threads but I'm wondering if > > does exist some workaround for my problem. > > I have a

How to "kill" orphaned threads at program exit

2008-12-28 Thread Giampaolo Rodola'
Hi, I know that it's not possible to "kill" threads but I'm wondering if does exist some workaround for my problem. I have a test suite which does a massive usage of threads. Sometimes happens that one test fails, the test suite keeps running until the end, and when it's finished the program hangs

Re: New Python 3.0 string formatting - really necessary?

2008-12-19 Thread Giampaolo Rodola'
On 19 Dic, 17:01, walterbyrd wrote: > I have not worked with Python enough to really know. But, it seems to > me that more I look at python 3.0, the more I wonder if it isn't a > step backwards. > > To me, it seems that this: > > print "%s=%d" % ('this',99) > > Is much easier, and faster, to type,

Re: ethical questions about global variables

2008-12-16 Thread Giampaolo Rodola'
d be, rather than dealing with all sorts > of global variables floating around - which gets annoying pretty > quickly. > > On Dec 15, 9:45 pm, "Giampaolo Rodola'" wrote: > > > > > Hi, > > in a module of mine (ftpserver.py) I'd want to add a

Re: Free place to host python files?

2008-12-16 Thread Giampaolo Rodola'
On 16 Dic, 15:56, feba wrote: > On Dec 16, 8:29 am, s...@pobox.com wrote: > > >     feba> I'm getting started in python, and it would be helpful to have a > >     feba> place to put up various code snippets I've made, so I don't have > >     feba> to send them individually to each person I want to

Re: ethical questions about global variables

2008-12-16 Thread Giampaolo Rodola'
On 16 Dic, 07:23, Michele Simionato wrote: > On Dec 16, 3:45 am, "Giampaolo Rodola'" wrote: > > > Hi, > > in a module of mine (ftpserver.py) I'd want to add a (boolean) global > > variable named "use_gmt_times" to decide whether the server h

ethical questions about global variables

2008-12-15 Thread Giampaolo Rodola'
Hi, in a module of mine (ftpserver.py) I'd want to add a (boolean) global variable named "use_gmt_times" to decide whether the server has to return times in GMT or localtime but I'm not sure if it is a good idea because of the "ethical" doubts I'm gonna write below. In first place I've never liked

Re: Python is slow

2008-12-11 Thread Giampaolo Rodola'
On 11 Dic, 13:06, Luis M. González wrote: > On Dec 10, 3:42 pm, cm_gui wrote: > > > > > > >http://blog.kowalczyk.info/blog/2008/07/05/why-google-should-sponsor-... > > > I fully agree with Krzysztof Kowalczyk . > > Can't they build a faster VM for Python since they love the language > > so much?

Re: How to know when it's possible to bind a socket on an unprivileged port?

2008-12-11 Thread Giampaolo Rodola'
Another way (probably more reliable): def bind_on_privileged_ports(): """Return True if it is possible to bind sockets on privileged ports (< 1024).""" for port in range(1, 1024)[::-1]: print port try: s = socket.socket() s.bind((HOST, port))

Re: How to know when it's possible to bind a socket on an unprivileged port?

2008-12-11 Thread Giampaolo Rodola'
On 11 Dic, 19:09, "Giampaolo Rodola'" wrote: > Hi, > For a purpose of testing I need a function which could tell me whether > it is possible to bind sockets on privileged ports or not. > I wrote down this simple function. It seems reasonably working to me > but I

How to know when it's possible to bind a socket on an unprivileged port?

2008-12-11 Thread Giampaolo Rodola'
Hi, For a purpose of testing I need a function which could tell me whether it is possible to bind sockets on privileged ports or not. I wrote down this simple function. It seems reasonably working to me but I'd like to hear your opinion first. Thanks in advance. import socket, errno def bind_on

Re: Using thread in an asyncronous application

2008-11-29 Thread Giampaolo Rodola'
On 29 Nov, 02:24, Aaron Brady <[EMAIL PROTECTED]> wrote: > On Nov 27, 9:03 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > I'm the maintainer of an asynchronous FTP server implementation based > > on as

Using thread in an asyncronous application

2008-11-27 Thread Giampaolo Rodola'
Hi, I'm the maintainer of an asynchronous FTP server implementation based on asyncore. Some days ago I thought it would be interesting to add a class offering the possibility to run the asyncore loop into a thread so that a user can run the server without blocking the entire application. It could b

Re: Quick question about None and comparisons

2008-11-25 Thread Giampaolo Rodola'
Ok thanks. I'll avoid to do that. --- Giampaolo http://code.google.com/p/pyftpdlib/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Start learning 2.6 or wait for 3.0?

2008-11-24 Thread Giampaolo Rodola'
Definitively 2.X. Whether 2.5 or 2.6 doesn't really matter. --- Giampaolo http://code.google.com/p/pyftpdlib/ -- http://mail.python.org/mailman/listinfo/python-list

Quick question about None and comparisons

2008-11-24 Thread Giampaolo Rodola'
Sorry for the title but I didn't find anything more appropriate. To have a less verbose code would it be ok doing: if a > b: ...instead of: if a is not None and a > b: ...? Is there any hidden complication behind that? Thanks in advance --- Giampaolo code.google.com/p/pyftpdlib/ -- http://ma

Re: Determine the best buffer sizes when using socket.send() and socket.recv()

2008-11-14 Thread Giampaolo Rodola'
On Nov 14, 5:27 pm, Greg Copeland <[EMAIL PROTECTED]> wrote: > On Nov 14, 9:56 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > I'd like to know if there's a way to determine which is the best > > buf

Determine the best buffer sizes when using socket.send() and socket.recv()

2008-11-14 Thread Giampaolo Rodola'
Hi, I'd like to know if there's a way to determine which is the best buffer size to use when you have to send() and recv() some data over the network. I have an FTP server application which, on data channel, uses 8192 bytes as buffer for both incoming and outgoing data. Some time ago I received a r

What happened to python-dev's Google Group?

2008-10-23 Thread Giampaolo Rodola'
http://groups.google.com/group/python-dev2 It seems it no longer exists. What happened? -- http://mail.python.org/mailman/listinfo/python-list

ANN: Python FTP Server library (pyftpdlib) 0.5.0 released

2008-09-20 Thread Giampaolo Rodola'
pdlib-0.5.0.tar.gz * Online docs: http://code.google.com/p/pyftpdlib/wiki/Tutorial * FAQs: http://code.google.com/p/pyftpdlib/wiki/FAQ * RFCs compliance paper: http://code.google.com/p/pyftpdlib/wiki/RFCsCompliance * Issue tracker: http://code.google.com/p/pyftpdlib/issues/list Thanks, --- Giam

Re: ssl server

2008-09-17 Thread Giampaolo Rodola'
On 17 Set, 19:33, Seb <[EMAIL PROTECTED]> wrote: > I'm making a ssl server, but I'm not sure how I can verify the > clients. What do I actually need to place in _verify to actually > verify that the client cert is signed by me? > >  50 class SSLTCPServer(TCPServer): >  51         keyFile = "sslcert

Re: Please help me finding a way to implement os.path.issubpath(a, b)

2008-09-12 Thread Giampaolo Rodola'
On Sep 11, 8:04 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Sep 11, 5:40 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I'm trying to implement a function which returns whether a path is a > > subpath

Please help me finding a way to implement os.path.issubpath(a, b)

2008-09-11 Thread Giampaolo Rodola'
Hi, I'm trying to implement a function which returns whether a path is a subpath of another one (e.g. /a/b/c is a subpath of /a/b). I wrote this function which apparently seems to work fine: import os def issubpath(path1, path2): """Return True if path1 is a sub path of path2.""" if path1

Re: Safely move an element into a heap

2008-09-04 Thread Giampaolo Rodola'
On 4 Set, 13:49, Alexandru Palade <[EMAIL PROTECTED]> wrote: > I'm not sure what you expect as an answer, but if you mean the heap as > in the data structure, you can not just arbitrarily move one key where > you want as it will destroy the heap property. > > > >

Safely move an element into a heap

2008-09-04 Thread Giampaolo Rodola'
Hi, I wanted to know if does exist a safe way to, given a heap, move an arbitrary element to the first position of the heap. Something like: >>> heap = [0,3,6,8,10] >>> heapq.move_to_first_position(heap, 4) >>> heap = [10, 0,3,6,8] --- Giampaolo http://code.google.com/p/pyftpdlib/ -- http://m

Re: Searching for some kind of data type

2008-08-02 Thread Giampaolo Rodola'
On 2 Ago, 18:18, Gary Herron <[EMAIL PROTECTED]> wrote: > Larry Bates wrote: > > Giampaolo Rodola' wrote: > >> Hi, > >> for an FTP server I wrote I'd need to group the FTP commands in one > >> table that defines the command itself, the syntax s

  1   2   >