opensistemas-hub / osbrain

osBrain - A general-purpose multi-agent system module written in Python
https://osbrain.readthedocs.io/en/stable/
Apache License 2.0
176 stars 43 forks source link

remove b' from ipc socket names #304

Closed minrk closed 6 years ago

minrk commented 6 years ago

str(b"x") is b"x" so ipc sockets were being created as ~/.osbrain_ipc/b'37a76fda9a264...'. Instead, cast bytes to str via the bytes.decode() method.

Peque commented 6 years ago

@minrk Is it just an aesthetics change or did you find any issue with this?

@ocaballeror What do you say? I think it is fine to merge this; there is no practical difference and maybe socket file names look better without the b''.

codecov[bot] commented 6 years ago

Codecov Report

Merging #304 into master will increase coverage by 0.05%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
+ Coverage   99.19%   99.24%   +0.05%     
==========================================
  Files          26       26              
  Lines        3588     3588              
  Branches      257      257              
==========================================
+ Hits         3559     3561       +2     
+ Misses         16       15       -1     
+ Partials       13       12       -1
Impacted Files Coverage Δ
osbrain/agent.py 98.14% <100%> (ø) :arrow_up:
osbrain/tests/test_bugs.py 100% <0%> (+16.66%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 781e26d...d466893. Read the comment docs.

minrk commented 6 years ago

It is ultimately just aesthetics, but it would appear that this is the intended behavior of the code. It looks like just a small mistake, assuming that str(bytes) cast bytes to str (like it would have on Python 2), when it actually computes the string representation of the object, which adds the b'...' wrapper.