Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: super() takes at least 1 argument (0 given) #1

Open
xiangmeng4geo opened this issue Mar 7, 2018 · 4 comments
Open

TypeError: super() takes at least 1 argument (0 given) #1

xiangmeng4geo opened this issue Mar 7, 2018 · 4 comments

Comments

@xiangmeng4geo
Copy link

Hi
When I use this lib,I meet some error. I think some bug in version 1.2.1.
the error is:

   th = TimedRotatingFileHandlerSafe(filename=self.logger_file, when="midnight", backupCount=10)
  File "/opt/WeatherDataCenter/wdc_env/lib/python2.7/site-packages/safe_logger/__init__.py", line 10, in __init__
    super().__init__(filename, when=when, backupCount=backupCount, **kwargs)
TypeError: super() takes at least 1 argument (0 given)

I think super may be call like :

super(TimedRotatingFileHandlerSafe,self).init(filename, when=when, backupCount=backupCount, **kwargs)

@cybergrind
Copy link
Owner

@xiangmeng4geo oh, it seems you're using python2. Am I right?

@cybergrind
Copy link
Owner

I've released 1.3.1 version with this particular fix.
It's a shame that it contains no tests but it was so battle-tested for years so I hoped that tests aren't required.

Could you please confirm if 1.3.1 works for you and close ticket if it is ok?

@xiangmeng4geo
Copy link
Author

xiangmeng4geo commented Apr 21, 2018

Yes,we are using python 2.7.
OK,I will try it next week. Thank you.

@xiangmeng4geo
Copy link
Author

xiangmeng4geo commented Jun 6, 2018

Sorry about feedback late,when I use 1.3.1, I got error like:

Traceback (most recent call last):
File "big_screen.py", line 67, in
big_screen_log = LoggerUtils("big_screen", "big_screen.log").get_logger()
File "big_screen.py", line 61, in get_logger
th = TimedRotatingFileHandlerSafe(filename=self.logger_file, when="midnight", backupCount=10)
File "/usr/lib/python2.6/site-packages/safe_logger/init.py", line 10, in init
super(TimedRotatingFileHandlerSafe, self).init(filename, when=when, backupCount=backupCount, **kwargs)
TypeError: super() argument 1 must be type, not classobj

And the python version on this server is 2.6.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants