[issue19525] Strict indentation in Python3

2013-11-08 Thread Sworddragon
Sworddragon added the comment: Thanks for the example, this is what I had in mind. Python 3 does also still provide the -t option (I'm assuming for compatibility reasons) but python3 -h and the manpage aren't saying about this. -- ___ Python

[issue19531] Loading -OO bytecode files if -O was requested can lead to problems

2013-11-08 Thread Sworddragon
New submission from Sworddragon: The documentation says that -OO does remove docstrings so applications should be aware of it. But there is also a case where a valid declared docstring isn't accessible anymore if -O is given. First the testcase: test1.py: import test2 def test1

[issue19532] compileall -f doesn't force to write bytecode files

2013-11-08 Thread Sworddragon
New submission from Sworddragon: The force-option from compileall seems not to rebuild the bytecode files if they already exist. Here is an example of 2 calls: root@ubuntu:~# python3 -m compileall -f Skipping current directory Listing '/usr/lib/python3.3'... Compiling '/usr/lib/python3.3

[issue19533] Unloading docstrings from memory if -OO is given

2013-11-08 Thread Sworddragon
New submission from Sworddragon: Using -OO on a script will remove the __doc__ attributes but the docstrings will still be in the process memory. In the attachments is an example script which demonstrates this with a docstring of ~10 MiB (opening the file in an editor can need some time

[issue19525] Strict indentation in Python3

2013-11-07 Thread Sworddragon
New submission from Sworddragon: Python 2 provided this command line option: -t Issue a warning when a source file mixes tabs and spaces for indentation in a way that makes it depend on the worth of a tab expressed in spaces. Issue an error when the option is given twice. I'm wondering

[issue19015] Too long command returns 32512

2013-09-16 Thread Sworddragon
Sworddragon added the comment: I have figured out that system() in C can only take up to 65533 arguments after a command (so it is a 16 bit issue). Giving one more argument will result in the return code 32512 (which implies the exit code 127). -- resolution: - invalid status: open

[issue19015] Too long command returns 32512

2013-09-13 Thread Sworddragon
New submission from Sworddragon: If a command gets too long os.system() will return 32512. As I have figured out from Google this normally happens if the command can't be found. In the attachments is an example command which will fail on os.system() (it was generated as test during

[issue18836] Potential race condition in exceptions

2013-08-28 Thread Sworddragon
Sworddragon added the comment: You may want to have a look at sys.excepthook. This would not solve the race condition. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18836

[issue18836] Potential race condition in exceptions

2013-08-27 Thread Sworddragon
Sworddragon added the comment: but what if there is a bug in your code? Bugs in a python application can be fixed by the user while a specific behavior of the interpreter can't. Maybe you are also thinking in the wrong direction. Nobody wants a solution that traps the user forever. Also

[issue18836] Potential race condition in exceptions

2013-08-27 Thread Sworddragon
Sworddragon added the comment: Unless I'm completely misunderstanding (which I don't think I am), this is not a race condition, it is how the language is designed to operate. If it is intended not to be able to catch all exceptions and prevent a traceback being showed this should be indeed

[issue18836] Potential race condition in exceptions

2013-08-26 Thread Sworddragon
New submission from Sworddragon: On a try/except-block if an exception raises (for example KeyboardInterrupt) the except block could cause another exception and if this block tries to catch it too the nested except block could cause another exception again. This goes into an unlimited

[issue18836] Potential race condition in exceptions

2013-08-26 Thread Sworddragon
Changes by Sworddragon sworddrag...@aol.com: Added file: http://bugs.python.org/file31470/race_condition_slow.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18836

[issue18836] Potential race condition in exceptions

2013-08-26 Thread Sworddragon
Sworddragon added the comment: Are you saying that if the user keeps hitting ctrl+c you would need an endless chain of nested try/except in order to catch them all? Correct. For example if I want to show the user the message Aborted instead of a huge exception if he hits CTRL + C another

[issue18836] Potential race condition in exceptions

2013-08-26 Thread Sworddragon
Sworddragon added the comment: The problem is simple: It is not possible to catch every exception in an application. Even if you try to print a message and exit on an exception it is always possible that the user will see a traceback. -- ___ Python

[issue18824] Adding LogRecord attribute traceback

2013-08-24 Thread Sworddragon
New submission from Sworddragon: On configuring a logger with logging.basicConfig() and using logging.exception() the traceback is always written implicitly to the end. This makes it not possible to create a formation that writes something beyond the traceback. For example it could

[issue18825] Making msg optional on logging.exception() and similar variants

2013-08-24 Thread Sworddragon
New submission from Sworddragon: For logging.exception() and similar variants the msg argument must be passed but on a formation the LogRecord message is not mandatory. In this case wouldn't it be better to make the msg argument optional? At default it could be None

[issue18282] Ugly behavior of binary and unicode handling on reading unknown encoded files

2013-06-22 Thread Sworddragon
New submission from Sworddragon: Currently Python 3 has some problems of handling files with an unknown encoding. In this example we have a file encoded as ISO-8859-1 with the content รค which should be tried to be read. Lets see what Python 3 can currently do here: 1. We can simply open

[issue18074] argparse: Namespace can contain critical characters

2013-05-27 Thread Sworddragon
New submission from Sworddragon: Positional arguments which have no dest attribute doesn't replace any - with _. In the attachments is an example script which demonstrate this. The output looks like this: sworddragon@ubuntu:~$ ./args.py foo Namespace(foo-bar2='foo', foo_bar1=None

[issue18074] argparse: Namespace can contain critical characters

2013-05-27 Thread Sworddragon
Sworddragon added the comment: I have found another report about this: http://bugs.python.org/issue15125 -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18074

[issue18074] argparse: Namespace can contain critical characters

2013-05-27 Thread Sworddragon
Changes by Sworddragon sworddrag...@aol.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18074 ___ ___ Python-bugs-list

[issue16908] Enhancing performance and memory usage

2013-01-09 Thread Sworddragon
New submission from Sworddragon: On my system (Linux 64 Bit) I figured out that python 3 needs a little more memory than python 2 and it is a little bit slower. Here are some examples: sworddragon@ubuntu:~$ execution-time 'python2 -c print\(0\)' 0.21738 sworddragon@ubuntu:~$ execution-time

[issue16625] Exception on mode 'br'

2012-12-06 Thread Sworddragon
Sworddragon added the comment: Is this issue just for 2.7? 3.3 was selected as the affected version, but the error message text seems limited to 2.7 You have given me a good hint. My script is running on python3 with the shbang line #!/usr/bin/python3 -OOtt. But it makes a subcall

[issue16625] Exception on mode 'br'

2012-12-05 Thread Sworddragon
New submission from Sworddragon: The mode 'br' on open() can cause an exception with the following message: ValueError: mode string must begin with one of 'r', 'w', 'a' or 'U', not 'br'. Curriously most times the mode 'br' is working fine and I'm not able to create a simple test case where

[issue15449] Optional size argument for readline()

2012-07-25 Thread Sworddragon
New submission from Sworddragon sworddrag...@aol.com: For file objects the read() function has the optional size argument to limit the data that will be read. I'm wondering why there isn't such an argument for readline(). Theoretically lines in a file could have million of characters and even

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-05 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: If the connection gets lost and reconnected again but the ip address doesn't change storbinary() continues the data transfer. But if the ip address was changed due to the reconnect storbinary() hangs in a loop. I expect either

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-05 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: The problem is that it is for example here in germany very common that the provider disconnects the client every 24 hours and gives him a new ip address if his router reconnects. This makes it very difficult to send big files with ftplib

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-05 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: If i set the timeout argument an exception s thrown if the ip address is changed. At least it's a workaround but we should think about if Python shouldn't try to detect changes of the ip address. It would be nicer to continue the file

[issue13714] Methods of ftplib never ends if the ip address changes

2012-01-04 Thread Sworddragon
New submission from Sworddragon sworddrag...@aol.com: If a client gets a reconnect and a new ip from the provider the methods of ftplib can't handle this and are hanging in an infinite loop. For example if a file is transfered with storbinary() and the client gets a new ip address the script

[issue7936] sys.argv contains only scriptname

2010-06-14 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: I have set now the key to E:\Python31\python.exe %%1 %%* and it works. So Windows XP need double % too. The installer of the next version should consider this. -- ___ Python tracker rep

[issue7936] sys.argv contains only scriptname

2010-06-14 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: I made a mistake in the last post. After I have set the value, Python 2 was active and I forgot to set it to Python 3 back. This solution doesn't work. Well, I can't edit or delete the post

[issue7936] sys.argv contains only scriptname

2010-06-14 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: Now I found the real solution (and don't forgot to set it to Python 3 back). I have searched in the registry for python.exe to look how Python 2 is doing this. I sawed a key that looks dissimilar to the others before. It is the key

[issue7936] sys.argv contains only scriptname

2010-06-14 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: I have now uninstalled Python 2 and 3 and installed them new. First Python 2 with only register extension and compile files to bytecode. After this I have made the same with Python 3. In the Open with menu was now python registered which

[issue7936] sys.argv contains only scriptname

2010-06-13 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: This registry key contains E:\Python31\python.exe %1 %*. I have too 2 python versions installed and manually associated the .py files to Python 3. -- ___ Python tracker rep...@bugs.python.org http

[issue8984] Python 3 doesn't register script arguments

2010-06-12 Thread Sworddragon
New submission from Sworddragon sworddrag...@aol.com: Python 3.1.2 hasn't any arguments except the file name in sys.argv[0]. For example: build.py test sys.argv[1] will be empty. I tried even the first example from the documentation 15.4 (optparse) but the filename is None. In Python 2.6.5 all

[issue8984] Python 3 doesn't register script arguments

2010-06-12 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: Examplescript test.py: import sys print(sys.argv[1]) Call this script now with an argument, for exmaple: test.py 1234 I expect to see the string 1234 in the console but Python 3 says IndexError: list index out of range. With Python 2.6.5 I

[issue8984] Python 3 doesn't register script arguments

2010-06-12 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: I'm using Windows XP Professional SP3. I downloaded Python 3.1.2 from this site. Even Python 3.0.1 hasn't worked. -- components: +Library (Lib) -Interpreter Core ___ Python tracker rep

[issue8984] Python 3 doesn't register script arguments

2010-06-12 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: I have already installed Python 3.1.2 a second time. I have selected during the installation that the files shall be compiled into bytecode. -- components: +Library (Lib) -Interpreter Core

[issue8984] Python 3 doesn't register script arguments

2010-06-12 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: assoc .py .py=Python.File I tried this now with Ubuntu and Python 3.1.2 and all works fine. But under Windows XP it doesn't work. -- ___ Python tracker rep...@bugs.python.org http

[issue8984] Python 3 doesn't register script arguments

2010-06-12 Thread Sworddragon
Sworddragon sworddrag...@aol.com added the comment: ftype Python.File Python.File=E:\Python31\python.exe %1 %* -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8984

<    1   2