[Python-Dev] viewvc at svn.python.org down?

2007-12-26 Thread O.R.Senthil Kumaran
The viewvc interface of svn.python.org seems down.
svn is working properly though.
Anyone aware of the problem?


-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] IPv6 hostname resolution using socket.getaddrinfo()

2007-09-18 Thread O.R.Senthil Kumaran
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> :

> On python2.4.1
> 
> >>> socket.getaddrinfo('www.python.org', None, socket.AF_INET,
> socket.SOCK_DGRAM, socket.IPPROTO_IP, socket.AI_CANONNAME)
> [(2, 2, 17, 'dinsdale.python.org', ('82.94.237.218', 0))]
> >>>
> 
> Blinston.


Thanks a lot, Blinston. That helped.
I just have to take care of socket.AF_INET6 flag for IPv6 now.

>>>socket.getaddrinfo('localhost', None, socket.AF_INET6, socket.SOCK_DGRAM, 
>>>socket.IPPROTO_IP, socket.AI_CANONNAME)
[(10, 2, 17, 'localhost', ('fe80::219:5bff:fefd:6270', 0, 0, 0))]

Shall do a little more research on flags and see if documentation needs any 
update. Because current one speaks only about AI_CANONNAME being set.


Thank you. :)
Senthil



> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of O.R.Senthil Kumaran
> Sent: Monday, September 17, 2007 10:08 PM
> To: python-dev@python.org
> Subject: [Python-Dev] IPv6 hostname resolution using
> socket.getaddrinfo()
> 
> To get the hostname, I can use socket.gethostbyname() but that has an
> inherent limitation wherein does it not support IPv6 name resolution,
> and
> getaddrinfo() should be used instead.
> 
> Looking up the socket.getaddrinfo() documentation, I come to know that
> 
> The getaddrinfo() function returns a list of 5-tuples with the following
> structure:
> 
> (family, socktype, proto, canonname, sockaddr)
> 
> family, socktype, proto are all integer and are meant to be passed to
> the socket() function. canonname is a string representing the canonical
> name of the host. It can be a numeric IPv4/v6 address when AI_CANONNAME
> is specified for a numeric host.
> 
> With this information, if I try something like this:
> 
> >>> for res in socket.getaddrinfo('goofy.goofy.com', None,
>   socket.AI_CANONNAME):
> 
> print res
> 
> (2, 1, 6, '', ('10.98.1.6', 0))
> (2, 2, 17, '', ('10.98.1.6', 0))
> (2, 3, 0, '', ('10.98.1.6', 0))
> 
> In the output, I see the cannoname to be always blank ''. I am not
> getting the IPv4 or IPv6 address as a result of using getaddrinfo().
> 
> Am I making any mistake?
> 
> What i am trying is a replacement function for
> socket.gethostbyname(hostname) which will work for both IPv4 and IPv6
> (and make changes in urllib2 to support that)
> 
> # return hostbyname for either IPv4 or IPv6 address. Common function.
> 
> def ipv6_gethostbyname(hostname):
> for res in socket.getaddrinfo(hostname,None,
>   socket.AI_CANONNAME):
> fa, socktype, proto, canonname, sa = res
> return cannoname
> 
> The above function does not seem to work. It returns blank value only.
> 
> Any help/ pointers? 
> 
> --
> O.R.Senthil Kumaran
> http://uthcode.sarovar.org
> ___
> Python-Dev mailing list
> Python-Dev@python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/blinston_fernandes%40d
> ell.com

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] IPv6 hostname resolution using socket.getaddrinfo()

2007-09-17 Thread O.R.Senthil Kumaran
To get the hostname, I can use socket.gethostbyname() but that has an
inherent limitation wherein does it not support IPv6 name resolution, and
getaddrinfo() should be used instead.

Looking up the socket.getaddrinfo() documentation, I come to know that

The getaddrinfo() function returns a list of 5-tuples with the following
structure:

(family, socktype, proto, canonname, sockaddr)

family, socktype, proto are all integer and are meant to be passed to
the socket() function. canonname is a string representing the canonical
name of the host. It can be a numeric IPv4/v6 address when AI_CANONNAME
is specified for a numeric host.

With this information, if I try something like this:

