From issworld2000 at yahoo.com Wed Feb 8 05:02:09 2017 From: issworld2000 at yahoo.com (Djordje Spasic) Date: Wed, 8 Feb 2017 10:02:09 +0000 (UTC) Subject: [Ironpython-users] IronPython 2.7.0 vs 2.7.5 References: <1982017225.340178.1486548129285.ref@mail.yahoo.com> Message-ID: <1982017225.340178.1486548129285@mail.yahoo.com> Hello, I am using?Rhino 5, and Rhino WIP applications shipped with IronPython 2.7.0 and 2.7.5 version respectively. I have an issue with?time.strptime function. The following code works perfectly on IronPython 2.7.0: import timedate = "JAN/30/2017"date_timeStruct = time.strptime(date,"%m/%d/%Y") Once IronPython 2.7.5 is installed, it fails with this error message on the third line: Runtime error (ValueErrorException): time data does not match format data=JAN/30/2017, fmt=%m/%d/%Y, to: M'/'d'/'yyyy Is there a way of making the time.strptime function work on both 2.7.0 and 2.7.5 versions? I would appreciate any kind of reply. Thank you in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pawel.jasinski at gmail.com Wed Feb 8 06:48:36 2017 From: pawel.jasinski at gmail.com (Pawel Jasinski) Date: Wed, 8 Feb 2017 12:48:36 +0100 Subject: [Ironpython-users] IronPython 2.7.0 vs 2.7.5 In-Reply-To: <1982017225.340178.1486548129285@mail.yahoo.com> References: <1982017225.340178.1486548129285.ref@mail.yahoo.com> <1982017225.340178.1486548129285@mail.yahoo.com> Message-ID: hi, prior to 2.7.5, the strptime had a non standard fallback. If a format didn't match, it tried to guess format. This is not what standard lib from cpython does. If the string can not be converted using format, it fails. In you case %m translates to zero padded month decimal, 01 for January Try %b instead. --pawel On Wed, Feb 8, 2017 at 11:02 AM, Djordje Spasic via Ironpython-users < ironpython-users at python.org> wrote: > Hello, > > I am using Rhino 5, and Rhino WIP applications > shipped with IronPython 2.7.0 and 2.7.5 version respectively. > > I have an issue with time.strptime > > function. > The following code works perfectly on IronPython 2.7.0: > > *import *time > date = "JAN/30/2017" > date_timeStruct = time.*strptime*(date, "%m/%d/%Y") > > > Once IronPython 2.7.5 is installed, it fails with this error message on > the third line: > > Runtime error (ValueErrorException): time data does not match format > data=JAN/30/2017, fmt=%m/%d/%Y, to: M'/'d'/'yyyy > > > Is there a way of making the time.strptime function work on both 2.7.0 and > 2.7.5 versions? > > I would appreciate any kind of reply. > > Thank you in advance. > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > https://mail.python.org/mailman/listinfo/ironpython-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From issworld2000 at yahoo.com Wed Feb 8 06:54:17 2017 From: issworld2000 at yahoo.com (Djordje Spasic) Date: Wed, 8 Feb 2017 11:54:17 +0000 (UTC) Subject: [Ironpython-users] IronPython 2.7.0 vs 2.7.5 In-Reply-To: References: <1982017225.340178.1486548129285.ref@mail.yahoo.com> <1982017225.340178.1486548129285@mail.yahoo.com> Message-ID: <736750193.408831.1486554857931@mail.yahoo.com> Thank you for the quick response Pawel! So I need to change: import timedate = "JAN/30/2017"date_timeStruct = time.strptime(date,"%m/%d/%Y") To: import timedate = "JAN/30/2017"date_timeStruct = time.strptime(date,"%b/%d/%Y") Did I understand that correctly? And time.strptime(date,"%b/%d/%Y") will work on both IronPython 2.7.0 and IronPython 2.7.5? It is essential for me to have a solution which will work on both versions. On Wednesday, February 8, 2017 12:48 PM, Pawel Jasinski wrote: hi, prior to 2.7.5, the strptime had a non standard fallback. If a format didn't match, it tried to guess format. This is not what standard lib from cpython does. If the string can not be converted using format, it fails. In you case %m translates to zero padded month decimal, 01 for January Try %b instead. --pawel On Wed, Feb 8, 2017 at 11:02 AM, Djordje Spasic via Ironpython-users wrote: Hello, I am using?Rhino 5, and Rhino WIP applications shipped with IronPython 2.7.0 and 2.7.5 version respectively. I have an issue with?time.strptime function. The following code works perfectly on IronPython 2.7.0: import timedate = "JAN/30/2017"date_timeStruct = time.strptime(date,"%m/%d/%Y") Once IronPython 2.7.5 is installed, it fails with this error message on the third line: Runtime error (ValueErrorException): time data does not match format data=JAN/30/2017, fmt=%m/%d/%Y, to: M'/'d'/'yyyy Is there a way of making the time.strptime function work on both 2.7.0 and 2.7.5 versions? I would appreciate any kind of reply. Thank you in advance. ______________________________ _________________ Ironpython-users mailing list Ironpython-users at python.org https://mail.python.org/ mailman/listinfo/ironpython- users -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Wed Feb 8 07:22:41 2017 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Wed, 8 Feb 2017 21:22:41 +0900 Subject: [Ironpython-users] IronPython 2.7.0 vs 2.7.5 In-Reply-To: <736750193.408831.1486554857931@mail.yahoo.com> References: <1982017225.340178.1486548129285.ref@mail.yahoo.com> <1982017225.340178.1486548129285@mail.yahoo.com> <736750193.408831.1486554857931@mail.yahoo.com> Message-ID: 2017-02-08 20:54 GMT+09:00 Djordje Spasic via Ironpython-users : > So I need to change: > > import time > date = "JAN/30/2017" > date_timeStruct = time.strptime(date, "%m/%d/%Y") > > To: > > import time > date = "JAN/30/2017" > date_timeStruct = time.strptime(date, "%b/%d/%Y") > > Did I understand that correctly? Yes. > And time.strptime(date, "%b/%d/%Y") will work on both IronPython 2.7.0 and > IronPython 2.7.5? Yes. -- Seo Sanghyeon From issworld2000 at yahoo.com Tue Feb 14 18:49:10 2017 From: issworld2000 at yahoo.com (Djordje Spasic) Date: Tue, 14 Feb 2017 23:49:10 +0000 (UTC) Subject: [Ironpython-users] System.Net.WebClient and urllib.urlretrieve fail to download a file References: <772484857.4919464.1487116150368.ref@mail.yahoo.com> Message-ID: <772484857.4919464.1487116150368@mail.yahoo.com> Hello,I have a small ironpython 2.7 function which downloads a particular?.osm file from overpass-api.de website. The function is working without a problem on my PC. However, on PC of another person, it fails. That person is using Windows 10 x64 (not sure if this information is of any significance), while I am using Windows XP 32 bit (way too old, sorry for that). Here is the function's code: import Systemimport urllib?def downloadFile(downloadLink,downloadedFilePath):??? try:??????? # try "secure http" download??????? client = System.Net.WebClient()??????? client.DownloadFile(downloadLink,downloadedFilePath)??? except Exception, e:??????? print "e1: ", e??????? try:??????????? # "secure http" failed, try"http" download:??????????? filePath, infoHeader = urllib.urlretrieve(downloadLink,downloadedFilePath)??????? except Exception, e:??????????? print "e2: ", e??????????? # downloading of file failed??????????? fileDownloaded_success = False??????????? return fileDownloaded_success??? ??? fileDownloaded_success = True??? return fileDownloaded_success??download = True? # switchif download == True:??? downloadLink = "http://overpass-api.de/api/map?bbox=-74.0118232808,40.7028304899,-74.0094567192,40.7046315099"???downloadedFilePath = "c:/map.osm"???fileDownloaded_success = downloadFile(downloadLink,downloadedFilePath)??? print"fileDownloaded_success: ",fileDownloaded_success Mentioned person gets the following printed to his console, after running the code: e1: Unable to connect to the remote server e2: [Errno socket error] getaddrinfo returns an empty list fileDownloaded_success: False He tried turning off both his Antivirus and Windows Firewall, and the upper two error messages did not go away. We can not use a newer version of IronPython, as 2.7 is what is shipped with Rhino5 application (we basically use IronPython 2.7 editor inside Rhino5 application). I would be grateful for any kind of reply, as I do not know what is the problem at his place. I did some googling with?similar error message, but I do not know if this could be the same situation. Thank you in advance!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From issworld2000 at yahoo.com Wed Feb 15 05:27:23 2017 From: issworld2000 at yahoo.com (Djordje Spasic) Date: Wed, 15 Feb 2017 10:27:23 +0000 (UTC) Subject: [Ironpython-users] System.Net.WebClient and urllib.urlretrieve fail to download a file In-Reply-To: <67E668A4808B47118D377D6CE10B721A@AndyDesktop> References: <772484857.4919464.1487116150368.ref@mail.yahoo.com> <772484857.4919464.1487116150368@mail.yahoo.com> <67E668A4808B47118D377D6CE10B721A@AndyDesktop> Message-ID: <20918342.5212535.1487154443075@mail.yahoo.com> On Wednesday, February 15, 2017 11:17 AM, Kuno Meyer wrote: Hi Since the download with System.Net.WebClient() also fails (which is standard .NET Framework code and is not related to IronPython), I propose to check your network connectivity and for interfering company firewalls. Are you able to download the file with a browser? Maybe you need some manual proxy configuration (even though, according to MSDN, WebClient uses by default the IE setup.) Regards, Kuno Thank you for the reply Kuno! Everything is fine on my PC, the other user who uses the code below has the issue. He tried to manually download the mentioned file, and succeeded without a problem (in Chrome). If WebClient is using default IE setup, then does he need to try to download the file in Internet Explorer? On Wednesday, February 15, 2017 9:59 AM, Andrew Graham wrote: Your code obviously works given the correct environment in which to run. A major difference between XP and Windows 10 is the permissions system so the first thing I would try is to make sure that the application is runnning as Administrator on the Windows 10 system.?RegardsAndrew Graham Thank you for the reply Andrew! I will check with him to see if he runs the Rhino5 as an Administrator. ? ?From: Djordje Spasic via Ironpython-users Sent: Tuesday, February 14, 2017 11:49 PMTo: Discussion of IronPython Subject: [Ironpython-users] System.Net.WebClient and urllib.urlretrieve fail to download a file?Hello,I have a small ironpython 2.7 function which downloads a particular .osm file from overpass-api.de website. The function is working without a problem on my PC. However, on PC of another person, it fails. That person is using Windows 10 x64 (not sure if this information is of any significance), while I am using Windows XP 32 bit (way too old, sorry for that). Here is the function's code: import System import urllib ? def downloadFile(downloadLink, downloadedFilePath): ??? try: ??????? # try "secure http" download ??????? client = System.Net.WebClient() ??????? client.DownloadFile(downloadLink, downloadedFilePath) ??? except Exception, e: ??????? print "e1: ", e ??????? try: ??????????? # "secure http" failed, try "http" download: ??????????? filePath, infoHeader = urllib.urlretrieve(downloadLink, downloadedFilePath) ??????? except Exception, e: ??????????? print "e2: ", e ??????????? # downloading of file failed ??????????? fileDownloaded_success = False ??????????? return fileDownloaded_success ??? ??? fileDownloaded_success = True ??? return fileDownloaded_success ? ? download = True? # switch if download == True: ??? downloadLink = "http://overpass-api.de/api/map?bbox=-74.0118232808,40.7028304899,-74.0094567192,40.7046315099" ??? downloadedFilePath = "c:/map.osm" ??? fileDownloaded_success = downloadFile(downloadLink, downloadedFilePath) ??? print "fileDownloaded_success: ", fileDownloaded_success Mentioned person gets the following printed to his console, after running the code: e1: Unable to connect to the remote server e2: [Errno socket error] getaddrinfo returns an empty list fileDownloaded_success: False He tried turning off both his Antivirus and Windows Firewall, and the upper two error messages did not go away.?We can not use a newer version of IronPython, as 2.7 is what is shipped with Rhino5 application (we basically use IronPython 2.7 editor inside Rhino5 application).?I would be grateful for any kind of reply, as I do not know what is the problem at his place. I did some googling with similar error message, but I do not know if this could be the same situation. ?Thank you in advance!! _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org https://mail.python.org/mailman/listinfo/ironpython-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From issworld2000 at yahoo.com Wed Feb 15 14:20:35 2017 From: issworld2000 at yahoo.com (Djordje Spasic) Date: Wed, 15 Feb 2017 19:20:35 +0000 (UTC) Subject: [Ironpython-users] System.Net.WebClient and urllib.urlretrieve fail to download a file In-Reply-To: <20918342.5212535.1487154443075@mail.yahoo.com> References: <772484857.4919464.1487116150368.ref@mail.yahoo.com> <772484857.4919464.1487116150368@mail.yahoo.com> <67E668A4808B47118D377D6CE10B721A@AndyDesktop> <20918342.5212535.1487154443075@mail.yahoo.com> Message-ID: <1401579553.5606008.1487186435661@mail.yahoo.com> Hi Kuno, The user tried downloading the file manually with Internet Explorer by pasting the url in IE's address bar and pressing Enter. And the file was downloaded without a problem.Is there some code example which shows how to manually set proxy configuration in Ironpython? Hi Andrew, The user tried running the Rhino5 application (which contains IronPython 2.7 editor) on his Windows 10, by right clicking on the Rhino5 icon, and choosing: "Run as Administrator". After this, he still got the previously mentioned two error messages: e1: Unable to connect to the remote server e2: [Errno socket error] getaddrinfo returns an empty list Is there another way in which he might need to run the Rhino5 application as an Administrator? I would be grateful for any kind reply. On Wednesday, February 15, 2017 11:27 AM, Djordje Spasic wrote: On Wednesday, February 15, 2017 11:17 AM, Kuno Meyer wrote: Hi Since the download with System.Net.WebClient() also fails (which is standard .NET Framework code and is not related to IronPython), I propose to check your network connectivity and for interfering company firewalls. Are you able to download the file with a browser? Maybe you need some manual proxy configuration (even though, according to MSDN, WebClient uses by default the IE setup.) Regards, Kuno Thank you for the reply Kuno! Everything is fine on my PC, the other user who uses the code below has the issue. He tried to manually download the mentioned file, and succeeded without a problem (in Chrome). If WebClient is using default IE setup, then does he need to try to download the file in Internet Explorer? On Wednesday, February 15, 2017 9:59 AM, Andrew Graham wrote: Your code obviously works given the correct environment in which to run. A major difference between XP and Windows 10 is the permissions system so the first thing I would try is to make sure that the application is runnning as Administrator on the Windows 10 system.?RegardsAndrew Graham Thank you for the reply Andrew! I will check with him to see if he runs the Rhino5 as an Administrator. ? ?From: Djordje Spasic via Ironpython-users Sent: Tuesday, February 14, 2017 11:49 PMTo: Discussion of IronPython Subject: [Ironpython-users] System.Net.WebClient and urllib.urlretrieve fail to download a file?Hello,I have a small ironpython 2.7 function which downloads a particular .osm file from overpass-api.de website. The function is working without a problem on my PC. However, on PC of another person, it fails. That person is using Windows 10 x64 (not sure if this information is of any significance), while I am using Windows XP 32 bit (way too old, sorry for that). Here is the function's code: import System import urllib ? def downloadFile(downloadLink, downloadedFilePath): ??? try: ??????? # try "secure http" download ??????? client = System.Net.WebClient() ??????? client.DownloadFile(downloadLink, downloadedFilePath) ??? except Exception, e: ??????? print "e1: ", e ??????? try: ??????????? # "secure http" failed, try "http" download: ??????????? filePath, infoHeader = urllib.urlretrieve(downloadLink, downloadedFilePath) ??????? except Exception, e: ??????????? print "e2: ", e ??????????? # downloading of file failed ??????????? fileDownloaded_success = False ??????????? return fileDownloaded_success ??? ??? fileDownloaded_success = True ??? return fileDownloaded_success ? ? download = True? # switch if download == True: ??? downloadLink = "http://overpass-api.de/api/map?bbox=-74.0118232808,40.7028304899,-74.0094567192,40.7046315099" ??? downloadedFilePath = "c:/map.osm" ??? fileDownloaded_success = downloadFile(downloadLink, downloadedFilePath) ??? print "fileDownloaded_success: ", fileDownloaded_success Mentioned person gets the following printed to his console, after running the code: e1: Unable to connect to the remote server e2: [Errno socket error] getaddrinfo returns an empty list fileDownloaded_success: False He tried turning off both his Antivirus and Windows Firewall, and the upper two error messages did not go away.?We can not use a newer version of IronPython, as 2.7 is what is shipped with Rhino5 application (we basically use IronPython 2.7 editor inside Rhino5 application).?I would be grateful for any kind of reply, as I do not know what is the problem at his place. I did some googling with similar error message, but I do not know if this could be the same situation. ?Thank you in advance!! _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org https://mail.python.org/mailman/listinfo/ironpython-users -------------- next part -------------- An HTML attachment was scrubbed... URL: