Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1322 closed defect (fixed)

Read pbonds: 'str' object has no attribute 'decode'

Reported by: pascal.albanese@… Owned by: Tom Goddard
Priority: normal Milestone: 1.0
Component: Input/Output Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Windows-10-10.0.17134
ChimeraX Version: 0.8 (2018-09-07)
Description
(Describe the actions that caused this problem to occur here)
Hi, sorry for bothering you but i hv some issues while trying to load .pb files, maybe i'm doing something wrong. 

the input is the following (a plain text file with ".pb" in the name)

#1.1/R:28@CA #1.2/R:170@CA 
#1.1/R:200@CA #1.2/R:28@CA 
#1.1/R:200@CA #1.2/G:38@CA 
#1.1/R:200@CA #1.2/V:38@CA 
#1.1/R:200@CA #1.2/U:38@CA 
#1.1/R:190@CA #1.2/R:28@CA 
#1.1/R:190@CA #1.2/G:38@CA 
#1.1/R:190@CA #1.2/V:38@CA 
#1.1/R:190@CA #1.2/U:38@CA 
#1.1/R:190@CA #1.2/R:32@CA 

i tried different combinations but i'm not able to generate Sets of pseudobonds (as i expect it will happen by loading different files... or not?) 

Thanks for your help, 

Pascal

Log:
UCSF ChimeraX version: 0.8 (2018-09-07)  
How to cite UCSF ChimeraX  

open D:/UTRECHT_MS/xls/Lhcb4_MDFF/DSSO_CL_Lhcb4_interP.pb ↵

Traceback (most recent call last):  
  File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\ui\gui.py",
line 517, in _qt_safe  
    run(session, "open " \+ quote_if_necessary(paths[0]))  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\commands\run.py", line 31, in run  
    results = command.run(text, log=log)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\commands\cli.py", line 2561, in run  
    result = ci.function(session, **kw_args)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\commands\open.py", line 41, in open  
    from_database=from_database, ignore_cache=ignore_cache, **kw))  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\commands\open.py", line 110, in open  
    models = handle_unknown_kw(session.models.open, paths, format=format,
name=name, **kw)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\commands\open.py", line 62, in handle_unknown_kw  
    return f(*args, **kw)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\models.py", line 559, in open  
    session, filenames, format=format, name=name, **kw)  
  File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\core\io.py",
line 444, in open_multiple_data  
    models, status = open_data(session, fspec, format=format, name=name, **kw)  
  File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\core\io.py",
line 404, in open_data  
    models, status = open_func(*args, **kw)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\read_pbonds\\__init__.py", line 23, in open_file  
    return readpbonds.read_pseudobond_file(session, stream, file_name)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\read_pbonds\readpbonds.py", line 27, in read_pseudobond_file  
    aspec1, aspec2 = line.decode('utf-8').split()[:2]  
AttributeError: 'str' object has no attribute 'decode'  
  

AttributeError: 'str' object has no attribute 'decode'  
  
File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\read_pbonds\readpbonds.py", line 27, in read_pseudobond_file  
aspec1, aspec2 = line.decode('utf-8').split()[:2]  
  
See log for complete Python traceback.  
  

open D:/UTRECHT_MS/xls/Lhcb4_MDFF/LHCB4.cxs ↵

opened ChimeraX session  

show selAtoms ribbons ↵

hide selAtoms ↵

show #!1.1 models ↵

hide #!1.1 models ↵

hide #!2 models ↵

show #!2 models ↵

show selAtoms ↵

hide selAtoms surfaces ↵

hide selAtoms ↵

select #2 ↵

44 pseudobonds, 2 models selected  

~select #2 ↵

select subtract #2 ↵

Nothing selected  

show selAtoms ↵

