rstrip error python2.4.3 not in 2.5.1?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dirkheld

    rstrip error python2.4.3 not in 2.5.1?

    Hi,

    I wrote some python code that retrieves urls from a txt file. In this
    code I use .rstrip() for removing the '\n' at the end of every url.
    While this code works on my mac (leopard) with python 2.5.1, this same
    code fails to work on an ubuntu server with python 2.4.3

    I was wondering if there is a problem with .rstrip() in that python
    version?

    error :
    Traceback (most recent call last):
    File "delgraph.p y", line 62, in ?
    url_metadata = d.get_url(site. rstrip())
  • subeen

    #2
    Re: rstrip error python2.4.3 not in 2.5.1?

    rstrip() works fine in python 2.4.3. May be the problem lies in
    somewhere else.

    I tried it in FC6 with Python 2.4.3:
    >>url = "abc.com\n"
    >>url.rstrip( )
    'abc.com'


    regards,
    Subeen.


    On Feb 29, 2:30 am, dirkheld <dirkh...@gmail .comwrote:
    Hi,
    >
    I wrote some python code that retrieves urls from a txt file. In this
    code I use .rstrip() for removing the '\n' at the end of every url.
    While this code works on my mac (leopard) with python 2.5.1, this same
    code fails to work on an ubuntu server with python 2.4.3
    >
    I was wondering if there is a problem with .rstrip() in that python
    version?
    >
    error :
    Traceback (most recent call last):
    File "delgraph.p y", line 62, in ?
    url_metadata = d.get_url(site. rstrip())

    Comment

    • Terry Reedy

      #3
      Re: rstrip error python2.4.3 not in 2.5.1?


      "dirkheld" <dirkheld@gmail .comwrote in message
      news:3bb061c2-4ec0-4ad0-add0-035264caa28b@s3 7g2000prg.googl egroups.com...
      | Hi,
      |
      | I wrote some python code that retrieves urls from a txt file. In this
      | code I use .rstrip() for removing the '\n' at the end of every url.
      | While this code works on my mac (leopard) with python 2.5.1, this same
      | code fails to work on an ubuntu server with python 2.4.3
      |
      | I was wondering if there is a problem with .rstrip() in that python
      | version?
      |
      | error :
      | Traceback (most recent call last):
      | File "delgraph.p y", line 62, in ?
      | url_metadata = d.get_url(site. rstrip())
      | --

      What is the actual error message [SyntaxError, NameError? etc] that you
      clipped?



      Comment

      Working...