>>> for res in socket.getaddrinfo('goofy.goofy.com', None,
socket.AI_CANONNAME):

print res

(2, 1, 6, '', ('10.98.1.6', 0))
(2, 2, 17, '', ('10.98.1.6', 0))
(2, 3, 0, '', ('10.98.1.6', 0))

In the output, I see the cannoname to be always blank ''. I am not
getting the IPv4 or IPv6 address as a result of using getaddrinfo().

Am I making any mistake?

What i am trying is a replacement function for
socket.gethostbyname(hostname) which will work for both IPv4 and IPv6 (and make 
changes in urllib2 to support that)

# return hostbyname for either IPv4 or IPv6 address. Common function.

def ipv6_gethostbyname(hostname):
for res in socket.getaddrinfo(hostname,None,
socket.AI_CANONNAME):
fa, socktype, proto, canonname, sa = res
return cannoname

The above function does not seem to work. It returns blank value only.

Any help/ pointers? 

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Roundup issue mails "Do not thread!"

2007-09-03 Thread O.R.Senthil Kumaran
* "Martin v. L?wis" <[EMAIL PROTECTED]> [2007-09-04 04:21:25]:

> > The issue000xxx emails might not being have In-Reply-To or References: 
> > header.
> 
> If messages are entered through the web interface, they won't have these
> headers.

Then I should file a bug/feature request for Roundup. How are others keeping 
track? Whenever I open an issue after analyzing the email message, I find that 
it salready discussed and state is changed, I had missed the further emails on 
the same issue due to non-threads.

Thanks,

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Roundup issue mails "Do not thread!"

2007-09-03 Thread O.R.Senthil Kumaran
Hi all,
Has anyone observed missing "email-threads" issue with Roundup bug 
tracker email? Any work around for that? 
I use mutt and find that roundup bug issue000xx mails are not being threaded.
Its not do with settings, I believe.
The issue000xxx emails might not being have In-Reply-To or References: header.



Why are some msgs threaded and others not?
You have some msgs which don't have correct

 In-Reply-To:
 References:

headers (or not set at all) and you've turned on

 $strict_threads

What do "->", "-?-" and "*>" mean in thread trees?
When you turn off

 $strict_threads

msgs with similar subjects get grouped together. In
...


-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] RFC - proposal for urilib. unified module of urlparse, urllib and urllib2

2007-08-19 Thread O.R.Senthil Kumaran
Hello All,

I am drafting a PEP proposing a module 'urilib', which will be the unified 
module of urlparse, urllib and urllib2.

a) _all_ functions will include from urlparse,urllib and urllib2.
b) overlapping functionality between urllib and urllib2 to be ironed out.
c) RFC3986 and RFC3987 compliant.

Cleanup task of urllib was my G-SoC, and this unified module is a suggestion 
with python 2.6 in mind.

I would like to know your thoughts on
- How should we plan to maintain the backward compatiblity?
- What other features should be kept in mind while designing?

Thanks,
Senthil



-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Tracker item: 735515 - urllib to cache 301 redirections?

2007-07-04 Thread O.R.Senthil Kumaran
Hi,
One of the tracker items: 735515 mentions that urllib should cache 301 and 302
redirections.

urllib / urllib2 should cache the results of 301
(permanent) redirections. This shouldn't break
anything, since it's just an internal optimisation
from one point of view -- but it's also what the
RFC (2616, section 10.3.2, first para) says
SHOULD happen. 

I am trying to understand, what does it mean.
Should the original url be avaiable to the user upon request as urllib
automatically calls the redirect_request and provides the redirected url only?

I am not completely getting what "cache - redirection" implies and what should
be done with the urllib2 module. Any pointers?

Thanks,

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Requesting commit access to python sandbox. Cleanup urllib2 - Summer of Code 2007 Project

2007-06-16 Thread O.R.Senthil Kumaran
* "Martin v. L?wis" <[EMAIL PROTECTED]> [2007-06-16 12:10:45]:

> > I am a student participant of Google Summer of Code 2007 and I am
> > working on the cleanup task of urllib2, with Skip as my mentor.
> 
> I have now given you write access. Please constrain all checkins
> to the sandbox; checkins elsewhere should be approved by your
> mentor.

