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

PR: Fix for arguments to be converted to string format #17403

Merged
merged 2 commits into from
Feb 26, 2022

Conversation

dan123456-eng
Copy link
Contributor

@dan123456-eng dan123456-eng commented Feb 26, 2022

Description of Changes

Added %s in logger.info("Dropping message because kernel is dead: ", str(call_dict)) .

Now "logger.info("Dropping message because kernel is dead: %s", str(call_dict))" .

BUG: Some log arguments are not converted to string format

Error in sys.excepthook:
Traceback (most recent call last):
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\site-packages\spyder\plugins\ipythonconsole\widgets\client.py", line 767, in kernel_restarted_message
    self.poll_std_file_change()
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\site-packages\spyder\plugins\ipythonconsole\widgets\client.py", line 392, in poll_std_file_change
    self.shellwidget.call_kernel().flush_std()
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\site-packages\spyder_kernels\comms\commbase.py", line 554, in __call__
    return self._comms_wrapper._get_call_return_value(
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\site-packages\spyder\plugins\ipythonconsole\comms\kernelcomm.py", line 194, in _get_call_return_value
    logger.info(
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\logging\__init__.py", line 1446, in info
    self._log(INFO, msg, args, **kwargs)
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\logging\__init__.py", line 1589, in _log
    self.handle(record)
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\logging\__init__.py", line 1599, in handle
    self.callHandlers(record)
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\logging\__init__.py", line 1661, in callHandlers
    hdlr.handle(record)
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\logging\__init__.py", line 954, in handle
    self.emit(record)
  File "c:\users\dan-s\ciermag-system-develop\packages\pymr\pymr\core\log.py", line 101, in emit
    record_formatted = self.format(record)
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\logging\__init__.py", line 929, in format
    return fmt.format(record)
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\logging\__init__.py", line 668, in format
    record.message = record.getMessage()
  File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\lib\logging\__init__.py", line 373, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting

@pep8speaks
Copy link

pep8speaks commented Feb 26, 2022

Hello @dan123456-eng! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-02-26 17:34:12 UTC

@ccordoba12 ccordoba12 added this to the v5.3.0 milestone Feb 26, 2022
@ccordoba12 ccordoba12 changed the title PR: fix for arguments to be converted to string format PR: Fix for arguments to be converted to string format Feb 26, 2022
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution @dan123456-eng!

@ccordoba12 ccordoba12 merged commit 939f92e into spyder-ide:5.x Feb 26, 2022
ccordoba12 added a commit that referenced this pull request Feb 26, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants