question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'NoneType' object has no attribute 'path'

See original GitHub issue

I might be invoking incorrectly etc, but at least it must crash more informatively

(git-annex)hopa:~/.tmp/datalad_temp_tree_test_within_ds_file_searchn0QiIy[master]git
$> python -c 'import  bids as b; print(b.__version__); print(b.BIDSLayout(".").get_metadata("./participants.tsv"));'           
0.7.1+1.g13c857f
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/yoh/proj/bids/pybids/bids/layout/layout.py", line 482, in get_metadata
    self.metadata_index.index_file(path)
  File "/home/yoh/proj/bids/pybids/bids/layout/layout.py", line 677, in index_file
    if f.path in self.file_index and not overwrite:
AttributeError: 'NoneType' object has no attribute 'path'


$> tree
.
├── dataset_description.json -> .git/annex/objects/7W/Jm/MD5E-s328--28119d1fde6310f8119eda16bb00aead.json/MD5E-s328--28119d1fde6310f8119eda16bb00aead.json
├── derivatives
│   └── empty
├── participants.tsv -> .git/annex/objects/k4/gM/MD5E-s134--7f970918cea1615f0f3c9500907935a8.tsv/MD5E-s134--7f970918cea1615f0f3c9500907935a8.tsv
├── stim
├── sub-01
│   └── func
│       └── sub-01_task-some_bold.nii.gz -> ../../.git/annex/objects/W4/ZZ/MD5E-s15920--acfb708aa74951cfff1a9d466f6d77be.nii.gz/MD5E-s15920--acfb708aa74951cfff1a9d466f6d77be.nii.gz
└── sub-03
    └── func
        └── sub-03_task-other_bold.nii.gz -> ../../.git/annex/objects/W4/ZZ/MD5E-s15920--acfb708aa74951cfff1a9d466f6d77be.nii.gz/MD5E-s15920--acfb708aa74951cfff1a9d466f6d77be.nii.gz

7 directories, 4 files

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
yarikopticcommented, Feb 10, 2019

… then we have to systematically check each available layout (starting with the parent)

why? just expand them right away using the parent’s path. So for derivatives it would be derivatives/<name> . if derivative is not under derivatives/ then I guess full path would be needed. This way at least it shouldn’t be worse than current situation.

0reactions
tyarkonicommented, Feb 12, 2019

Actually, hold that thought. There’s still a problem when initializing a layout with path='.'; will push a fix shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception AttributeError: "'NoneType' object has no attribute ...
This tells that in function _remove an attribute path was tried to be accessed on a NoneType object. NoneType objects have no attributes....
Read more >
'NoneType' object has no attribute '_inc_path' - Google Groups
Basically I am getting this error. AttributeError at /admin/pages/new/wagtail_articles/articleindex/3/ 'NoneType' object has no attribute '_inc_path'
Read more >
AttributeError: 'NoneType' object has no attribute 'mkdir'
Cells 1 and 2 execute w/o error. But when I try to run cell 3, which is: path = untar_data(URLs.MNIST_SAMPLE). I get this...
Read more >
Attributeerror: 'nonetype' object has no attribute 'shape'
The first way to solve the error is to first check the value of the variable if it is 'None'. The second way...
Read more >
AttributeError: 'NoneType' object has no attribute 'get_path_url ...
Trac detected an internal error: AttributeError: 'NoneType' object has no attribute ... return tag.a(_('Subversion'), href=repos.get_path_url(path, None)).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found