nacos-group / nacos-group/nacos-sdk-python
parse_nacos_server_addr()地址解析错误
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 471
- Forks
- 155
- PR merge metrics
- No merged PRs in 30d
Description
def parse_nacos_server_addr(server_addr):
sp = server_addr.split(":")
if len(sp) == 3:
return sp[0] + ":" + sp[1], int(sp[2])
else:
port = int(sp[1]) if len(sp) > 1 else 8848
return sp[0], port
int(sp[2])遇到非int的路径报错,sp[2]不一定是具体的端口号,可能包含其他路径,如:8080/diamond**
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the parse_nacos_server_addr(server_addr) function shown in the issue and reproduce the failure using an address such as 8080/diamond. Trace how the split result is converted to a port. Done means addresses containing an additional path no longer cause an integer-conversion error while preserving the port parsing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100