<p><a href="https://gerrit.osmocom.org/c/pysim/+/18159">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/pysim/+/18159/5/pySim/transport/modem_atcmd.py">File pySim/transport/modem_atcmd.py:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/pysim/+/18159/5/pySim/transport/modem_atcmd.py@50">Patch Set #5, Line 50:</a> <code style="font-family:monospace,monospace">             if type(cmd) is str:</code></p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">there is a problem here if cmd is not a string, as it's not initiliased.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I am not getting what you mean here, sorry. If it's not a string, it should be bytes.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">I thought the purpouse of this was to turn the string into bytes?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Yes, as written in the comment above. Either it's a string, so we convert it to bytes, or it's already bytes, so we use it as-is.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I guess you're still using Python 2? AFAIR, unlike Python 3, type(b'\xff') in Python 2 would be 'str', not 'bytes' as expected. If so, I am not going to fix / work around this.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">bcmd = cmd.encode()</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">This does not work with Python 3 :/</p><p style="white-space: pre-wrap; word-wrap: break-word;">AttributeError: 'bytes' object has no attribute 'encode'</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/18159">change 18159</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/pysim/+/18159"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I20bc00315e2c7c298f46283852865c1416047bc6 </div>
<div style="display:none"> Gerrit-Change-Number: 18159 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-CC: guilly@gmail.com <guilly@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 02 Jun 2020 13:22:23 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: guilly@gmail.com <guilly@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>