Thanks Martin. I shall abide by the guidelines.

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [RFC] urlparse - parse query facility

2007-06-16 Thread O.R.Senthil Kumaran
* Fred L. Drake, Jr. <[EMAIL PROTECTED]> [2007-06-16 01:06:59]:

>  > * Coding question: Without retyping the bunch of code again in the
>  > BaseResult, would is the possible to call parse_qs/parse_qsl function on
>  > self.query and provide the result? Basically, what would be a good of
>  > doing it.
> 
> That's what I was thinking.  Just add something like this to BaseResult 
> (untested):
> 
> def parsedQuery(self, keep_blank_values=False, strict_parsing=False):
> return parse_qs(
> self.query,
> keep_blank_values=keep_blank_values,
> strict_parsing=strict_parsing)
> 
> def parsedQueryList(self, keep_blank_values=False, strict_parsing=False):
> return parse_qsl(
> self.query,
> keep_blank_values=keep_blank_values,
> strict_parsing=strict_parsing)

Thanks Fred. That really helped. :-)

I have updated the urlparse.py module, cgi.py and also included in the tests
in the test_urlparse.py to test this new functionality. 
test run passed for all the valid queries, except for these:

#("=", {}),
#("=&=", {}),
#("=;=", {}),

The testcases are basically from test_cgi.py module and there is comment on
validity of these 3 tests for query values. 

Pending stuff is updating the documentation.

I maintained all the files temporarily at:

http://cvs.sarovar.org/cgi-bin/cvsweb.cgi/python/?cvsroot=uthcode

I had requested a commit access to Summer of Code branch in my previous mail,
but I guess it not been noticed yet. I shall update the files later or
send in as patches for application.


> Whether there's a real win with this is unclear.  I generally prefer having 
> an 
> object that represents the URL and lets me get what I want from it, rather 
> than having to pass the bits around to separate parsing functions.  The 

I agree. This is really convenient when one comes to know about it.

Thanks,
Senthil

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [RFC] urlparse - parse query facility

2007-06-15 Thread O.R.Senthil Kumaran
* Fred L. Drake, Jr. <[EMAIL PROTECTED]> [2007-06-13 22:42:21]:

> I see no reason to incorporate the URL splitting into the function; the 
> existing function signatures for cgi.parse_qs and cgi.parse_qsl are 
> sufficient.

Thanks for the comments, Fred. I understand, that having the signatures of
parse_qs and parse_qsl are sufficient in the urlparse module and invoking the
same from cgi module will be correct.

The urlparse will cotain parse_qs and parse_qsl takes the query string (not
url) and with optional arguments keep_blank_values and strict_parsing (same as 
cgi).

http://deadbeefbabe.org/paste/5154

> It may be convenient to add methods to the urlparse.BaseResult class 
> providing 
> access to the parsed version of the query on the instance.
> 

This is where, I spent a little bit time and I am unable to comeout
conclusively as how it can be done.

Someone in the list, please help me.

* parse_qs or parse_qsl will be invoked on the query component separately by
the user.
* If parsed query needs to be available at the instance as a convenience
function, then we will have to assume the keep_blank_values and strict_parsing
values.
* Coding question: Without retyping the bunch of code again in the BaseResult,
would is the possible to call parse_qs/parse_qsl function on self.query and
provide the result? Basically, what would be a good of doing it.


Thanks,
Senthil

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [RFC] urlparse - parse query facility

2007-06-13 Thread O.R.Senthil Kumaran
* Jim Jewett <[EMAIL PROTECTED]> [2007-06-13 19:27:24]:

> > a) import cgi and call cgi module's query_ps.  [circular imports]
> 
>  or
> 
> > b) Implement a stand alone query parsing facility in urlparse *AS IN*
> > cgi module.
> 
>  Assuming (b), please remove the (code for the) parsing from the cgi
>  module, and just import it back from urlparse (or urllib).  Since cgi
>  already imports urllib (which imports urlparse), this isn't adding any
>  dependencies -- but it keeps the code in a single location.

Sure, thats a good idea as I see it. It wont break anything as well.

Thanks,

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] python/trunk/Lib/test/test_urllib.py (for ftpwrapper)

