Skip to content

protect against ImportError.path being None#134

Merged
wjwwood merged 1 commit intomasterfrom
wjwwood-patch-1
Oct 26, 2017
Merged

protect against ImportError.path being None#134
wjwwood merged 1 commit intomasterfrom
wjwwood-patch-1

Conversation

@wjwwood
Copy link
Copy Markdown
Member

@wjwwood wjwwood commented Oct 26, 2017

Error looks something like:

  File "C:\path\to\ws\install\Lib\site-packages\rclpy\impl\implementation_singleton.py", line 35, in <module>
    if os.path.isfile(e.path):
  File "C:\Python36\lib\genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

@wjwwood wjwwood added the in review Waiting for review (Kanban column) label Oct 26, 2017
@wjwwood wjwwood merged commit 5516745 into master Oct 26, 2017
@wjwwood wjwwood removed the in review Waiting for review (Kanban column) label Oct 26, 2017
@wjwwood wjwwood deleted the wjwwood-patch-1 branch October 26, 2017 22:33
@dhood
Copy link
Copy Markdown
Member

dhood commented Oct 26, 2017

for future reference can you advise under what circumstances this error occurs?

@wjwwood
Copy link
Copy Markdown
Member Author

wjwwood commented Oct 26, 2017

@dhood If you run the script with the non-debug version of Python but only the debug version of the c extension exists (i.e. you use python3 rather than python3_d but only rclpy/_rclpy_d.pyd exists).

@dhood
Copy link
Copy Markdown
Member

dhood commented Oct 26, 2017

OK good to know

sloretz added a commit that referenced this pull request Nov 9, 2017
Moved wait set code to its own class for code reuse

Added timeout_sec_to_nsec()

wait_for_service() implemented with timers

Added unit tests for timeout_sec_to_nsec()

Added test for WaitSet class

Use negative timeouts to mean block forever

Double quotes to single quotes

Added wait_for_service() tests and fixed bugs it caught

Eliminate blind exception warning

Reduce flakiness of test by increasing time to 0.1s

Comment says negative timeouts block forever

Use :returns:

Move add_subscriptions()

arugments -> arguments

Daemon as keyword arg

Remove unnecessary namespace argument

Use S_TO_NS in test

More tests using S_TO_NS

Use monotonic clock for testing timer time

Increased test timeout by 30 seconds

CheckExact -> IsValid

Fixed wait_set not clearing ready_pointers

Remove unnecessary namespace keyword arg

Non-blocking wait

remove expression that always evaluates to True

Raise ValueError on invalid capsule

Simplified timeout_sec_to_nsec

Added 'WaitSet.destroy()' and made executor use it

GraphListener periodically checks if rclpy is shutdown

Misc fixes after pycapsule names

Wait set class always clears entities before waiting

Remove underscore on import

Reformat timeout line

Use () when raising exceptions

Removed _ on imports

Executor optimizations

~5% less overhead in wait_for_ready_callbacks()

Fixed executor yielding entities to wrong node

Also refactored some code to a sub-generator

Use list() only where necessary

Docstring in imperitive mood

Executors reuse iterator

moved some wait_set code into C

Avoid another list comprehension

Replaced WaitSet with C code in executor

Remove test code

Use lists instead of set

Use locally defined function instead of member function

Shorten code using macro

Move everything to new wait_set code

