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

AttributeError: 'NoneType' object has no attribute 'max_pdu_size' #998

Closed
snowuyl opened this issue Sep 12, 2022 · 3 comments · Fixed by #1001
Closed

AttributeError: 'NoneType' object has no attribute 'max_pdu_size' #998

snowuyl opened this issue Sep 12, 2022 · 3 comments · Fixed by #1001
Labels
Backend: WinRT Issues or PRs relating to the WinRT backend bug Something isn't working

Comments

@snowuyl
Copy link

snowuyl commented Sep 12, 2022

  • bleak version: 0.16.0
  • Python version: 3.10.7
  • Operating System: Windows 10

Description

python3 main.py
C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyhrv\utils.py:367: UserWarning: Signal duration is to short for segmentation into 300000s. Input data will be returned.
warnings.warn("Signal duration is to short for segmentation into %is. Input data will be returned." % duration)
C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyhrv\time_domain.py:303: UserWarning: Signal duration too short for SDANN computation.
warnings.warn("Signal duration too short for SDANN computation.")
C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyhrv\time_domain.py:576: UserWarning: CAUTION: The TINN computation is currently providing incorrect results in the most cases due to a malfunction of the function. This function will be reviewed over the next updates to solve this issue
warnings.warn('CAUTION: The TINN computation is currently providing incorrect results in the most cases due to a '
C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyhrv\nonlinear.py:308: UserWarning: Not enough NNI samples for Detrended Fluctuations Analysis.
warnings.warn("Not enough NNI samples for Detrended Fluctuations Analysis.")
10
BleDeviceStruct(name='ANCS3', address='E8:20:9F:75:90:08', rssi=-35)
_run_battery E8:20:9F:75:90:08
_run_uart E8:20:9F:75:90:08
Exception ignored in: <function BleakClientWinRT.connect..max_pdu_size_changed_handler at 0x0000020E13AD0C10>
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\bleak\backends\winrt\client.py", line 292, in max_pdu_size_changed_handler
logger.debug("max_pdu_size_changed_handler: %d", self._session.max_pdu_size)
AttributeError: 'NoneType' object has no attribute 'max_pdu_size'

dlech added a commit that referenced this issue Sep 12, 2022
It is possible that self._session is set to None when
max_pdu_size_changed_handler is called. So we can use the sender arg
instead to avoid a possible AttributeError.

Fixes #998.
@dlech dlech added bug Something isn't working Backend: WinRT Issues or PRs relating to the WinRT backend labels Sep 12, 2022
@dlech dlech closed this as completed in 21e72cb Sep 12, 2022
@dlech dlech mentioned this issue Sep 12, 2022
@snowuyl
Copy link
Author

snowuyl commented Sep 12, 2022

Which version of bleak solve this issue?

@dlech
Copy link
Collaborator

dlech commented Sep 12, 2022

v0.17.0. This information can always be found in the changelog.

@snowuyl
Copy link
Author

snowuyl commented Sep 13, 2022

Thanks for your reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend: WinRT Issues or PRs relating to the WinRT backend bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants