(Aug-25-2018, 04:15 PM)buran Wrote: [ -> ]rename your file to something different. At the moment it's name is logging.py and when you import logging it in fact import itself (i.e. you overshadow the built-in module with the same name)
so i did that, and now it starts giving me even crazier messages
Error:
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 983, in emit
msg = self.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 829, in format
return fmt.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 572, in format
s = self.formatMessage(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 541, in formatMessage
return self._style.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 384, in format
return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
File "<string>", line 1, in <module>
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 4, in <module>
logging.debug('Start of program')
Message: 'Start of program'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 983, in emit
msg = self.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 829, in format
return fmt.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 572, in format
s = self.formatMessage(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 541, in formatMessage
return self._style.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 384, in format
return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
File "<string>", line 1, in <module>
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 16, in <module>
print (factorial(5))
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 7, in factorial
logging.debug('Start of factorial(%s)' % (n))
Message: 'Start of factorial(5)'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 983, in emit
msg = self.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 829, in format
return fmt.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 572, in format
s = self.formatMessage(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 541, in formatMessage
return self._style.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 384, in format
return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
File "<string>", line 1, in <module>
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 16, in <module>
print (factorial(5))
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 11, in factorial
logging.debug('i is %s, total is %s' % (i, total))
Message: 'i is 0, total is 0'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 983, in emit
msg = self.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 829, in format
return fmt.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 572, in format
s = self.formatMessage(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 541, in formatMessage
return self._style.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 384, in format
return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
File "<string>", line 1, in <module>
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 16, in <module>
print (factorial(5))
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 11, in factorial
logging.debug('i is %s, total is %s' % (i, total))
Message: 'i is 1, total is 0'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 983, in emit
msg = self.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 829, in format
return fmt.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 572, in format
s = self.formatMessage(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 541, in formatMessage
return self._style.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 384, in format
return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
File "<string>", line 1, in <module>
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 16, in <module>
print (factorial(5))
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 11, in factorial
logging.debug('i is %s, total is %s' % (i, total))
Message: 'i is 2, total is 0'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 983, in emit
msg = self.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 829, in format
return fmt.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 572, in format
s = self.formatMessage(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 541, in formatMessage
return self._style.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 384, in format
return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
File "<string>", line 1, in <module>
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 16, in <module>
print (factorial(5))
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 11, in factorial
logging.debug('i is %s, total is %s' % (i, total))
Message: 'i is 3, total is 0'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 983, in emit
msg = self.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 829, in format
return fmt.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 572, in format
s = self.formatMessage(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 541, in formatMessage
return self._style.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 384, in format
return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
File "<string>", line 1, in <module>
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 16, in <module>
print (factorial(5))
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 11, in factorial
logging.debug('i is %s, total is %s' % (i, total))
Message: 'i is 4, total is 0'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 983, in emit
msg = self.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 829, in format
return fmt.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 572, in format
s = self.formatMessage(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 541, in formatMessage
return self._style.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 384, in format
return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
File "<string>", line 1, in <module>
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 16, in <module>
print (factorial(5))
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 11, in factorial
logging.debug('i is %s, total is %s' % (i, total))
Message: 'i is 5, total is 0'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 983, in emit
msg = self.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 829, in format
return fmt.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 572, in format
s = self.formatMessage(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 541, in formatMessage
return self._style.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 384, in format
return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
File "<string>", line 1, in <module>
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 16, in <module>
print (factorial(5))
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 13, in factorial
logging.debug('Return value is %s' % (total))
Message: 'Return value is 0'
Arguments: ()
0
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 983, in emit
msg = self.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 829, in format
return fmt.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 572, in format
s = self.formatMessage(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 541, in formatMessage
return self._style.format(record)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\logging\__init__.py", line 384, in format
return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
File "<string>", line 1, in <module>
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:\Users\MSI\AppData\Local\Programs\Python\Python37-32\Automate the Boring Stuff with Python Course\loggingstuff.py", line 18, in <module>
logging.debug('End of program')
Message: 'End of program'
Arguments: ()
idk if this is a successful run of logging or not. doesnt look the same as video does.