[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: I've tested the new patch and it is still able to properly find both chrome and firefox and is able to differentiate between new window and new tab for those two browsers so it is still working. Would someone review the patch? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: applying 25005_1.patch patching file Lib/webbrowser.py Hunk #1 FAILED at 498 Hunk #2 FAILED at 524 Hunk #3 FAILED at 532 Hunk #4 FAILED at 540 Hunk #5 FAILED at 548 I'm trying to apply your patch after applying webbrowserfix6.patch but I am encountering problems. I first tried "hg import --no-commit file.patch" for both patches but it wouldn't let me use the command two times in a row without committing the changes for the first one so I tried committing the webbrowserfix6.patch changes and then using the import command and I get this error message. I would like to try to make sure the code still does what it is supposed to but I can't check until I can get both patches in. Hunk #6 FAILED at 556 6 out of 6 hunks FAILED -- saving rejects to file Lib/webbrowser.py.rej patching file Modules/posixmodule.c Hunk #1 FAILED at 10522 Hunk #2 FAILED at 10578 Hunk #3 FAILED at 10590 Hunk #4 FAILED at 10606 Hunk #5 FAILED at 10616 5 out of 5 hunks FAILED -- saving rejects to file Modules/posixmodule.c.rej abort: patch failed to apply -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: Ok I've been able to test the new patch now and I'm not sure that os.startfile is going to work. I've been able to get os.startfile() to open a specified browser (>>> os.startfile("chrome.exe", "open")), however, the function does not allow additional arguments(>>> os.startfile("chrome.exe", "open", "www.yahoo.com") Traceback (most recent call last): File "", line 1, in TypeError: startfile() takes at most 2 arguments (3 given))) so not even a url will be allowed to be specified as the code is written in the patch let alone specifying new window or new tab. Is this an error on os.startfile's part? The documentation for it seems to indicate that it should take multiple inputs. I don't have much experience with C to be able to find out figure out what the rest of your patch accomplished. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: Finally got it rebuilt after having trouble with visual studio for awhile. I've tested the new patch and it is still able to properly find both chrome and firefox and is able to differentiate between new window and new tab for those two browsers so it appears to still be working. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24452] Make webbrowser support Chrome on Mac OS X
Brandon Milam added the comment: BoĊĦtjan Mejak the windows issue has been addressed in issue 8232 and recently patched for 3.5. http://bugs.python.org/issue8232 -- nosy: +jbmilam ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24452 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: Moved the 64 bit browser list to its own loop and switched to browsers.append rather than +=. -- Added file: http://bugs.python.org/file39650/webbrowserfix6.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: Here's a patch addressing all of the comments in the review. Changing the browsers from a set to a list though resulted in duplicates in the _tryorder list that were not present before because the set had filtered the duplicates before the partial string comparisons. The _browsers dictionary did not contain the duplicates so I don't think this will have any functional changes. -- Added file: http://bugs.python.org/file39626/webbrowserfix5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24148] 'cum' not a valid sort key for pstats.Stats.sort_stats
Brandon Milam added the comment: They are correct. 'cum' is not one of the available keywords and so here is the fix changing it to say 'cumulative' for consistency as ramiro suggested. -- keywords: +patch nosy: +jbmilam Added file: http://bugs.python.org/file39627/profile_example_fix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24148 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: Forgive me the excessive number of patch submissions as I am still getting my feet wet in contributing to Python. I'm posting another patch that is not functionally different from the last patch but should better adhere to the PEP8 style guide. Please let me know of any additional changes that need to be made or if a different functionality is preferred. -- Added file: http://bugs.python.org/file39590/webbrowserfix4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12020] Attribute error with flush on stdout,stderr
Brandon Milam added the comment: I've been looking over the issue and the error is just raised by the stdout change not the stderr change (when the stdout line is commented out in the setAutoFlush function no error is raised). The flush method doesn't seem to be required as Serhiy pointed out since the script still is able to run. This is the cause for the error, however and I think that the required subset of methods for stdout objects to avoid errors could be clarified in the documentation. This documentation addition I think would be best under the sys.stdout info rather than under io.TextIOBase since the error can be raised without going through this class at all like in the original post. I would like to add this documentation under sys.stdout as required subset of methods that must be defined and was wondering if there were any other methods than flush() that would need to be defined. -- nosy: +jbmilam ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12020 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21297] csv.skipinitialspace only skips spaces, not whitespace in general
Changes by Brandon Milam jmilam...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file39560/csv_skipinitialspace_docfix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21297] csv.skipinitialspace only skips spaces, not whitespace in general
Changes by Brandon Milam jmilam...@gmail.com: Added file: http://bugs.python.org/file39559/csv_skipinitialspace_testing.csv ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21297] csv.skipinitialspace only skips spaces, not whitespace in general
Brandon Milam added the comment: This code shows what Daniel Andersson was talking about. I changed the whitespace references in the documentation that Daniel mentioned to say spaces. Also I changed ignore space at the start of the field to ignore spaces at the start of the field due to Terry's confusion. Let me know of any errors or extra changes that are needed. -- nosy: +jbmilam Added file: http://bugs.python.org/file39558/csv_skipinitialspace_testing.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24147] Dialect class defaults are not documented.
Brandon Milam added the comment: Here I added on to the Dialects and Formatting Parameters paragraph explaining that the defaults listed are for the excel dialect and that all the attributes need to be specified if the user is wanting to create custom dialects through sub-classing. I will also include the html file this produces for those who do not want to look at the .rst file. Also I can go in and change the defaults of the Dialect class on the parameters that expect Boolean values if desired but I would open a separate issue for it. Let me know if there are any errors or desired changes in document change. -- keywords: +patch Added file: http://bugs.python.org/file39552/csv_dialect_doc_clarify.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24147 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24147] Dialect class defaults are not documented.
Changes by Brandon Milam jmilam...@gmail.com: Added file: http://bugs.python.org/file39553/csv.html ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24147 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23659] csv.register_dialect doc string
Brandon Milam added the comment: I believe this was the requested change. Let me know if more was desired. -- keywords: +patch nosy: +jbmilam Added file: http://bugs.python.org/file39540/register_dialect_docstring_fix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23659 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23659] csv.register_dialect doc string
Brandon Milam added the comment: Sorry, I forgot an end parentheses in the doc string of the last patch. -- Added file: http://bugs.python.org/file39541/register_dialect_docstring_fix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23659 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24147] Dialect class defaults are not documented.
Brandon Milam added the comment: Hi all, I've been looking at this bug and am ready to start putting in some work on it but I have some questions about what is wanting to be done. From what I can tell these are the possible tasks for this issue. - Add to the docs under the dialect section the excel attributes vs. the dialect class attributes and explain how the excel dialect is the default and this is the functionality you'd be changing by creating a new dialect. - Add code to make sure that a certain number of attributes are set before the dialect can be accessed. (Though this might be C code and not really a C programmer nor do I know where _Dialect is in the repository) - Change the defaults in the dialects class because currently the documentation for double quote and skip initial space says that the default is False when in the code it is None. Also I did not find the strict dialect in the module at all. (maybe its part of that C code that I don't know how to find. - Add an example to the documentation on sub-classing dialect under the example on registering a new dialect If someone could clarify which of these is the desired direction for this issue it would be much appreciated. -- nosy: +jbmilam ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24147 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: I went ahead and took the assert statement out and added support for vista using a union of sets for both the 32 bit and 64 bit locations. -- Added file: http://bugs.python.org/file39533/webbrowserfix3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: On second thought no type testing is required if sets are used because the union will take out duplicates anyways and so I removed the type testing and left in the set union code. -- Added file: http://bugs.python.org/file39534/webbrowserfix3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: I kept the changes to the WindowsDefault.open() method and used and extended eryksun's code to build the browser list using the registry. Also I added support for a few more browsers. Some of the browsers I could not find ways to differentiate between opening a new window or new tab using command line flags. This also removed the hardcoding I had put in the get function. -- Added file: http://bugs.python.org/file39525/webbrowserfix2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: I got rid of the __init__ for the WindowsDefault class that I asked about earlier and changed it to match the sub-classing model that the Unix browsers use. This caused some changes in the get function too. Due to the _isexecutable still not completely working, the get function is hard coded for chrome, internet explorer and firefox for windows systems. This is my first attempt at making a patch file so if it is incorrect please bear with me. -- keywords: +patch Added file: http://bugs.python.org/file36265/webbrowserfix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: In order to fix the issue I added on to the WindowsDefault class so that it is the main browser class for windows platforms as opposed to being a default when no other browser is given. I gave the class an init where it specifies specific flags for firefox, chrome, and internet explorer (from what I could find there aren't really new window or new tab flags for internet explorer). If the flags for other browsers are known they should be easy to add to this section. def __init__(self,browser = windows-default): # Grab the different flags for the different browser types browser.lower() self.browsername = browser # If get() is used without arguments browser will be passed None if browser == windows_default or browser == None: self.cmd = start elif browser == 'iexplore' or browser == 'internet explorer': self.cmd = start iexplore self.newwindow = self.newtab = elif browser == chrome: self.cmd = start chrome.exe self.newwindow = -new-window self.newtab = -new-tab elif browser == firefox: self.cmd = start firefox.exe self.newwindow = -new-window self.newtab = -new-tab else: raise Error('The browser you entered (%s) is not currently supported on windows' % browser) In the open method of the WindowsDefault class I changed how the browser is opened by building a command from the flags and the cmd for the specific browser and used subprocess,call. # Format the command for optional arguments and add the url if new == 1: self.cmd += + self.newwindow elif new == 2: self.cmd += + self.newtab self.cmd += + url subprocess.call(self.cmd,shell = True) This allows the user to input different new arguments to open a new window or new tab like the documentation says they should be able to do. I added a little bit to the beginning of the get function so that it passes its argument to the WindowsDefault class and returns that object on Windows systems. # Let the windows default class handle different browsers on windows if sys.platform[:3] == win: return WindowsDefault(using) This adds some of the desired compatibility but does not completely address the module's issues. I did not see a way to open a web page in a currently open page on any of the browsers, just new windows and new tabs (when no flags are passed the browsers default to one of these two options). Also the _isexecutable function's attempt at windows compatibility is still not working because I was unsure of how to use just a string of a browser name like 'chrome' to determine if a file is on a system. This leaves _tryorder not properly containing the browsers on the system. This leaves the module's open, open_new and open_new_tab not properly working either just the WindowsDefault open method. Any feed back and direction from here is most welcome. -- nosy: +jbmilam Added file: http://bugs.python.org/file36110/webbrowserdebug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8232] webbrowser.open incomplete on Windows
Brandon Milam added the comment: How the _isexecutable function is set up now it would require a full path name in order to be able to tell if a specific browser is on the system. The area under platform support for windows checks for multiple browsers using this function but only passes it browser names and so it always returns false and does not add any browsers to _tryorder. I found a way to fix this using os.walk so that the simple strings of the browser names like firefox.exe is able to actually able to be found on the system. This method is rather slow though and the module wants to check for 8 browsers when imported. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com