Traceback (most recent call last):  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\ui\mousemodes.py", line 387, in <lambda>  
    gw.mouseReleaseEvent = lambda e, s=self: s._dispatch_mouse_event(e,
"mouse_up")  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\ui\mousemodes.py", line 326, in _dispatch_mouse_event  
    f(MouseEvent(event))  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\ui\mousemodes.py", line 460, in mouse_up  
    mouse_drag_select(self.mouse_down_position, event, self.mode,
self.session, self.view)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\ui\mousemodes.py", line 603, in mouse_drag_select  
    select_pick(session, pick, mode)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\ui\mousemodes.py", line 620, in select_pick  
    p.select(mode)  
AttributeError: 'PickedInstance' object has no attribute 'select'  
  

AttributeError: 'PickedInstance' object has no attribute 'select'  
  
File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\ui\mousemodes.py", line 620, in select_pick  
p.select(mode)  
  
See log for complete Python traceback.  
  

hide selAtoms ↵

select up ↵

433 atoms, 436 bonds selected  

select up ↵

3593 atoms, 3640 bonds selected  

show selAtoms surfaces ↵

open D:/UTRECHT_MS/xls/Lhcb4_MDFF/DSSO_CL_Lhcb4_interP.pb ↵

Traceback (most recent call last):  
  File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\ui\gui.py",
line 517, in _qt_safe  
    run(session, "open " \+ quote_if_necessary(paths[0]))  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\commands\run.py", line 31, in run  
    results = command.run(text, log=log)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\commands\cli.py", line 2561, in run  
    result = ci.function(session, **kw_args)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\commands\open.py", line 41, in open  
    from_database=from_database, ignore_cache=ignore_cache, **kw))  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\commands\open.py", line 110, in open  
    models = handle_unknown_kw(session.models.open, paths, format=format,
name=name, **kw)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\commands\open.py", line 62, in handle_unknown_kw  
    return f(*args, **kw)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\core\models.py", line 559, in open  
    session, filenames, format=format, name=name, **kw)  
  File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\core\io.py",
line 444, in open_multiple_data  
    models, status = open_data(session, fspec, format=format, name=name, **kw)  
  File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\core\io.py",
line 404, in open_data  
    models, status = open_func(*args, **kw)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\read_pbonds\\__init__.py", line 23, in open_file  
    return readpbonds.read_pseudobond_file(session, stream, file_name)  
  File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\read_pbonds\readpbonds.py", line 27, in read_pseudobond_file  
    aspec1, aspec2 = line.decode('utf-8').split()[:2]  
AttributeError: 'str' object has no attribute 'decode'  
  

AttributeError: 'str' object has no attribute 'decode'  
  
File "C:\Program Files\ChimeraX\bin\lib\site-
packages\chimerax\read_pbonds\readpbonds.py", line 27, in read_pseudobond_file  
aspec1, aspec2 = line.decode('utf-8').split()[:2]  
  
See log for complete Python traceback.  
  




OpenGL version: 3.3.0 NVIDIA 388.75
OpenGL renderer: GeForce 940M/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation

Change History (4)

comment:1 by Eric Pettersen, 7 years ago

Component: UnassignedInput/Output
Milestone: 1.0
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionRead pbonds: 'str' object has no attribute 'decode'

comment:2 by Tom Goddard, 7 years ago

Resolution: fixed
Status: assignedclosed

Fixed in tonights ChimeraX builds.

Some code changed so that the pseudobond reader is now getting a UTF-8 encoded stream instead of a byte stream.

in reply to:  3 ; comment:3 by pascal.albanese@…, 7 years ago

Thanks!

but i don't see the new build. Only for ubuntu and mac today.

Il giorno mar 25 set 2018 alle ore 20:36 ChimeraX <
ChimeraX-bugs-admin@cgl.ucsf.edu> ha scritto:


in reply to:  4 ; comment:4 by goddard@…, 7 years ago

The Windows ChimeraX build failed last night because of changes unrelated to this bug.  We will try to fix the problem so tonight's Windows ChimeraX build works.

If you want to fix the pseudobond reader in your current ChimeraX change the line

        aspec1, aspec2 = line.decode('utf-8').split()[:2]

to

        aspec1, aspec2 = line.split()[:2]

in file

	C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\read_pbonds\readpbonds.py

and restart ChimeraX.
Note: See TracTickets for help on using tickets.