Python Forum
cx_freeze frozen executive introduces WinError 10049
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cx_freeze frozen executive introduces WinError 10049
#1
I am building a matching set of utilities to provide text transmission between two computers on the same network.

I started with sample code from a python cookbook. There is a sender and receiver code base that function in their role.

I have made some improvements and modifications to the code that make it more useful to the environment where this is to be used.

The code works perfectly when it is functioning strictly on the Python 3.6 interpreter.

When I freeze it with cx_freeze, both companion programs build fine. The strange thing is that that sender executes works perfectly while the receiver bombs out.

Here is the Traceback for your reference:
Error:
Traceback (most recent call last): File "C:\Python\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run module.run() File "C:\Python\lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run exec(code, {'__name__': '__main__'}) File "Receiver.py", line 24, in <module> OSError: [WinError 10049] The requested address is not valid in its context
Below are both my sender.py and receiver.py. The portion that is breaking in the receiver executable is identical to what is used in the sender (except for IP address, which is valid).

Any insight in this problem would be greatly appreciated and feel free to use this code for your own purpose. As I said, the py version works like a charm.

Receiver.py - Written for Python 3.6 windows
import os
import sys
import subprocess
from socket import *

subprocess.call("cls", shell=True)

theargis = ''

if len(sys.argv) > 1:
    theargis +=str(sys.argv[1])

if theargis > '':
    host = theargis
    print ("Using Client Address of: " + theargis)
else:
    host = "53.68.241.25"
    print ("Using Default Address!")

port = 13000
buf = 1024
addr = (host, port)
UDPSock = socket(AF_INET, SOCK_DGRAM)
UDPSock.bind(addr)

print ("Waiting to receive messages...")

while True:
    (data, addr) = UDPSock.recvfrom(buf)
    print ("Production number: " + data.decode("utf-8"))
    if data.decode("utf-8").upper() == "EXIT":
        break

UDPSock.close()
os._exit(0)
Sender.py - Written for Python 3.6 windows
import os
import sys
import subprocess
from socket import *

subprocess.call("cls", shell=True)

theargis = ''

if len(sys.argv) > 1:
    theargis +=str(sys.argv[1])

if theargis > '':
    host = theargis
    print ("Using Server Address of: " + theargis)
else:
    host = "53.68.240.47" 
    print ("Using Default Address!")

port = 13000
addr = (host, port)
UDPSock = socket(AF_INET, SOCK_DGRAM)

while True:
    data = input("Enter message to send or type 'EXIT': ")
    bytes = data.encode()
    UDPSock.sendto(bytes, addr)
    if data.upper() == "EXIT":
        break

UDPSock.close()
os._exit(0)
Reply


Messages In This Thread
cx_freeze frozen executive introduces WinError 10049 - by KipCarter - Jan-10-2020, 03:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  FileNotFoundError: [WinError 2] The system cannot find the file specified NewBiee 2 1,661 Jul-31-2023, 11:42 AM
Last Post: deanhystad
  WinError 2, since fresh new Windows 10 install alok 1 1,688 Jan-06-2022, 11:20 PM
Last Post: lucasbazan
  Problem with cx_freeze app only on one pc floatingshed 0 1,819 Mar-19-2021, 05:19 PM
Last Post: floatingshed
Exclamation Help with cx_Freeze mederic39 3 2,942 Jan-31-2021, 12:05 PM
Last Post: snippsat
  pyarrow throws oserror winerror 193 1 is not a valid win32 application aupres 2 3,865 Oct-21-2020, 01:04 AM
Last Post: aupres
  WinError 87 while running .exe file Timych 0 2,432 Aug-06-2020, 02:36 PM
Last Post: Timych
  Sublime Text 3 WinError 2 File Specified HelloWorld17 0 2,851 Apr-02-2020, 09:03 AM
Last Post: HelloWorld17
  Python 3.6 Alternatives to Cx_Freeze KipCarter 5 5,105 Jan-14-2020, 11:51 AM
Last Post: KipCarter
  cx_freeze exe does not work? Skycoder 4 6,422 Jan-13-2020, 06:50 PM
Last Post: KipCarter
  .py to exe error "oserror winerror 193" michael1789 3 4,940 Dec-03-2019, 05:49 AM
Last Post: michael1789

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020