New submission from Mert Bora Alper:
Hello,
In Python 3.6.0, % formatting fails to find formatting code after a null byte
in bytes type.
Example:
>>> "%s_\x00%s" % ("hello", "world")
'hello_\x00world'
>>> b"%s_\x00
Changes by Mert Bora Alper :
--
components: +Interpreter Core
___
Python tracker
<http://bugs.python.org/issue29934>
___
___
Python-bugs-list mailing list
Unsub
New submission from Mert Bora Alper:
Sorry if the title is not descriptive enough.
When I try to execute a program from a directory which contains an
`__main__.py` file, argparse fails to detect programs name. For example:
$ ls foo
__main__.py
$ python3 foo
usage: foo [-h] [-c
Mert Bora Alper added the comment:
> I think this was just overlooked when implementing argparse. Most code out
> there is likely to get the executable name using:
>
> os.path.basename(sys.argv[0])
>
> Which is going to do exactly what you are seeing here when sys.argv
Mert Bora Alper added the comment:
> Thanks for the patch. We'll want a unit test for the behavior before
> committing this.
You're welcome. Since I have no experience in writing unit tests, I don't
really know where to start but I will try to do my best.
I added bet