2007-05-27 Thread O.R.Senthil Kumaran
* ocean <[EMAIL PROTECTED]> [2007-05-26 13:50:40]:
> 
> http://mail.python.org/pipermail/python-checkins/2007-May/060507.html
> 
> Hello. I'm using Windows2000, I tried some investigation for
> test_ftpwrapper.
> 
> After I did this change, most errors were gone.
> 
> Index: Lib/urllib.py
> ===
> --- Lib/urllib.py (revision 55584)
> +++ Lib/urllib.py (working copy)
> @@ -833,7 +833,7 @@
>  self.busy = 0
>  self.ftp = ftplib.FTP()
>  self.ftp.connect(self.host, self.port, self.timeout)
> -self.ftp.login(self.user, self.passwd)
> +#self.ftp.login(self.user, self.passwd)
>  for dir in self.dirs:
>  self.ftp.cwd(dir)

The init function in urllib is called under cases when ftp retrive has failed
with one of ftp related errors. ( non-programmatic)
Under those cases, my assumption is we might require the ftp.login to be
present.
Are you sure, this change does not affect anyother places?

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Summary of Tracker Issues

2007-05-17 Thread O.R.Senthil Kumaran
* Greg Ewing <[EMAIL PROTECTED]> [2007-05-18 13:06:41]:
> 
> > Site: What is the futorh word of tihs scnnteee?
> > Answer: fourth.
> 
>  Are you sure it isn't "futorh"?-)
> 
:-) My idea was, a human got to answer it unscrambled as 'fourth' as  he
"understands" what the question is and gives the proper answer.
Agreed, there could be confusion at first.

For non-native speakers of English, this could be difficult if their
experience with English is less, but we will have to take a chance that anyone
capable of reading english should be able to figure it out.

Again these are my thoughts and I dont have a good data to prove it.
Implementation standpoint, this is one of the easiest I can think of.

Thanks,

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Summary of Tracker Issues

2007-05-17 Thread O.R.Senthil Kumaran
* Scott Dial <[EMAIL PROTECTED]> [2007-05-17 11:04:46]:

> However, it may also be because instead of using a graphic (which is 
> easily transplanted to another page), it uses ascii art which would 
> require more effort to extract and move to another page.

Another approach would be a 'text scrambler' logic:

You can aclltauy srlbcame the quiotesn psneeetrd wchih only a hmuan can
uetrnnadsd pperlory. The quiotesn ovubolsiy slouhd be a vrey vrey slmipe one.

And you can hvae a quiotesn form the quiotesn itslef.

Site: What is the futorh word of tihs scnnteee?

Answer: fourth.

Site: You are intelligent, I shall allow you.

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-09 Thread O.R.Senthil Kumaran
* James Y Knight <[EMAIL PROTECTED]> [2007-05-08 11:18:44]:

> On May 8, 2007, at 8:49 AM, Armin Rigo wrote:
> > On Tue, May 08, 2007 at 09:14:02AM +1000, Anthony Baxter wrote:
> >> I'd like to suggest that we remove all (or nearly all) uses of
> >> xrange from the stdlib. A quick scan shows that most of the usage
> >> of it is unnecessary. With it going away in 3.0, and it being
> >> informally deprecated anyway, it seems like a good thing to go away
> >> where possible.
> >
> > I personally think that replacing these with range() is a clean-up,  
> > but
> > I also know that not everybody agrees to that.  So: should we, or  
> > should
> > we not, replace xrange() with range() as a matter of clean-up when the
> > difference between the two is really completely irrelevant?
> 
> But doesn't doing this now this make the conversion to Py3 *harder*?  
> If 2to3 is going to rewrite xrange() as range(), and range() to list 
> (range()), then moving towards xrange where possible would actually  
> be preferable, wouldn't it? Or is there no plan to run 2to3 on the  
> stdlib?

Looking at xrange() and range() definitions and from this discussion, it seems
to me that xrange() to be preferable over range(). Its common that most of the
code have range() because its simple use in iteration, but if same
functionality is provided with xrange as an object. And doing
:s/xrange/range/g would make sense also. ( Am I right in understanding this?)

Why range or xrange and why not xrange or range?
Or is this discussion about why having two functions with similar (or rather
same) functionality, and lets move to one and in which case either of them is
fine.

-- 
O.R.Senthil Kumaran
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com