[issue29934] % formatting fails to find formatting code in bytes type after a null byte

2017-03-28 Thread Mert Bora Alper
Changes by Mert Bora Alper : -- components: +Interpreter Core ___ Python tracker <http://bugs.python.org/issue29934> ___ ___ Python-bugs-list mailing list Unsub

[issue29934] % formatting fails to find formatting code in bytes type after a null byte

2017-03-28 Thread Mert Bora Alper
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

[issue23994] argparse fails to detect program name when there is a slash at the end of the program's path

2015-04-20 Thread Mert Bora Alper
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

[issue23994] argparse fails to detect program name when there is a slash at the end of the program's path

2015-04-19 Thread Mert Bora Alper
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

[issue23994] argparse fails to detect program name when there is a slash at the end of the program's path

2015-04-18 Thread Mert Bora Alper
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