Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

TypeError when service name is a number #1845

Closed
juliantaylor opened this issue Aug 11, 2015 · 8 comments
Closed

TypeError when service name is a number #1845

juliantaylor opened this issue Aug 11, 2015 · 8 comments
Assignees
Labels

Comments

@juliantaylor
Copy link

1:
    build: .

leads to a type error and not a useful error message like invalid name

Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 39, in main
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 57, in perform_command
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 79, in get_project
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 85, in from_dicts
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 85, in __init__
  File "/code/build/docker-compose/out00-PYZ.pyz/re", line 141, in match
TypeError: expected string or buffer
@aanand
Copy link

aanand commented Aug 11, 2015

@mnowster: Will #1808 catch this?

@mnowster
Copy link

@aanand yes, only these chars are allowed [a-zA-Z0-9._-]

@juliantaylor
Copy link
Author

a number matches that pattern

@mnowster
Copy link

sorry, yes you're absolutely right @juliantaylor , I need to drink some more coffee before re-reading my regexes.

@mnowster
Copy link

I'll add to my list to fix 👍

@juliantaylor
Copy link
Author

I assume it could be a valid service name, compose might just need to convert integer dictionary keys to strings.

@mnowster
Copy link

@juliantaylor yep, I think it could be a valid service name. This will get sorted in a separate PR rather than #1808
Thanks for reporting the issue!

@mnowster
Copy link

Fixed by #1855 but I didn't put the fixes in the comment so it didn't close this. face-palm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants