[FIXED] DeprecationWarning

View previous topic View next topic Go down

[FIXED] DeprecationWarning

Post  anomander on Fri Apr 05, 2013 4:48 am

Setting up a dedicated virtual machine for CT. Using debian 6.0.6, SVN checkout of CT etc.

I see this warning on every conversion. It is trivial if a tad annoying:

Code:

# python /home/user/svn/comictagger/comictagger.py -e ./*****.cbr
/home/user/svn/comictagger/comictaggerlib/settings.py:163: DeprecationWarning: This method will be removed in future versions.  Use 'parser.read_file()' instead.
  self.config.readfp(codecs.open(self.settings_file, "r", "utf8"))
Archive exported successfully to: *****.cbz

Can we silence or remove this issue?


Last edited by anomander on Sat Apr 06, 2013 2:46 am; edited 1 time in total
avatar
anomander

Posts : 74
Join date : 2013-03-28

View user profile

Back to top Go down

Re: [FIXED] DeprecationWarning

Post  ComicTagger on Fri Apr 05, 2013 4:18 pm

Hmm, I wonder why you're getting that? I seem to have the latest version "configparser" and I don't ever see that. Just curious, what version of Python are you running?

At any rate, the next release should fix this. As I can't test it, I would appreciate it if you you do this:

In settings.py, in the function "load()", can you replace the line :

Code:
      self.config.readfp(codecs.open(self.settings_file, "r", "utf8"))
with:
Code:
      def readline_generator(f):
         line = f.readline()
         while line:
            yield line
            line = f.readline()         

      self.config.read_file(readline_generator(codecs.open(self.settings_file, "r", "utf8")))

This should remove the warning.
avatar
ComicTagger
Admin

Posts : 208
Join date : 2012-12-02

View user profile http://comictagger.forumotion.com

Back to top Go down

Re: [FIXED] DeprecationWarning

Post  anomander on Sat Apr 06, 2013 2:45 am

I am running from svn so as soon as you checked it in i could svn up.

Updated to revision 583 and the issue has gone away.

For reference:

root@host:~# uname -a
Linux host2.6.32-5-amd64 #1 SMP Mon Feb 25 00:26:11 UTC 2013 x86_64 GNU/Linux
root@host:~# cat /etc/debian_version
6.0.7
root@host:~# python -V
Python 2.6.6


Nice work that man.
avatar
anomander

Posts : 74
Join date : 2013-03-28

View user profile

Back to top Go down

Re: [FIXED] DeprecationWarning

Post  ComicTagger on Sat Apr 06, 2013 3:24 pm

Glad it worked. I don't generally recommend updating and running from SVN, though. You might find things broken or acting weird.
avatar
ComicTagger
Admin

Posts : 208
Join date : 2012-12-02

View user profile http://comictagger.forumotion.com

Back to top Go down

Re: [FIXED] DeprecationWarning

Post  anomander on Sat Apr 06, 2013 3:36 pm

Agreed but thats the beauty of being able to roll back as well.

generally I dont either but i thought i could help test some stuff when needed and its the easiest way
avatar
anomander

Posts : 74
Join date : 2013-03-28

View user profile

Back to top Go down

Re: [FIXED] DeprecationWarning

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum