Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Python bindings: methods expecting a path don't accept a string #4472

Closed
jmarrec opened this issue Oct 19, 2021 · 0 comments · Fixed by #4473
Closed

Python bindings: methods expecting a path don't accept a string #4472

jmarrec opened this issue Oct 19, 2021 · 0 comments · Fixed by #4473

Comments

@jmarrec
Copy link
Collaborator

jmarrec commented Oct 19, 2021

Issue overview

Python bindings: methods expecting a path don't accept a string

Current Behavior

python:

import openstudio
openstudio.Workspace.load(openstudio.toPath('in.idf')) # Works
openstudio.Workspace.load('in.idf') # Does not work

ruby:

require 'openstudio'
Openstudio::Workspace::load(OpenStudio::toPath('in.idf')) # Works
Openstudio::Workspace::load('in.idf') # Works

Expected Behavior

openstudio.Workspace.load('in.idf') should work like it does in ruby. It's annoying to have to explicitly create OpenStudio paths

Steps to Reproduce

See current behavior.

Possible Solution

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): All
  • Version of OpenStudio (if using an intermediate build, include SHA): 3.3.0-alpha

Context

@jmarrec jmarrec self-assigned this Oct 19, 2021
@jmarrec jmarrec changed the title Python bindings: methods expecting a path don't accept a std::string Python bindings: methods expecting a path don't accept a string Oct 19, 2021
jmarrec added a commit that referenced this issue Oct 19, 2021
…ng with Py3 support (type of str changed from Py2 to Py3)
tijcolem added a commit that referenced this issue Oct 19, 2021
Fix #4472 - Modify Python in typemaps for `path` to accept string with Python 3 support
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
1 participant