protect against ImportError.path being None (#134)

Free memory when things don't go as planned (#138)
sloretz added a commit that referenced this pull request Nov 9, 2017
Moved wait set code to its own class for code reuse

Added timeout_sec_to_nsec()

wait_for_service() implemented with timers

Added unit tests for timeout_sec_to_nsec()

Added test for WaitSet class

Use negative timeouts to mean block forever

Double quotes to single quotes

Added wait_for_service() tests and fixed bugs it caught

Eliminate blind exception warning

Reduce flakiness of test by increasing time to 0.1s

Comment says negative timeouts block forever

Use :returns:

Move add_subscriptions()

arugments -> arguments

Daemon as keyword arg

Remove unnecessary namespace argument

Use S_TO_NS in test

More tests using S_TO_NS

Use monotonic clock for testing timer time

Increased test timeout by 30 seconds

CheckExact -> IsValid

Fixed wait_set not clearing ready_pointers

Remove unnecessary namespace keyword arg

Non-blocking wait

remove expression that always evaluates to True

Raise ValueError on invalid capsule

Simplified timeout_sec_to_nsec

Added 'WaitSet.destroy()' and made executor use it

GraphListener periodically checks if rclpy is shutdown

Misc fixes after pycapsule names

Wait set class always clears entities before waiting

Remove underscore on import

Reformat timeout line

Use () when raising exceptions

Removed _ on imports

Executor optimizations

~5% less overhead in wait_for_ready_callbacks()

Fixed executor yielding entities to wrong node

Also refactored some code to a sub-generator

Use list() only where necessary

Docstring in imperitive mood

Executors reuse iterator

moved some wait_set code into C

Avoid another list comprehension

Replaced WaitSet with C code in executor

Remove test code

Use lists instead of set

Use locally defined function instead of member function

Shorten code using macro

Move everything to new wait_set code

protect against ImportError.path being None (#134)

Free memory when things don't go as planned (#138)
sloretz added a commit that referenced this pull request Nov 14, 2017
Moved wait set code to its own class for code reuse

Added timeout_sec_to_nsec()

wait_for_service() implemented with timers

Added unit tests for timeout_sec_to_nsec()

Added test for WaitSet class

Use negative timeouts to mean block forever

Double quotes to single quotes

Added wait_for_service() tests and fixed bugs it caught

Eliminate blind exception warning

Reduce flakiness of test by increasing time to 0.1s

Comment says negative timeouts block forever

Use :returns:

Move add_subscriptions()

arugments -> arguments

Daemon as keyword arg

Remove unnecessary namespace argument

Use S_TO_NS in test

More tests using S_TO_NS

Use monotonic clock for testing timer time

Increased test timeout by 30 seconds

CheckExact -> IsValid

Fixed wait_set not clearing ready_pointers

Remove unnecessary namespace keyword arg

Non-blocking wait

remove expression that always evaluates to True

Raise ValueError on invalid capsule

Simplified timeout_sec_to_nsec

Added 'WaitSet.destroy()' and made executor use it

GraphListener periodically checks if rclpy is shutdown

Misc fixes after pycapsule names

Wait set class always clears entities before waiting

Remove underscore on import

Reformat timeout line

Use () when raising exceptions

Removed _ on imports

Executor optimizations

~5% less overhead in wait_for_ready_callbacks()

Fixed executor yielding entities to wrong node

Also refactored some code to a sub-generator

Use list() only where necessary

Docstring in imperitive mood

Executors reuse iterator

moved some wait_set code into C

Avoid another list comprehension

Replaced WaitSet with C code in executor

Remove test code

Use lists instead of set

Use locally defined function instead of member function

Shorten code using macro

Move everything to new wait_set code

protect against ImportError.path being None (#134)

Free memory when things don't go as planned (#138)
sloretz added a commit that referenced this pull request Nov 15, 2017
Moved wait set code to its own class for code reuse

Added timeout_sec_to_nsec()

wait_for_service() implemented with timers

Added unit tests for timeout_sec_to_nsec()

Added test for WaitSet class

Use negative timeouts to mean block forever

Double quotes to single quotes

Added wait_for_service() tests and fixed bugs it caught

Eliminate blind exception warning

Reduce flakiness of test by increasing time to 0.1s

Comment says negative timeouts block forever

Use :returns:

Move add_subscriptions()

arugments -> arguments

Daemon as keyword arg

Remove unnecessary namespace argument

Use S_TO_NS in test

More tests using S_TO_NS

Use monotonic clock for testing timer time

Increased test timeout by 30 seconds

CheckExact -> IsValid

Fixed wait_set not clearing ready_pointers

Remove unnecessary namespace keyword arg

Non-blocking wait

remove expression that always evaluates to True

Raise ValueError on invalid capsule

Simplified timeout_sec_to_nsec

Added 'WaitSet.destroy()' and made executor use it

GraphListener periodically checks if rclpy is shutdown

Misc fixes after pycapsule names

Wait set class always clears entities before waiting

Remove underscore on import

Reformat timeout line

Use () when raising exceptions

Removed _ on imports

Executor optimizations

~5% less overhead in wait_for_ready_callbacks()

Fixed executor yielding entities to wrong node

Also refactored some code to a sub-generator

Use list() only where necessary

Docstring in imperitive mood

Executors reuse iterator

moved some wait_set code into C

Avoid another list comprehension

Replaced WaitSet with C code in executor

Remove test code

Use lists instead of set

Use locally defined function instead of member function

Shorten code using macro

Move everything to new wait_set code

protect against ImportError.path being None (#134)

Free memory when things don't go as planned (#138)
YuanYuYuan pushed a commit to YuanYuYuan/rclpy that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants