[issue36863] argparse doesn't like options in the middle of arguments

2019-05-11 Thread rhubarbdog x


rhubarbdog x  added the comment:

I've just done a test and from a command shell (bash or whatever) the following 
python script when ran produces the following

$ python3 command.py 0ne thwo three
files:  ['0ne', 'thwo', 'three']
sensors 1
freq 1200

$ python3 command.py -s 5 0ne thwo three
files:  ['0ne', 'thwo', 'three']
sensors 5
freq 1200

$ python3 command.py  0ne -s 5 thwo three
usage: command.py [-h] [-s SENSORS] [-f FREQ] file [file ...]
command.py: error: unrecognized arguments: thwo three

i've attached the program command.py

--
status: pending -> open
Added file: https://bugs.python.org/file48327/command.py

___
Python tracker 
<https://bugs.python.org/issue36863>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36863] argparse doesn't like options in the middle of arguments

2019-05-09 Thread rhubarbdog x


rhubarbdog x  added the comment:

This is when running is a shell which inherits from cmd.Cmd

--

___
Python tracker 
<https://bugs.python.org/issue36863>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36863] argparse doesn't like options in the middle of arguments

2019-05-09 Thread rhubarbdog x


New submission from rhubarbdog x :

I've found a bug with argparse and reported it upstream.
`command --option source destination` works
`command soucre destination --option` works
but `command source --option destination` doesn't outputting the usage text 
block associated `do_command` method and outputs error message `command: error: 
unrecognized arguments: destination`

--
components: Argument Clinic
messages: 341973
nosy: larry, rhubarbdog x
priority: normal
severity: normal
status: open
title: argparse doesn't like options in the middle of arguments

___
Python tracker 
<https://bugs.python.org/issue36863>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36259] exception text is being sourced from the wrong file

2019-03-10 Thread rhubarbdog x


New submission from rhubarbdog x :

Hi
i have a directory containing a directory `bug` and the python program 
`bad.py`.  The code for `bad.py` is
```
import os

os.chdir('bug')
print(7/0)
```

directory `bug` contains a file `bad.py` this file contents are
```
test 1
test 2
test 3
test 4
test 5
test 6
```

when i run the python script i get the error text
```
Traceback (most recent call last):
  File "bad.py", line 4, in 
test 4
ZeroDivisionError: division by zero
```

--
messages: 337642
nosy: rhubarbdog x
priority: normal
severity: normal
status: open
title: exception text is being sourced from the wrong file
type: behavior

___
Python tracker 
<https://bugs.python.org/issue36259>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com